Fehler #2400 FormprocessException, modul ccm-forum
git-svn-id: https://svn.libreccm.org/ccm/trunk@3126 8810af33-2d31-482b-a856-94f89814c4dfmaster
parent
f16a3d3d59
commit
0eeb193d7d
|
|
@ -148,3 +148,5 @@ ui.admin.sysinfo.xml_document_builder=XML Document Builder
|
|||
ui.admin.sysinfo.sax_parser_factory=SAX Parser Factory
|
||||
ui.admin.sysinfo.sax_parser=SAX Parser
|
||||
ui.admin.sysinfo.xml_config=XML config
|
||||
#ID ist null
|
||||
ui.admin.groups.ID_is_null=ID is null
|
||||
|
|
|
|||
|
|
@ -148,3 +148,5 @@ ui.admin.sysinfo.xml_document_builder=XML Document Builder
|
|||
ui.admin.sysinfo.sax_parser_factory=SAX Parser Factory
|
||||
ui.admin.sysinfo.sax_parser=SAX Parser
|
||||
ui.admin.sysinfo.xml_config=XML Konfiguration
|
||||
#ID ist null
|
||||
ui.admin.groups.ID_is_null=ID is null
|
||||
|
|
|
|||
|
|
@ -106,3 +106,5 @@ ui.admin.applications.ApplicationInstancePane.title.label=Title of the instance
|
|||
ui.admin.applications.ApplicationInstancePane.parent_app.label=Parent application
|
||||
i.admin.cancel=Cancel
|
||||
ui.admin.cancel_msg=Submission cancelled
|
||||
#ID ist null
|
||||
ui.admin.groups.ID_is_null=
|
||||
|
|
|
|||
|
|
@ -6,6 +6,7 @@ forum.ui.receive_daily_summary=Receive daily summary
|
|||
|
||||
forum.ui.modeAlerts=Alerts
|
||||
forum.ui.modeThreads=Threads
|
||||
#Received bad option for instant:
|
||||
forum.ui.modeTopics=Topics
|
||||
forum.ui.modeModeration=Moderation
|
||||
forum.ui.modeSetup=Setup
|
||||
|
|
@ -66,3 +67,7 @@ forum.ui.validation.file_not_uploaded=To add the specified file, use the Add Fil
|
|||
forum.ui.validation.introduction_too_long=Your introduction is too long, only 4000 characters can be stored
|
||||
forum.ui.settings.public=Forum is public
|
||||
forum.ui.admin.no_settings=No settings available
|
||||
#schlechte Option erhalten f\u00fcr:
|
||||
forum.ui.alerts.received_bad_option=Received bad option for instant:
|
||||
forum.ui.alerts.received_bad_option_daily=Received bad option for daily:
|
||||
forum.ui.cancelled=Cancelled
|
||||
|
|
|
|||
|
|
@ -66,3 +66,7 @@ forum.ui.validation.file_not_uploaded=To add the specified file, use the Add Fil
|
|||
forum.ui.validation.introduction_too_long=Die Einf\u00fchrung ist zu lang, maximal 4000 Zeichen sind zugelassen.
|
||||
forum.ui.settings.public=Forum ist \u00f6ffentlich
|
||||
forum.ui.admin.no_settings=Keine Einstellungen verf\u00fcgbar.
|
||||
#schlechte Option erhalten f\u00fcr:
|
||||
forum.ui.alerts.received_bad_option=Schlechte Option erhalten f\u00fcr:
|
||||
forum.ui.alerts.received_bad_option_daily=Schlechte Option erhalten f\u00fcr daily:
|
||||
forum.ui.cancelled=Abgebrochen
|
||||
|
|
|
|||
|
|
@ -60,3 +60,7 @@ forum.ui.topics=Topics
|
|||
forum.ui.thread.viewAll=View all threads
|
||||
forum.ui.settings.public=
|
||||
forum.ui.admin.no_settings=
|
||||
#schlechte Option erhalten f\u00fcr:
|
||||
forum.ui.alerts.received_bad_option=Received bad option for instant:
|
||||
forum.ui.alerts.received_bad_option_daily=Received bad option for daily:
|
||||
forum.ui.cancelled=Cancelled
|
||||
|
|
|
|||
|
|
@ -18,7 +18,6 @@
|
|||
*/
|
||||
package com.arsdigita.forum.ui;
|
||||
|
||||
|
||||
import com.arsdigita.forum.util.GlobalizationUtil;
|
||||
import com.arsdigita.bebop.ColumnPanel;
|
||||
import com.arsdigita.bebop.Component;
|
||||
|
|
@ -55,12 +54,12 @@ import java.math.BigDecimal;
|
|||
import org.apache.log4j.Logger;
|
||||
|
||||
/**
|
||||
*
|
||||
*
|
||||
*
|
||||
*
|
||||
*/
|
||||
class ForumAlertsView extends SimpleContainer implements Constants {
|
||||
private static final Logger s_log = Logger.getLogger
|
||||
(ForumAlertsView.class);
|
||||
|
||||
private static final Logger s_log = Logger.getLogger(ForumAlertsView.class);
|
||||
|
||||
/**
|
||||
* Standard Constructor
|
||||
|
|
@ -71,15 +70,15 @@ class ForumAlertsView extends SimpleContainer implements Constants {
|
|||
}
|
||||
|
||||
private Component forumAlertsSegment() {
|
||||
SimpleContainer seg = new SimpleContainer(FORUM_XML_PREFIX + ":forumAlerts",
|
||||
FORUM_XML_NS);
|
||||
SimpleContainer seg = new SimpleContainer(FORUM_XML_PREFIX + ":forumAlerts",
|
||||
FORUM_XML_NS);
|
||||
seg.add(forumAlertsForm());
|
||||
return seg;
|
||||
}
|
||||
|
||||
private Component threadAlertsSegment() {
|
||||
SimpleContainer seg = new SimpleContainer(FORUM_XML_PREFIX + ":threadAlerts",
|
||||
FORUM_XML_NS);
|
||||
SimpleContainer seg = new SimpleContainer(FORUM_XML_PREFIX + ":threadAlerts",
|
||||
FORUM_XML_NS);
|
||||
seg.add(threadAlertsForm());
|
||||
return seg;
|
||||
}
|
||||
|
|
@ -103,67 +102,65 @@ class ForumAlertsView extends SimpleContainer implements Constants {
|
|||
alertsForm.add(new Submit(GlobalizationUtil.gz("forum.ui.save")));
|
||||
|
||||
alertsForm.addInitListener(new FormInitListener() {
|
||||
public void init(FormSectionEvent e) {
|
||||
FormData data = e.getFormData();
|
||||
PageState s = e.getPageState();
|
||||
Party party = Kernel.getContext().getParty();
|
||||
Forum forum = ForumContext.getContext(s).getForum();
|
||||
public void init(FormSectionEvent e) {
|
||||
FormData data = e.getFormData();
|
||||
PageState s = e.getPageState();
|
||||
Party party = Kernel.getContext().getParty();
|
||||
Forum forum = ForumContext.getContext(s).getForum();
|
||||
|
||||
ForumSubscription fSub =
|
||||
ForumSubscription.getFromForum(forum);
|
||||
if (fSub.isSubscribed(party)) {
|
||||
instant.setValue(s,GlobalizationUtil.gzAsStr("forum.ui.yes"));
|
||||
} else {
|
||||
instant.setValue(s, GlobalizationUtil.gzAsStr("forum.ui.no"));
|
||||
}
|
||||
|
||||
DailySubscription dSub = (DailySubscription)
|
||||
DailySubscription.getFromForum(forum);
|
||||
if (dSub.isSubscribed(party)) {
|
||||
daily.setValue(s,GlobalizationUtil.gzAsStr("forum.ui.yes"));
|
||||
} else {
|
||||
daily.setValue(s, GlobalizationUtil.gzAsStr("forum.ui.no"));
|
||||
}
|
||||
ForumSubscription fSub
|
||||
= ForumSubscription.getFromForum(forum);
|
||||
if (fSub.isSubscribed(party)) {
|
||||
instant.setValue(s, GlobalizationUtil.gzAsStr("forum.ui.yes"));
|
||||
} else {
|
||||
instant.setValue(s, GlobalizationUtil.gzAsStr("forum.ui.no"));
|
||||
}
|
||||
});
|
||||
|
||||
DailySubscription dSub = (DailySubscription) DailySubscription.getFromForum(forum);
|
||||
if (dSub.isSubscribed(party)) {
|
||||
daily.setValue(s, GlobalizationUtil.gzAsStr("forum.ui.yes"));
|
||||
} else {
|
||||
daily.setValue(s, GlobalizationUtil.gzAsStr("forum.ui.no"));
|
||||
}
|
||||
}
|
||||
});
|
||||
|
||||
alertsForm.addProcessListener(new FormProcessListener() {
|
||||
public void process(FormSectionEvent e)
|
||||
public void process(FormSectionEvent e)
|
||||
throws FormProcessException {
|
||||
|
||||
FormData data = e.getFormData();
|
||||
PageState s = e.getPageState();
|
||||
Party party = Kernel.getContext().getParty();
|
||||
Forum forum = ForumContext.getContext(s).getForum();
|
||||
FormData data = e.getFormData();
|
||||
PageState s = e.getPageState();
|
||||
Party party = Kernel.getContext().getParty();
|
||||
Forum forum = ForumContext.getContext(s).getForum();
|
||||
|
||||
ForumSubscription fSub =
|
||||
ForumSubscription.getFromForum(forum);
|
||||
DailySubscription dSub = (DailySubscription)
|
||||
DailySubscription.getFromForum(forum);
|
||||
ForumSubscription fSub
|
||||
= ForumSubscription.getFromForum(forum);
|
||||
DailySubscription dSub = (DailySubscription) DailySubscription.getFromForum(forum);
|
||||
|
||||
if (data.get("instant").equals(GlobalizationUtil.gzAsStr("forum.ui.yes"))) {
|
||||
fSub.subscribe(party);
|
||||
} else if (data.get("instant").equals(GlobalizationUtil.gzAsStr("forum.ui.no"))) {
|
||||
fSub.unsubscribe(party);
|
||||
} else {
|
||||
throw new FormProcessException(
|
||||
"Received bad option for instant: "
|
||||
+ data.get("instant"));
|
||||
}
|
||||
fSub.save();
|
||||
|
||||
if (data.get("daily").equals(GlobalizationUtil.gzAsStr("forum.ui.yes"))) {
|
||||
dSub.subscribe(party);
|
||||
} else if (data.get("daily").equals(GlobalizationUtil.gzAsStr("forum.ui.no"))) {
|
||||
dSub.unsubscribe(party);
|
||||
} else {
|
||||
throw new FormProcessException(
|
||||
"Received bad option for daily: "
|
||||
+ data.get("daily"));
|
||||
}
|
||||
dSub.save();
|
||||
if (data.get("instant").equals(GlobalizationUtil.gzAsStr("forum.ui.yes"))) {
|
||||
fSub.subscribe(party);
|
||||
} else if (data.get("instant").equals(GlobalizationUtil.gzAsStr("forum.ui.no"))) {
|
||||
fSub.unsubscribe(party);
|
||||
} else {
|
||||
throw new FormProcessException(GlobalizationUtil.gz(
|
||||
"forum.ui.alerts.received_bad_option"
|
||||
+ data.get("instant")));
|
||||
}
|
||||
});
|
||||
fSub.save();
|
||||
|
||||
if (data.get("daily").equals(GlobalizationUtil.gzAsStr("forum.ui.yes"))) {
|
||||
dSub.subscribe(party);
|
||||
} else if (data.get("daily").equals(GlobalizationUtil.gzAsStr("forum.ui.no"))) {
|
||||
dSub.unsubscribe(party);
|
||||
} else {
|
||||
throw new FormProcessException(GlobalizationUtil.gz(
|
||||
"forum.ui.alerts.received_bad_option_daily"
|
||||
+ data.get("daily")));
|
||||
}
|
||||
dSub.save();
|
||||
}
|
||||
});
|
||||
return alertsForm;
|
||||
}
|
||||
|
||||
|
|
@ -171,40 +168,40 @@ class ForumAlertsView extends SimpleContainer implements Constants {
|
|||
Form form = new Form("dailyAlerts");
|
||||
form.setRedirecting(true);
|
||||
form.add(new ThreadAlertsList() {
|
||||
public Element generateAlertXML(ThreadSubscription sub) {
|
||||
Element subEl = super.generateAlertXML(sub);
|
||||
|
||||
subEl.addAttribute("param", "delete");
|
||||
return subEl;
|
||||
}
|
||||
});
|
||||
|
||||
public Element generateAlertXML(ThreadSubscription sub) {
|
||||
Element subEl = super.generateAlertXML(sub);
|
||||
|
||||
subEl.addAttribute("param", "delete");
|
||||
return subEl;
|
||||
}
|
||||
});
|
||||
|
||||
CheckboxGroup boxes = new CheckboxGroup(
|
||||
new ArrayParameter(new BigDecimalParameter("delete")));
|
||||
new ArrayParameter(new BigDecimalParameter("delete")));
|
||||
form.add(boxes);
|
||||
|
||||
|
||||
form.add(new Submit(GlobalizationUtil.gz("forum.ui.delete")),
|
||||
FULL_WIDTH | RIGHT);
|
||||
|
||||
FULL_WIDTH | RIGHT);
|
||||
|
||||
form.addProcessListener(new DeleteProcesser());
|
||||
|
||||
|
||||
return form;
|
||||
}
|
||||
|
||||
class DeleteProcesser implements FormProcessListener {
|
||||
|
||||
public void process(FormSectionEvent e) {
|
||||
FormData data = e.getFormData();
|
||||
PageState s = e.getPageState();
|
||||
Party party = Kernel.getContext().getParty();
|
||||
|
||||
BigDecimal[] deletes = (BigDecimal[])
|
||||
data.get("delete");
|
||||
|
||||
|
||||
BigDecimal[] deletes = (BigDecimal[]) data.get("delete");
|
||||
|
||||
if (deletes != null) {
|
||||
for (int i = 0; i < deletes.length ; i++) {
|
||||
for (int i = 0; i < deletes.length; i++) {
|
||||
try {
|
||||
ThreadSubscription tSub =
|
||||
new ThreadSubscription(deletes[i]);
|
||||
ThreadSubscription tSub
|
||||
= new ThreadSubscription(deletes[i]);
|
||||
tSub.unsubscribe(party);
|
||||
tSub.save();
|
||||
} catch (DataObjectNotFoundException x) {
|
||||
|
|
|
|||
|
|
@ -98,7 +98,7 @@ public class TopicAddForm extends Form {
|
|||
PageState state = e.getPageState();
|
||||
if (cancel.isSelected(state)){
|
||||
fireCompletionEvent(state);
|
||||
throw new FormProcessException("cancelled");
|
||||
throw new FormProcessException(GlobalizationUtil.gz("forum.ui.cancelled"));
|
||||
}
|
||||
}
|
||||
});
|
||||
|
|
|
|||
|
|
@ -51,12 +51,11 @@ import com.arsdigita.web.Application;
|
|||
import org.apache.log4j.Logger;
|
||||
|
||||
/**
|
||||
* Form that allows forum admin to set options
|
||||
* that apply to this forum instance
|
||||
* Form that allows forum admin to set options that apply to this forum instance
|
||||
*/
|
||||
public class SetupView extends Form
|
||||
implements FormInitListener, FormSubmissionListener,
|
||||
FormProcessListener, Constants {
|
||||
public class SetupView extends Form
|
||||
implements FormInitListener, FormSubmissionListener,
|
||||
FormProcessListener, Constants {
|
||||
|
||||
private static final Logger s_log = Logger.getLogger(SetupView.class);
|
||||
// values for checkboxes
|
||||
|
|
@ -86,38 +85,38 @@ public class SetupView extends Form
|
|||
m_settings = new CheckboxGroup("settings");
|
||||
|
||||
m_settings.addOption(new Option(MODERATED,
|
||||
new Label(GlobalizationUtil.gz(
|
||||
"forum.ui.settings.moderated"))
|
||||
));
|
||||
new Label(GlobalizationUtil.gz(
|
||||
"forum.ui.settings.moderated"))
|
||||
));
|
||||
m_settings.addOption(new Option(PUBLIC,
|
||||
new Label( GlobalizationUtil.gz(
|
||||
"forum.ui.settings.public"))
|
||||
));
|
||||
new Label(GlobalizationUtil.gz(
|
||||
"forum.ui.settings.public"))
|
||||
));
|
||||
m_settings.addOption(new Option(NOTICEBOARD,
|
||||
new Label(GlobalizationUtil.gz(
|
||||
"forum.ui.settings.noticeboard"))
|
||||
));
|
||||
new Label(GlobalizationUtil.gz(
|
||||
"forum.ui.settings.noticeboard"))
|
||||
));
|
||||
m_settings.addOption(new Option(ALLOW_FILES,
|
||||
new Label(GlobalizationUtil.gz(
|
||||
"forum.ui.settings.allowFiles"))
|
||||
));
|
||||
new Label(GlobalizationUtil.gz(
|
||||
"forum.ui.settings.allowFiles"))
|
||||
));
|
||||
m_settings.addOption(new Option(ALLOW_IMAGES,
|
||||
new Label(GlobalizationUtil.gz(
|
||||
"forum.ui.settings.allowImages"))
|
||||
));
|
||||
new Label(GlobalizationUtil.gz(
|
||||
"forum.ui.settings.allowImages"))
|
||||
));
|
||||
m_settings.addOption(new Option(AUTOSUBSCRIBE_THREAD_STARTERS,
|
||||
new Label(GlobalizationUtil.gz(
|
||||
"forum.ui.settings.autosubscribe"))
|
||||
));
|
||||
new Label(GlobalizationUtil.gz(
|
||||
"forum.ui.settings.autosubscribe"))
|
||||
));
|
||||
|
||||
m_settings.addOption(new Option(NO_CATEGORY_POSTS_ALLOWED,
|
||||
new Label(GlobalizationUtil.gz(
|
||||
"forum.ui.settings.noCategoryPosts"))
|
||||
));
|
||||
new Label(GlobalizationUtil.gz(
|
||||
"forum.ui.settings.noCategoryPosts"))
|
||||
));
|
||||
m_settings.addOption(new Option(ANONYMOUS_POSTS_ALLOWED,
|
||||
new Label(GlobalizationUtil.gz(
|
||||
"forum.ui.settings.anonymousPosts"))
|
||||
));
|
||||
new Label(GlobalizationUtil.gz(
|
||||
"forum.ui.settings.anonymousPosts"))
|
||||
));
|
||||
|
||||
// preliminary step 2: Create a widget to determin the expiration limit
|
||||
// for the forum GUI
|
||||
|
|
@ -133,24 +132,23 @@ public class SetupView extends Form
|
|||
// preliminary step 4: Create Introductory text area
|
||||
m_introduction = new TextArea("introduction", 8, 60, TextArea.SOFT);
|
||||
m_introduction.addValidationListener(
|
||||
new StringInRangeValidationListener(0, 4000,
|
||||
GlobalizationUtil.gz(
|
||||
"forum.ui.validation.introduction_too_long")
|
||||
));
|
||||
// m_introduction.setMetaDataAttribute("label", (String) GlobalizationUtil.gz(
|
||||
// "forum.ui.settings.introduction").localize());
|
||||
new StringInRangeValidationListener(0, 4000,
|
||||
GlobalizationUtil.gz(
|
||||
"forum.ui.validation.introduction_too_long")
|
||||
));
|
||||
// m_introduction.setMetaDataAttribute("label", (String) GlobalizationUtil.gz(
|
||||
// "forum.ui.settings.introduction").localize());
|
||||
m_introduction.setLabel(GlobalizationUtil.gz(
|
||||
"forum.ui.settings.introduction"));
|
||||
"forum.ui.settings.introduction"));
|
||||
|
||||
// preliminary step 5: Create title text field
|
||||
m_title = new TextField("title");
|
||||
// m_title.setMetaDataAttribute("label", (String) GlobalizationUtil.gz(
|
||||
// "forum.ui.settings.title").localize());
|
||||
// m_title.setMetaDataAttribute("label", (String) GlobalizationUtil.gz(
|
||||
// "forum.ui.settings.title").localize());
|
||||
m_title.setLabel(GlobalizationUtil.gz(
|
||||
"forum.ui.settings.title"));
|
||||
"forum.ui.settings.title"));
|
||||
m_title.setSize(70);
|
||||
|
||||
|
||||
// ////////////////////////////////////////////////////////////////////
|
||||
// Create the pane
|
||||
// ////////////////////////////////////////////////////////////////////
|
||||
|
|
@ -205,7 +203,8 @@ public class SetupView extends Form
|
|||
|
||||
if (m_saveCancel.getCancelButton().isSelected(state)) {
|
||||
s_log.debug("cancelled");
|
||||
throw new FormProcessException("cancelled");
|
||||
throw new FormProcessException(GlobalizationUtil.gz(
|
||||
"forum.ui.cancelled"));
|
||||
}
|
||||
}
|
||||
|
||||
|
|
|
|||
Loading…
Reference in New Issue