Last part of adopting the generic content types to the new setLabel attribute of Widget.
git-svn-id: https://svn.libreccm.org/ccm/trunk@2738 8810af33-2d31-482b-a856-94f89814c4dfmaster
parent
550c37569b
commit
ea1128367c
|
|
@ -34,7 +34,6 @@ import com.arsdigita.cms.contenttypes.Job;
|
||||||
import com.arsdigita.cms.contenttypes.util.JobGlobalizationUtil;
|
import com.arsdigita.cms.contenttypes.util.JobGlobalizationUtil;
|
||||||
import com.arsdigita.cms.ui.authoring.BasicPageForm;
|
import com.arsdigita.cms.ui.authoring.BasicPageForm;
|
||||||
import com.arsdigita.cms.ui.CMSDHTMLEditor;
|
import com.arsdigita.cms.ui.CMSDHTMLEditor;
|
||||||
import com.arsdigita.cms.util.GlobalizationUtil;
|
|
||||||
|
|
||||||
|
|
||||||
/**
|
/**
|
||||||
|
|
@ -94,77 +93,79 @@ public class JobPropertyForm extends BasicPageForm
|
||||||
/**
|
/**
|
||||||
* Adds widgets to the form.
|
* Adds widgets to the form.
|
||||||
**/
|
**/
|
||||||
|
@Override
|
||||||
protected void addWidgets() {
|
protected void addWidgets() {
|
||||||
|
|
||||||
super.addWidgets();
|
super.addWidgets();
|
||||||
|
|
||||||
// Job content type currently does not use the default
|
// Job content type currently does not use the default
|
||||||
// basic descriuption properties (as persisted in cms-pages and by
|
// basic description properties (as persisted in cms-pages and by
|
||||||
// default part of the object list). Would be convenient to move the
|
// default part of the object list). Would be convenient to move the
|
||||||
// ct specific overview property to basic description.
|
// ct specific overview property to basic description.
|
||||||
add(new Label(JobGlobalizationUtil
|
|
||||||
.globalize("cms.contenttypes.ui.job.overview")));
|
|
||||||
ParameterModel bodyParam = new StringParameter(BODY);
|
ParameterModel bodyParam = new StringParameter(BODY);
|
||||||
CMSDHTMLEditor body = new CMSDHTMLEditor(bodyParam);
|
CMSDHTMLEditor body = new CMSDHTMLEditor(bodyParam);
|
||||||
|
body.setLabel(JobGlobalizationUtil
|
||||||
|
.globalize("cms.contenttypes.ui.job.overview"));
|
||||||
body.setCols(40);
|
body.setCols(40);
|
||||||
body.setRows(10);
|
body.setRows(10);
|
||||||
add(body);
|
add(body);
|
||||||
|
|
||||||
add(new Label(JobGlobalizationUtil
|
|
||||||
.globalize("cms.contenttypes.ui.job.grade")));
|
|
||||||
ParameterModel gradeParam
|
ParameterModel gradeParam
|
||||||
= new StringParameter(GRADE);
|
= new StringParameter(GRADE);
|
||||||
TextField grade = new TextField(gradeParam);
|
TextField grade = new TextField(gradeParam);
|
||||||
|
grade.setLabel(JobGlobalizationUtil
|
||||||
|
.globalize("cms.contenttypes.ui.job.grade"));
|
||||||
grade.setSize(30);
|
grade.setSize(30);
|
||||||
grade.setMaxLength(30);
|
grade.setMaxLength(30);
|
||||||
add(grade);
|
add(grade);
|
||||||
|
|
||||||
add(new Label(JobGlobalizationUtil
|
|
||||||
.globalize("cms.contenttypes.ui.job.closing_date")));
|
|
||||||
ParameterModel closingDateParam
|
ParameterModel closingDateParam
|
||||||
= new DateParameter(CLOSING_DATE);
|
= new DateParameter(CLOSING_DATE);
|
||||||
com.arsdigita.bebop.form.Date closingDate
|
com.arsdigita.bebop.form.Date closingDate
|
||||||
= new com.arsdigita.bebop.form.Date(closingDateParam );
|
= new com.arsdigita.bebop.form.Date(closingDateParam );
|
||||||
|
closingDate.setLabel(JobGlobalizationUtil
|
||||||
|
.globalize("cms.contenttypes.ui.job.closing_date"));
|
||||||
add(closingDate);
|
add(closingDate);
|
||||||
|
|
||||||
add(new Label(JobGlobalizationUtil
|
|
||||||
.globalize("cms.contenttypes.ui.job.salary")));
|
|
||||||
ParameterModel salaryParam = new StringParameter(SALARY);
|
ParameterModel salaryParam = new StringParameter(SALARY);
|
||||||
CMSDHTMLEditor salary = new CMSDHTMLEditor(salaryParam);
|
CMSDHTMLEditor salary = new CMSDHTMLEditor(salaryParam);
|
||||||
|
salary.setLabel(JobGlobalizationUtil
|
||||||
|
.globalize("cms.contenttypes.ui.job.salary"));
|
||||||
salary.setCols(40);
|
salary.setCols(40);
|
||||||
salary.setRows(10);
|
salary.setRows(10);
|
||||||
add(salary);
|
add(salary);
|
||||||
|
|
||||||
|
|
||||||
add(new Label(JobGlobalizationUtil
|
|
||||||
.globalize("cms.contenttypes.ui.job.ref_number")));
|
|
||||||
ParameterModel refNumberParam = new StringParameter(REF_NUMBER);
|
ParameterModel refNumberParam = new StringParameter(REF_NUMBER);
|
||||||
TextField refNumber = new TextField(refNumberParam);
|
TextField refNumber = new TextField(refNumberParam);
|
||||||
|
refNumber.setLabel(JobGlobalizationUtil
|
||||||
|
.globalize("cms.contenttypes.ui.job.ref_number"));
|
||||||
refNumber.setSize(30);
|
refNumber.setSize(30);
|
||||||
refNumber.setMaxLength(30);
|
refNumber.setMaxLength(30);
|
||||||
add(refNumber);
|
add(refNumber);
|
||||||
|
|
||||||
add(new Label(JobGlobalizationUtil
|
|
||||||
.globalize("cms.contenttypes.ui.job.department")));
|
|
||||||
ParameterModel departmentParam = new StringParameter(DEPARTMENT);
|
ParameterModel departmentParam = new StringParameter(DEPARTMENT);
|
||||||
TextField department = new TextField(departmentParam);
|
TextField department = new TextField(departmentParam);
|
||||||
|
department.setLabel(JobGlobalizationUtil
|
||||||
|
.globalize("cms.contenttypes.ui.job.department"));
|
||||||
department.setSize(30);
|
department.setSize(30);
|
||||||
department.setMaxLength(30);
|
department.setMaxLength(30);
|
||||||
add(department);
|
add(department);
|
||||||
|
|
||||||
add(new Label(JobGlobalizationUtil
|
|
||||||
.globalize("cms.contenttypes.ui.job.job_description")));
|
|
||||||
ParameterModel jobDescriptionParam =
|
ParameterModel jobDescriptionParam =
|
||||||
new StringParameter(JOB_DESCRIPTION);
|
new StringParameter(JOB_DESCRIPTION);
|
||||||
CMSDHTMLEditor jobDescription = new CMSDHTMLEditor(jobDescriptionParam);
|
CMSDHTMLEditor jobDescription = new CMSDHTMLEditor(jobDescriptionParam);
|
||||||
|
jobDescription.setLabel(JobGlobalizationUtil
|
||||||
|
.globalize("cms.contenttypes.ui.job.job_description"));
|
||||||
jobDescription.setCols(40);
|
jobDescription.setCols(40);
|
||||||
jobDescription.setRows(10);
|
jobDescription.setRows(10);
|
||||||
add(jobDescription);
|
add(jobDescription);
|
||||||
|
|
||||||
add(new Label(JobGlobalizationUtil
|
|
||||||
.globalize("cms.contenttypes.ui.job.person_specification")));
|
|
||||||
ParameterModel personSpecificationParam =
|
ParameterModel personSpecificationParam =
|
||||||
new StringParameter(PERSON_SPECIFICATION);
|
new StringParameter(PERSON_SPECIFICATION);
|
||||||
CMSDHTMLEditor personSpecification = new CMSDHTMLEditor(personSpecificationParam);
|
CMSDHTMLEditor personSpecification = new CMSDHTMLEditor(personSpecificationParam);
|
||||||
|
personSpecification.setLabel(JobGlobalizationUtil
|
||||||
|
.globalize("cms.contenttypes.ui.job.person_specification"));
|
||||||
personSpecification.setCols(40);
|
personSpecification.setCols(40);
|
||||||
personSpecification.setRows(10);
|
personSpecification.setRows(10);
|
||||||
add(personSpecification);
|
add(personSpecification);
|
||||||
|
|
@ -174,12 +175,16 @@ public class JobPropertyForm extends BasicPageForm
|
||||||
ParameterModel contactDetailsParam
|
ParameterModel contactDetailsParam
|
||||||
= new StringParameter(CONTACT_DETAILS);
|
= new StringParameter(CONTACT_DETAILS);
|
||||||
CMSDHTMLEditor contactDetails = new CMSDHTMLEditor(contactDetailsParam);
|
CMSDHTMLEditor contactDetails = new CMSDHTMLEditor(contactDetailsParam);
|
||||||
|
contactDetails.setLabel(JobGlobalizationUtil
|
||||||
|
.globalize("cms.contenttypes.ui.job.contact_details"));
|
||||||
contactDetails.setCols(40);
|
contactDetails.setCols(40);
|
||||||
contactDetails.setRows(10);
|
contactDetails.setRows(10);
|
||||||
add(contactDetails);
|
add(contactDetails);
|
||||||
}
|
}
|
||||||
|
|
||||||
/** Form initialisation hook. Fills widgets with data. */
|
/**
|
||||||
|
* @param fse Form initialisation hook. Fills widgets with data. */
|
||||||
|
@Override
|
||||||
public void init(FormSectionEvent fse) {
|
public void init(FormSectionEvent fse) {
|
||||||
FormData data = fse.getFormData();
|
FormData data = fse.getFormData();
|
||||||
Job job = (Job) super.initBasicWidgets(fse);
|
Job job = (Job) super.initBasicWidgets(fse);
|
||||||
|
|
@ -196,7 +201,10 @@ public class JobPropertyForm extends BasicPageForm
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
/** Cancels streamlined editing. */
|
/**
|
||||||
|
* Cancels streamlined editing.
|
||||||
|
* @param fse */
|
||||||
|
@Override
|
||||||
public void submitted( FormSectionEvent fse ) {
|
public void submitted( FormSectionEvent fse ) {
|
||||||
if (m_step != null &&
|
if (m_step != null &&
|
||||||
getSaveCancelSection().getCancelButton()
|
getSaveCancelSection().getCancelButton()
|
||||||
|
|
@ -205,7 +213,10 @@ public class JobPropertyForm extends BasicPageForm
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
/** Form processing hook. Saves Job object. */
|
/**
|
||||||
|
* Form processing hook. Saves Job object.
|
||||||
|
* @param fse */
|
||||||
|
@Override
|
||||||
public void process(FormSectionEvent fse) {
|
public void process(FormSectionEvent fse) {
|
||||||
FormData data = fse.getFormData();
|
FormData data = fse.getFormData();
|
||||||
|
|
||||||
|
|
|
||||||
|
|
@ -20,7 +20,6 @@ package com.arsdigita.cms.contenttypes.ui;
|
||||||
|
|
||||||
|
|
||||||
import com.arsdigita.bebop.FormData;
|
import com.arsdigita.bebop.FormData;
|
||||||
import com.arsdigita.bebop.Label;
|
|
||||||
import com.arsdigita.bebop.event.FormInitListener;
|
import com.arsdigita.bebop.event.FormInitListener;
|
||||||
import com.arsdigita.bebop.event.FormProcessListener;
|
import com.arsdigita.bebop.event.FormProcessListener;
|
||||||
import com.arsdigita.bebop.event.FormSectionEvent;
|
import com.arsdigita.bebop.event.FormSectionEvent;
|
||||||
|
|
@ -32,7 +31,6 @@ import com.arsdigita.cms.contenttypes.LegalNotice;
|
||||||
import com.arsdigita.cms.contenttypes.util.LegalNoticeGlobalizationUtil;
|
import com.arsdigita.cms.contenttypes.util.LegalNoticeGlobalizationUtil;
|
||||||
import com.arsdigita.cms.ItemSelectionModel;
|
import com.arsdigita.cms.ItemSelectionModel;
|
||||||
import com.arsdigita.cms.ui.authoring.BasicPageForm;
|
import com.arsdigita.cms.ui.authoring.BasicPageForm;
|
||||||
import com.arsdigita.cms.util.GlobalizationUtil;
|
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Form to edit the basic properties of a legal notice. These are name, title,
|
* Form to edit the basic properties of a legal notice. These are name, title,
|
||||||
|
|
@ -78,19 +76,24 @@ public class LegalNoticePropertyForm extends BasicPageForm
|
||||||
/**
|
/**
|
||||||
* Adds widgets to the form.
|
* Adds widgets to the form.
|
||||||
*/
|
*/
|
||||||
|
@Override
|
||||||
protected void addWidgets() {
|
protected void addWidgets() {
|
||||||
super.addWidgets();
|
super.addWidgets();
|
||||||
|
|
||||||
add(new Label(LegalNoticeGlobalizationUtil
|
|
||||||
.globalize("cms.contenttypes.ui.legal_notice.government_uid")));
|
|
||||||
ParameterModel governmentUIDParam = new StringParameter(GOVERNMENT_UID);
|
ParameterModel governmentUIDParam = new StringParameter(GOVERNMENT_UID);
|
||||||
TextField governmentUID = new TextField(governmentUIDParam);
|
TextField governmentUID = new TextField(governmentUIDParam);
|
||||||
|
governmentUID.setLabel(LegalNoticeGlobalizationUtil
|
||||||
|
.globalize("cms.contenttypes.ui.legal_notice.government_uid"));
|
||||||
governmentUID.setSize(30);
|
governmentUID.setSize(30);
|
||||||
add(governmentUID);
|
add(governmentUID);
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
/** Form initialisation hook. Fills widgets with data. */
|
/**
|
||||||
|
* Form initialisation hook. Fills widgets with data.
|
||||||
|
* @param fse
|
||||||
|
*/
|
||||||
|
@Override
|
||||||
public void init(FormSectionEvent fse) {
|
public void init(FormSectionEvent fse) {
|
||||||
FormData data = fse.getFormData();
|
FormData data = fse.getFormData();
|
||||||
LegalNotice notice = (LegalNotice) super.initBasicWidgets(fse);
|
LegalNotice notice = (LegalNotice) super.initBasicWidgets(fse);
|
||||||
|
|
@ -98,7 +101,11 @@ public class LegalNoticePropertyForm extends BasicPageForm
|
||||||
data.put(GOVERNMENT_UID, notice.getGovernmentUID());
|
data.put(GOVERNMENT_UID, notice.getGovernmentUID());
|
||||||
}
|
}
|
||||||
|
|
||||||
/** Cancels streamlined editing. */
|
/**
|
||||||
|
* Cancels streamlined editing.
|
||||||
|
* @param fse
|
||||||
|
*/
|
||||||
|
@Override
|
||||||
public void submitted( FormSectionEvent fse ) {
|
public void submitted( FormSectionEvent fse ) {
|
||||||
if (m_step != null &&
|
if (m_step != null &&
|
||||||
getSaveCancelSection().getCancelButton()
|
getSaveCancelSection().getCancelButton()
|
||||||
|
|
@ -107,7 +114,11 @@ public class LegalNoticePropertyForm extends BasicPageForm
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
/** Form processing hook. Saves LegalNotice object. */
|
/**
|
||||||
|
* Form processing hook. Saves LegalNotice object.
|
||||||
|
* @param fse
|
||||||
|
*/
|
||||||
|
@Override
|
||||||
public void process(FormSectionEvent fse) {
|
public void process(FormSectionEvent fse) {
|
||||||
FormData data = fse.getFormData();
|
FormData data = fse.getFormData();
|
||||||
|
|
||||||
|
|
|
||||||
|
|
@ -19,18 +19,12 @@
|
||||||
package com.arsdigita.cms.contenttypes.ui;
|
package com.arsdigita.cms.contenttypes.ui;
|
||||||
|
|
||||||
import com.arsdigita.bebop.FormData;
|
import com.arsdigita.bebop.FormData;
|
||||||
import com.arsdigita.bebop.Label;
|
|
||||||
import com.arsdigita.bebop.event.FormInitListener;
|
import com.arsdigita.bebop.event.FormInitListener;
|
||||||
import com.arsdigita.bebop.event.FormProcessListener;
|
import com.arsdigita.bebop.event.FormProcessListener;
|
||||||
import com.arsdigita.bebop.event.FormSectionEvent;
|
import com.arsdigita.bebop.event.FormSectionEvent;
|
||||||
import com.arsdigita.bebop.event.FormSubmissionListener;
|
import com.arsdigita.bebop.event.FormSubmissionListener;
|
||||||
import com.arsdigita.bebop.form.TextField;
|
|
||||||
import com.arsdigita.bebop.parameters.ParameterModel;
|
|
||||||
import com.arsdigita.bebop.parameters.StringParameter;
|
|
||||||
import com.arsdigita.cms.ItemSelectionModel;
|
import com.arsdigita.cms.ItemSelectionModel;
|
||||||
import com.arsdigita.cms.contenttypes.Member;
|
import com.arsdigita.cms.contenttypes.Member;
|
||||||
import com.arsdigita.cms.contenttypes.util.MemberGlobalizationUtil;
|
|
||||||
import com.arsdigita.cms.ui.authoring.BasicPageForm;
|
|
||||||
import org.apache.log4j.Logger;
|
import org.apache.log4j.Logger;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
|
|
|
||||||
|
|
@ -20,7 +20,6 @@ package com.arsdigita.cms.contenttypes.ui;
|
||||||
|
|
||||||
|
|
||||||
import com.arsdigita.bebop.FormData;
|
import com.arsdigita.bebop.FormData;
|
||||||
import com.arsdigita.bebop.Label;
|
|
||||||
import com.arsdigita.bebop.event.FormInitListener;
|
import com.arsdigita.bebop.event.FormInitListener;
|
||||||
import com.arsdigita.bebop.event.FormProcessListener;
|
import com.arsdigita.bebop.event.FormProcessListener;
|
||||||
import com.arsdigita.bebop.event.FormSectionEvent;
|
import com.arsdigita.bebop.event.FormSectionEvent;
|
||||||
|
|
@ -85,50 +84,51 @@ public class MinutesPropertyForm extends BasicPageForm
|
||||||
/**
|
/**
|
||||||
* Adds widgets to the form.
|
* Adds widgets to the form.
|
||||||
**/
|
**/
|
||||||
|
@Override
|
||||||
protected void addWidgets() {
|
protected void addWidgets() {
|
||||||
super.addWidgets();
|
super.addWidgets();
|
||||||
|
|
||||||
add(new Label(MinutesGlobalizationUtil
|
|
||||||
.globalize("cms.contenttypes.ui.minutes.reference")));
|
|
||||||
ParameterModel minuteNumberParam = new StringParameter(MINUTE_NUMBER);
|
ParameterModel minuteNumberParam = new StringParameter(MINUTE_NUMBER);
|
||||||
TextArea minuteNumber = new TextArea(minuteNumberParam);
|
TextArea minuteNumber = new TextArea(minuteNumberParam);
|
||||||
|
minuteNumber.setLabel(MinutesGlobalizationUtil
|
||||||
|
.globalize("cms.contenttypes.ui.minutes.reference"));
|
||||||
minuteNumber.setCols(40);
|
minuteNumber.setCols(40);
|
||||||
minuteNumber.setRows(3);
|
minuteNumber.setRows(3);
|
||||||
minuteNumber.addValidationListener(new StringLengthValidationListener(100));
|
minuteNumber.addValidationListener(new StringLengthValidationListener(100));
|
||||||
add(minuteNumber);
|
add(minuteNumber);
|
||||||
|
|
||||||
add(new Label(GlobalizationUtil
|
|
||||||
.globalize("cms.contenttypes.ui.description")));
|
|
||||||
ParameterModel descriptionParam = new StringParameter(DESCRIPTION);
|
ParameterModel descriptionParam = new StringParameter(DESCRIPTION);
|
||||||
TextArea description = new TextArea(descriptionParam);
|
TextArea description = new TextArea(descriptionParam);
|
||||||
|
description.setLabel(GlobalizationUtil
|
||||||
|
.globalize("cms.contenttypes.ui.description"));
|
||||||
description.setCols(40);
|
description.setCols(40);
|
||||||
description.setRows(5);
|
description.setRows(5);
|
||||||
description.addValidationListener(new StringLengthValidationListener(4000));
|
description.addValidationListener(new StringLengthValidationListener(4000));
|
||||||
add(description);
|
add(description);
|
||||||
|
|
||||||
add(new Label(MinutesGlobalizationUtil
|
|
||||||
.globalize("cms.contenttypes.ui.minutes.action_item")));
|
|
||||||
ParameterModel actionItemParam = new StringParameter(ACTION_ITEM);
|
ParameterModel actionItemParam = new StringParameter(ACTION_ITEM);
|
||||||
TextArea actionItem = new TextArea(actionItemParam);
|
TextArea actionItem = new TextArea(actionItemParam);
|
||||||
|
actionItem.setLabel(MinutesGlobalizationUtil
|
||||||
|
.globalize("cms.contenttypes.ui.minutes.action_item"));
|
||||||
actionItem.setCols(40);
|
actionItem.setCols(40);
|
||||||
actionItem.setRows(3);
|
actionItem.setRows(3);
|
||||||
actionItem.addValidationListener(new StringLengthValidationListener(4000));
|
actionItem.addValidationListener(new StringLengthValidationListener(4000));
|
||||||
add(actionItem);
|
add(actionItem);
|
||||||
|
|
||||||
add(new Label(MinutesGlobalizationUtil
|
|
||||||
.globalize("cms.contenttypes.ui.minutes.attendees")));
|
|
||||||
ParameterModel attendeesParam = new StringParameter(ATTENDEES);
|
ParameterModel attendeesParam = new StringParameter(ATTENDEES);
|
||||||
TextArea attendees = new TextArea(attendeesParam);
|
TextArea attendees = new TextArea(attendeesParam);
|
||||||
|
attendees.setLabel(MinutesGlobalizationUtil
|
||||||
|
.globalize("cms.contenttypes.ui.minutes.attendees"));
|
||||||
attendees.setCols(40);
|
attendees.setCols(40);
|
||||||
attendees.setRows(3);
|
attendees.setRows(3);
|
||||||
attendees.addValidationListener(new StringLengthValidationListener(1000));
|
attendees.addValidationListener(new StringLengthValidationListener(1000));
|
||||||
add(attendees);
|
add(attendees);
|
||||||
|
|
||||||
add(new Label(MinutesGlobalizationUtil
|
|
||||||
.globalize("cms.contenttypes.ui.minutes.description_of")));
|
|
||||||
ParameterModel descriptionOfMinutesParam =
|
ParameterModel descriptionOfMinutesParam =
|
||||||
new StringParameter(DESCRIPTION_OF_MINUTES);
|
new StringParameter(DESCRIPTION_OF_MINUTES);
|
||||||
TextArea descriptionOfMinutes = new TextArea(descriptionOfMinutesParam);
|
TextArea descriptionOfMinutes = new TextArea(descriptionOfMinutesParam);
|
||||||
|
descriptionOfMinutes.setLabel(MinutesGlobalizationUtil
|
||||||
|
.globalize("cms.contenttypes.ui.minutes.description_of"));
|
||||||
descriptionOfMinutes.setCols(40);
|
descriptionOfMinutes.setCols(40);
|
||||||
descriptionOfMinutes.setRows(5);
|
descriptionOfMinutes.setRows(5);
|
||||||
descriptionOfMinutes.addValidationListener(new StringLengthValidationListener(4000));
|
descriptionOfMinutes.addValidationListener(new StringLengthValidationListener(4000));
|
||||||
|
|
@ -136,7 +136,11 @@ public class MinutesPropertyForm extends BasicPageForm
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
/** Form initialisation hook. Fills widgets with data. */
|
/**
|
||||||
|
* Form initialisation hook. Fills widgets with data.
|
||||||
|
* @param fse
|
||||||
|
*/
|
||||||
|
@Override
|
||||||
public void init(FormSectionEvent fse) {
|
public void init(FormSectionEvent fse) {
|
||||||
FormData data = fse.getFormData();
|
FormData data = fse.getFormData();
|
||||||
Minutes minutes = (Minutes) super.initBasicWidgets(fse);
|
Minutes minutes = (Minutes) super.initBasicWidgets(fse);
|
||||||
|
|
@ -148,7 +152,11 @@ public class MinutesPropertyForm extends BasicPageForm
|
||||||
data.put(MINUTE_NUMBER, minutes.getMinuteNumber());
|
data.put(MINUTE_NUMBER, minutes.getMinuteNumber());
|
||||||
}
|
}
|
||||||
|
|
||||||
/** Cancels streamlined editing. */
|
/**
|
||||||
|
* Cancels streamlined editing.
|
||||||
|
* @param fse
|
||||||
|
*/
|
||||||
|
@Override
|
||||||
public void submitted( FormSectionEvent fse ) {
|
public void submitted( FormSectionEvent fse ) {
|
||||||
if (m_step != null &&
|
if (m_step != null &&
|
||||||
getSaveCancelSection().getCancelButton()
|
getSaveCancelSection().getCancelButton()
|
||||||
|
|
@ -157,7 +165,11 @@ public class MinutesPropertyForm extends BasicPageForm
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
/** Form processing hook. Saves Minutes object. */
|
/**
|
||||||
|
* Form processing hook. Saves Minutes object.
|
||||||
|
* @param fse
|
||||||
|
*/
|
||||||
|
@Override
|
||||||
public void process(FormSectionEvent fse) {
|
public void process(FormSectionEvent fse) {
|
||||||
FormData data = fse.getFormData();
|
FormData data = fse.getFormData();
|
||||||
|
|
||||||
|
|
|
||||||
|
|
@ -142,8 +142,7 @@ public class ArticleSectionPanel extends SimpleComponent implements
|
||||||
if (item instanceof ContentBundle) {
|
if (item instanceof ContentBundle) {
|
||||||
ContentBundle bundle;
|
ContentBundle bundle;
|
||||||
HttpServletRequest request;
|
HttpServletRequest request;
|
||||||
ContentItem resolved = null;
|
ContentItem resolved;
|
||||||
|
|
||||||
bundle = (ContentBundle) item;
|
bundle = (ContentBundle) item;
|
||||||
|
|
||||||
resolved = bundle.getInstance(GlobalizationHelper
|
resolved = bundle.getInstance(GlobalizationHelper
|
||||||
|
|
@ -160,7 +159,7 @@ public class ArticleSectionPanel extends SimpleComponent implements
|
||||||
|
|
||||||
protected ArticleSection[] getSections(ContentItem item,
|
protected ArticleSection[] getSections(ContentItem item,
|
||||||
final PageState state) {
|
final PageState state) {
|
||||||
PageNumber number = null;
|
PageNumber number;
|
||||||
try {
|
try {
|
||||||
number = (PageNumber) state.getValue(m_page);
|
number = (PageNumber) state.getValue(m_page);
|
||||||
} catch (IllegalArgumentException e) {
|
} catch (IllegalArgumentException e) {
|
||||||
|
|
@ -309,11 +308,8 @@ public class ArticleSectionPanel extends SimpleComponent implements
|
||||||
XMLGenerator xmlGenerator = getXMLGenerator(state, item);
|
XMLGenerator xmlGenerator = getXMLGenerator(state, item);
|
||||||
|
|
||||||
ArticleSection sections[] = getSections(item, state);
|
ArticleSection sections[] = getSections(item, state);
|
||||||
for (int i = 0; i < sections.length; i++) {
|
for (ArticleSection section : sections) {
|
||||||
generateSectionXML(state,
|
generateSectionXML(state, content, section, xmlGenerator);
|
||||||
content,
|
|
||||||
sections[i],
|
|
||||||
xmlGenerator);
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
@ -323,6 +319,7 @@ public class ArticleSectionPanel extends SimpleComponent implements
|
||||||
final XMLGenerator xmlGenerator) {
|
final XMLGenerator xmlGenerator) {
|
||||||
CMSExcursion excursion = new CMSExcursion() {
|
CMSExcursion excursion = new CMSExcursion() {
|
||||||
|
|
||||||
|
@Override
|
||||||
public void excurse() {
|
public void excurse() {
|
||||||
setContentItem(section);
|
setContentItem(section);
|
||||||
xmlGenerator.generateXML(state, parent, null);
|
xmlGenerator.generateXML(state, parent, null);
|
||||||
|
|
@ -341,8 +338,8 @@ public class ArticleSectionPanel extends SimpleComponent implements
|
||||||
// the position in the list of sections, or the string 'all'
|
// the position in the list of sections, or the string 'all'
|
||||||
private class PageNumber {
|
private class PageNumber {
|
||||||
|
|
||||||
private boolean m_all;
|
private final boolean m_all;
|
||||||
private Integer m_number;
|
private final Integer m_number;
|
||||||
|
|
||||||
public PageNumber(String number)
|
public PageNumber(String number)
|
||||||
throws NumberFormatException {
|
throws NumberFormatException {
|
||||||
|
|
@ -373,11 +370,13 @@ public class ArticleSectionPanel extends SimpleComponent implements
|
||||||
super(name);
|
super(name);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
public Object transformValue(HttpServletRequest request)
|
public Object transformValue(HttpServletRequest request)
|
||||||
throws IllegalArgumentException {
|
throws IllegalArgumentException {
|
||||||
return transformSingleValue(request);
|
return transformSingleValue(request);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
public Object unmarshal(String encoded)
|
public Object unmarshal(String encoded)
|
||||||
throws IllegalArgumentException {
|
throws IllegalArgumentException {
|
||||||
|
|
||||||
|
|
@ -387,13 +386,14 @@ public class ArticleSectionPanel extends SimpleComponent implements
|
||||||
try {
|
try {
|
||||||
return new PageNumber(encoded);
|
return new PageNumber(encoded);
|
||||||
} catch (NumberFormatException e) {
|
} catch (NumberFormatException e) {
|
||||||
e.printStackTrace();
|
//e.printStackTrace();
|
||||||
throw new IllegalArgumentException(getName()
|
throw new IllegalArgumentException(getName()
|
||||||
+ " should be a BigDecimal: '"
|
+ " should be a BigDecimal: '"
|
||||||
+ encoded + "'");
|
+ encoded + "'");
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
public Class getValueClass() {
|
public Class getValueClass() {
|
||||||
return PageNumber.class;
|
return PageNumber.class;
|
||||||
}
|
}
|
||||||
|
|
|
||||||
|
|
@ -84,14 +84,19 @@ public class ImageUploadSection extends FormSection
|
||||||
MPArticleGlobalizationUtil
|
MPArticleGlobalizationUtil
|
||||||
.globalize("cms.contenttypes.ui.mparticle.section.select_image")));
|
.globalize("cms.contenttypes.ui.mparticle.section.select_image")));
|
||||||
add(new FileUpload(m_name + IMAGE));
|
add(new FileUpload(m_name + IMAGE));
|
||||||
add(new Label(
|
|
||||||
MPArticleGlobalizationUtil
|
|
||||||
.globalize("cms.contenttypes.ui.mparticle.section.caption")));
|
|
||||||
TextField caption = new TextField(m_name + CAPTION);
|
TextField caption = new TextField(m_name + CAPTION);
|
||||||
|
caption.setLabel(MPArticleGlobalizationUtil
|
||||||
|
.globalize("cms.contenttypes.ui.mparticle.section.caption"));
|
||||||
caption.setSize(40);
|
caption.setSize(40);
|
||||||
add(caption);
|
add(caption);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
*
|
||||||
|
* @param name
|
||||||
|
* @param selImage
|
||||||
|
*/
|
||||||
public ImageUploadSection(String name,
|
public ImageUploadSection(String name,
|
||||||
ItemSelectionModel selImage) {
|
ItemSelectionModel selImage) {
|
||||||
this(name, selImage, new ColumnPanel(2, true));
|
this(name, selImage, new ColumnPanel(2, true));
|
||||||
|
|
@ -109,6 +114,8 @@ public class ImageUploadSection extends FormSection
|
||||||
/**
|
/**
|
||||||
* Initialise the caption text field. Should be called from the
|
* Initialise the caption text field. Should be called from the
|
||||||
* form init listener.
|
* form init listener.
|
||||||
|
*
|
||||||
|
* @param event
|
||||||
*/
|
*/
|
||||||
public void initImageUpload(FormSectionEvent event) {
|
public void initImageUpload(FormSectionEvent event) {
|
||||||
FormData data = event.getFormData();
|
FormData data = event.getFormData();
|
||||||
|
|
@ -135,6 +142,9 @@ public class ImageUploadSection extends FormSection
|
||||||
/**
|
/**
|
||||||
* Return the filname from the upload widget. Should be called
|
* Return the filname from the upload widget. Should be called
|
||||||
* from the form process listener.
|
* from the form process listener.
|
||||||
|
*
|
||||||
|
* @param event
|
||||||
|
* @return
|
||||||
*/
|
*/
|
||||||
public String getImageFilename(FormSectionEvent event) {
|
public String getImageFilename(FormSectionEvent event) {
|
||||||
FormData data = event.getFormData();
|
FormData data = event.getFormData();
|
||||||
|
|
@ -144,6 +154,9 @@ public class ImageUploadSection extends FormSection
|
||||||
/**
|
/**
|
||||||
* Return a File object from the file upload widget. Should be
|
* Return a File object from the file upload widget. Should be
|
||||||
* called from the form process listener.
|
* called from the form process listener.
|
||||||
|
*
|
||||||
|
* @param event
|
||||||
|
* @return
|
||||||
*/
|
*/
|
||||||
public File getImage(FormSectionEvent event) {
|
public File getImage(FormSectionEvent event) {
|
||||||
FormData data = event.getFormData();
|
FormData data = event.getFormData();
|
||||||
|
|
@ -163,6 +176,9 @@ public class ImageUploadSection extends FormSection
|
||||||
/**
|
/**
|
||||||
* Process the image upload. Should be called form the form
|
* Process the image upload. Should be called form the form
|
||||||
* process listener.
|
* process listener.
|
||||||
|
*
|
||||||
|
* @param event
|
||||||
|
* @return
|
||||||
*/
|
*/
|
||||||
public ReusableImageAsset processImageUpload(FormSectionEvent event) {
|
public ReusableImageAsset processImageUpload(FormSectionEvent event) {
|
||||||
ReusableImageAsset a = null;
|
ReusableImageAsset a = null;
|
||||||
|
|
|
||||||
|
|
@ -34,11 +34,21 @@ import com.arsdigita.util.Assert;
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Worker class to create the multipart article's edit form.
|
||||||
|
*
|
||||||
|
*/
|
||||||
public class MultiPartArticleEditForm extends MultiPartArticleForm
|
public class MultiPartArticleEditForm extends MultiPartArticleForm
|
||||||
implements FormSubmissionListener {
|
implements FormSubmissionListener {
|
||||||
|
|
||||||
private final SimpleEditStep m_step;
|
private final SimpleEditStep m_step;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Constructor.
|
||||||
|
*
|
||||||
|
* @param itemModel
|
||||||
|
* @param step
|
||||||
|
*/
|
||||||
public MultiPartArticleEditForm(ItemSelectionModel itemModel,
|
public MultiPartArticleEditForm(ItemSelectionModel itemModel,
|
||||||
SimpleEditStep step) {
|
SimpleEditStep step) {
|
||||||
super("MultiPartArticleEditForm", itemModel);
|
super("MultiPartArticleEditForm", itemModel);
|
||||||
|
|
|
||||||
|
|
@ -19,10 +19,11 @@
|
||||||
package com.arsdigita.cms.contenttypes.ui.mparticle;
|
package com.arsdigita.cms.contenttypes.ui.mparticle;
|
||||||
|
|
||||||
import com.arsdigita.bebop.ColumnPanel;
|
import com.arsdigita.bebop.ColumnPanel;
|
||||||
|
import com.arsdigita.bebop.Embedded;
|
||||||
import com.arsdigita.bebop.FormData;
|
import com.arsdigita.bebop.FormData;
|
||||||
import com.arsdigita.bebop.FormProcessException;
|
import com.arsdigita.bebop.FormProcessException;
|
||||||
import com.arsdigita.bebop.FormSection;
|
import com.arsdigita.bebop.FormSection;
|
||||||
import com.arsdigita.bebop.Label;
|
//import com.arsdigita.bebop.Label;
|
||||||
import com.arsdigita.bebop.PageState;
|
import com.arsdigita.bebop.PageState;
|
||||||
import com.arsdigita.bebop.SaveCancelSection;
|
import com.arsdigita.bebop.SaveCancelSection;
|
||||||
import com.arsdigita.bebop.event.FormInitListener;
|
import com.arsdigita.bebop.event.FormInitListener;
|
||||||
|
|
@ -77,6 +78,13 @@ public abstract class MultiPartArticleForm extends FormSection
|
||||||
|
|
||||||
private static final Logger s_log = Logger.getLogger(MultiPartArticleForm.class);
|
private static final Logger s_log = Logger.getLogger(MultiPartArticleForm.class);
|
||||||
|
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Constructor.
|
||||||
|
*
|
||||||
|
* @param formName
|
||||||
|
* @param itemModel
|
||||||
|
*/
|
||||||
public MultiPartArticleForm(String formName, ItemSelectionModel itemModel) {
|
public MultiPartArticleForm(String formName, ItemSelectionModel itemModel) {
|
||||||
super(new ColumnPanel(2));
|
super(new ColumnPanel(2));
|
||||||
|
|
||||||
|
|
@ -98,24 +106,38 @@ public abstract class MultiPartArticleForm extends FormSection
|
||||||
addValidationListener(this);
|
addValidationListener(this);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
*
|
||||||
|
*/
|
||||||
public void addSaveCancelSection() {
|
public void addSaveCancelSection() {
|
||||||
m_saveCancelSection = new SaveCancelSection();
|
m_saveCancelSection = new SaveCancelSection();
|
||||||
add(m_saveCancelSection, ColumnPanel.FULL_WIDTH | ColumnPanel.LEFT);
|
add(m_saveCancelSection, ColumnPanel.FULL_WIDTH | ColumnPanel.LEFT);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
*
|
||||||
|
* @return
|
||||||
|
*/
|
||||||
public SaveCancelSection getSaveCancelSection() {
|
public SaveCancelSection getSaveCancelSection() {
|
||||||
return m_saveCancelSection;
|
return m_saveCancelSection;
|
||||||
}
|
}
|
||||||
|
|
||||||
private Label m_script = new Label(String.format(
|
/** Constant property, placeholder for a javascript element. */
|
||||||
|
private final Embedded m_script = new Embedded(String.format(
|
||||||
"<script language=\"javascript\" src=\"%s/javascript/manipulate-input.js\"></script>",
|
"<script language=\"javascript\" src=\"%s/javascript/manipulate-input.js\"></script>",
|
||||||
Web.getWebappContextPath()),
|
Web.getWebappContextPath()),
|
||||||
false);
|
false);
|
||||||
|
|
||||||
|
/**
|
||||||
|
*
|
||||||
|
*/
|
||||||
protected void addWidgets() {
|
protected void addWidgets() {
|
||||||
add(new Label(GlobalizationUtil
|
|
||||||
.globalize("cms.contenttypes.ui.title")));
|
// add(new Label(GlobalizationUtil
|
||||||
|
// .globalize("cms.contenttypes.ui.title")));
|
||||||
TextField titleWidget = new TextField(new TrimmedStringParameter(TITLE));
|
TextField titleWidget = new TextField(new TrimmedStringParameter(TITLE));
|
||||||
|
titleWidget.setLabel(GlobalizationUtil
|
||||||
|
.globalize("cms.contenttypes.ui.title"));
|
||||||
titleWidget.addValidationListener(new NotNullValidationListener());
|
titleWidget.addValidationListener(new NotNullValidationListener());
|
||||||
titleWidget.setOnFocus("if (this.form." + NAME + ".value == '') { "
|
titleWidget.setOnFocus("if (this.form." + NAME + ".value == '') { "
|
||||||
+ " defaulting = true; this.form." + NAME
|
+ " defaulting = true; this.form." + NAME
|
||||||
|
|
@ -125,9 +147,11 @@ public abstract class MultiPartArticleForm extends FormSection
|
||||||
);
|
);
|
||||||
add(titleWidget);
|
add(titleWidget);
|
||||||
|
|
||||||
add(new Label(GlobalizationUtil
|
//add(new Label(GlobalizationUtil
|
||||||
.globalize("cms.contenttypes.ui.name")));
|
// .globalize("cms.contenttypes.ui.name")));
|
||||||
TextField nameWidget = new TextField(new TrimmedStringParameter(NAME));
|
TextField nameWidget = new TextField(new TrimmedStringParameter(NAME));
|
||||||
|
nameWidget.setLabel(GlobalizationUtil
|
||||||
|
.globalize("cms.contenttypes.ui.name"));
|
||||||
nameWidget.addValidationListener(new NotNullValidationListener());
|
nameWidget.addValidationListener(new NotNullValidationListener());
|
||||||
nameWidget.addValidationListener(new URLTokenValidationListener());
|
nameWidget.addValidationListener(new URLTokenValidationListener());
|
||||||
nameWidget.setOnFocus("defaulting = false");
|
nameWidget.setOnFocus("defaulting = false");
|
||||||
|
|
@ -138,8 +162,8 @@ public abstract class MultiPartArticleForm extends FormSection
|
||||||
add(nameWidget);
|
add(nameWidget);
|
||||||
|
|
||||||
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);
|
||||||
|
|
@ -150,32 +174,42 @@ public abstract class MultiPartArticleForm extends FormSection
|
||||||
// if launch date is required, help user by suggesting today's date
|
// if launch date is required, help user by suggesting today's date
|
||||||
launchDateParam.setDefaultValue(new Date());
|
launchDateParam.setDefaultValue(new Date());
|
||||||
}
|
}
|
||||||
|
launchDate.setLabel(GlobalizationUtil
|
||||||
|
.globalize("cms.ui.authoring.page_launch_date"));
|
||||||
add(launchDate);
|
add(launchDate);
|
||||||
}
|
}
|
||||||
|
|
||||||
add(new Label(GlobalizationUtil
|
//add(new Label(GlobalizationUtil
|
||||||
.globalize("cms.contenttypes.ui.summary")));
|
// .globalize("cms.contenttypes.ui.summary")));
|
||||||
TextArea summaryWidget = new TextArea(new TrimmedStringParameter(SUMMARY));
|
TextArea summaryWidget = new TextArea(new TrimmedStringParameter(SUMMARY));
|
||||||
if (ContentSection.getConfig().mandatoryDescriptions()) {
|
if (ContentSection.getConfig().mandatoryDescriptions()) {
|
||||||
summaryWidget
|
summaryWidget
|
||||||
.addValidationListener(new NotEmptyValidationListener(GlobalizationUtil
|
.addValidationListener(new NotEmptyValidationListener(GlobalizationUtil
|
||||||
.globalize("cms.contenttypes.ui.description_missing")));
|
.globalize("cms.contenttypes.ui.description_missing")));
|
||||||
}
|
}
|
||||||
|
summaryWidget.setLabel(GlobalizationUtil
|
||||||
|
.globalize("cms.contenttypes.ui.summary"));
|
||||||
summaryWidget.setRows(5);
|
summaryWidget.setRows(5);
|
||||||
summaryWidget.setCols(30);
|
summaryWidget.setCols(30);
|
||||||
summaryWidget.setHint(GlobalizationUtil.globalize(
|
summaryWidget.setHint(GlobalizationUtil.globalize(
|
||||||
"cms.contenttypes.ui.summary_hint"));
|
"cms.contenttypes.ui.summary_hint"));
|
||||||
add(summaryWidget);
|
add(summaryWidget);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
public abstract void init(FormSectionEvent e) throws FormProcessException;
|
public abstract void init(FormSectionEvent e) throws FormProcessException;
|
||||||
|
|
||||||
|
@Override
|
||||||
public abstract void process(FormSectionEvent e) throws FormProcessException;
|
public abstract void process(FormSectionEvent e) throws FormProcessException;
|
||||||
|
|
||||||
|
@Override
|
||||||
public abstract void validate(FormSectionEvent e) throws FormProcessException;
|
public abstract void validate(FormSectionEvent e) throws FormProcessException;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Utility method to initialize the name/title/summary widgets
|
* Utility method to initialize the name/title/summary widgets.
|
||||||
|
*
|
||||||
|
* @param e
|
||||||
|
* @return
|
||||||
*/
|
*/
|
||||||
public MultiPartArticle initBasicWidgets(FormSectionEvent e) {
|
public MultiPartArticle initBasicWidgets(FormSectionEvent e) {
|
||||||
Assert.exists(m_itemModel, ItemSelectionModel.class);
|
Assert.exists(m_itemModel, ItemSelectionModel.class);
|
||||||
|
|
@ -197,7 +231,10 @@ public abstract class MultiPartArticleForm extends FormSection
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Utility method to process the name/title/summary widgets
|
* Utility method to process the name/title/summary widgets.
|
||||||
|
*
|
||||||
|
* @param e
|
||||||
|
* @return
|
||||||
*/
|
*/
|
||||||
public MultiPartArticle processBasicWidgets(FormSectionEvent e) {
|
public MultiPartArticle processBasicWidgets(FormSectionEvent e) {
|
||||||
Assert.exists(m_itemModel, ItemSelectionModel.class);
|
Assert.exists(m_itemModel, ItemSelectionModel.class);
|
||||||
|
|
@ -251,6 +288,7 @@ public abstract class MultiPartArticleForm extends FormSection
|
||||||
* @param state the current page state
|
* @param state the current page state
|
||||||
*
|
*
|
||||||
* @return the new content item (or a proper subclass)
|
* @return the new content item (or a proper subclass)
|
||||||
|
* @throws com.arsdigita.bebop.FormProcessException
|
||||||
*/
|
*/
|
||||||
public MultiPartArticle createArticle(PageState state)
|
public MultiPartArticle createArticle(PageState state)
|
||||||
throws FormProcessException {
|
throws FormProcessException {
|
||||||
|
|
@ -273,6 +311,7 @@ public abstract class MultiPartArticleForm extends FormSection
|
||||||
return article;
|
return article;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
public void generateXML(PageState ps, Element parent) {
|
public void generateXML(PageState ps, Element parent) {
|
||||||
m_script.generateXML(ps, parent);
|
m_script.generateXML(ps, parent);
|
||||||
super.generateXML(ps, parent);
|
super.generateXML(ps, parent);
|
||||||
|
|
|
||||||
|
|
@ -54,6 +54,11 @@ public class SectionDeleteForm extends Form
|
||||||
private Label m_sectionNameLabel;
|
private Label m_sectionNameLabel;
|
||||||
|
|
||||||
|
|
||||||
|
/**
|
||||||
|
*
|
||||||
|
* @param selArticle
|
||||||
|
* @param selSection
|
||||||
|
*/
|
||||||
public SectionDeleteForm
|
public SectionDeleteForm
|
||||||
( ItemSelectionModel selArticle,
|
( ItemSelectionModel selArticle,
|
||||||
ItemSelectionModel selSection) {
|
ItemSelectionModel selSection) {
|
||||||
|
|
@ -77,7 +82,11 @@ public class SectionDeleteForm extends Form
|
||||||
addProcessListener(this);
|
addProcessListener(this);
|
||||||
}
|
}
|
||||||
|
|
||||||
protected SaveCancelSection addSaveCancelSection () {
|
/**
|
||||||
|
*
|
||||||
|
* @return
|
||||||
|
*/
|
||||||
|
protected SaveCancelSection addSaveCancelSection () {
|
||||||
m_saveCancelSection = new SaveCancelSection();
|
m_saveCancelSection = new SaveCancelSection();
|
||||||
m_saveCancelSection.getSaveButton().setButtonLabel(
|
m_saveCancelSection.getSaveButton().setButtonLabel(
|
||||||
GlobalizationUtil.globalize("cms.ui.delete"));
|
GlobalizationUtil.globalize("cms.ui.delete"));
|
||||||
|
|
|
||||||
|
|
@ -158,31 +158,38 @@ public class SectionEditForm extends Form {
|
||||||
* Add form widgets for a Section.
|
* Add form widgets for a Section.
|
||||||
*/
|
*/
|
||||||
protected void addWidgets() {
|
protected void addWidgets() {
|
||||||
add(new Label(MPArticleGlobalizationUtil
|
|
||||||
.globalize("cms.contenttypes.ui.mparticle.section.title")));
|
//add(new Label(MPArticleGlobalizationUtil
|
||||||
|
// .globalize("cms.contenttypes.ui.mparticle.section.title")));
|
||||||
TextField titleWidget = new TextField(
|
TextField titleWidget = new TextField(
|
||||||
new TrimmedStringParameter(TITLE));
|
new TrimmedStringParameter(TITLE));
|
||||||
titleWidget.addValidationListener(new NotNullValidationListener());
|
titleWidget.addValidationListener(new NotNullValidationListener());
|
||||||
|
titleWidget.setLabel(MPArticleGlobalizationUtil
|
||||||
|
.globalize("cms.contenttypes.ui.mparticle.section.title"));
|
||||||
add(titleWidget);
|
add(titleWidget);
|
||||||
|
|
||||||
add(new Label(MPArticleGlobalizationUtil
|
//add(new Label(MPArticleGlobalizationUtil
|
||||||
.globalize("cms.contenttypes.ui.mparticle.section.text")),
|
// .globalize("cms.contenttypes.ui.mparticle.section.text")),
|
||||||
ColumnPanel.LEFT | ColumnPanel.FULL_WIDTH);
|
// ColumnPanel.LEFT | ColumnPanel.FULL_WIDTH);
|
||||||
CMSDHTMLEditor textWidget =
|
CMSDHTMLEditor textWidget =
|
||||||
new CMSDHTMLEditor(new TrimmedStringParameter(TEXT));
|
new CMSDHTMLEditor(new TrimmedStringParameter(TEXT));
|
||||||
|
textWidget.setLabel(MPArticleGlobalizationUtil
|
||||||
|
.globalize("cms.contenttypes.ui.mparticle.section.text"));
|
||||||
textWidget.setRows(40);
|
textWidget.setRows(40);
|
||||||
textWidget.setCols(70);
|
textWidget.setCols(70);
|
||||||
textWidget.setWrap(CMSDHTMLEditor.SOFT);
|
textWidget.setWrap(CMSDHTMLEditor.SOFT);
|
||||||
add(textWidget,
|
add(textWidget,
|
||||||
ColumnPanel.LEFT | ColumnPanel.FULL_WIDTH);
|
ColumnPanel.LEFT | ColumnPanel.FULL_WIDTH);
|
||||||
|
|
||||||
add(new Label(MPArticleGlobalizationUtil
|
//add(new Label(MPArticleGlobalizationUtil
|
||||||
.globalize("cms.contenttypes.ui.mparticle.section.image")),
|
// .globalize("cms.contenttypes.ui.mparticle.section.image")),
|
||||||
ColumnPanel.FULL_WIDTH | ColumnPanel.LEFT);
|
// ColumnPanel.FULL_WIDTH | ColumnPanel.LEFT);
|
||||||
m_imageUpload = new ImageUploadSection("image", m_selImage);
|
m_imageUpload = new ImageUploadSection("image", m_selImage);
|
||||||
|
m_imageUpload.setLabel(MPArticleGlobalizationUtil
|
||||||
|
.globalize("cms.contenttypes.ui.mparticle.section.image"));
|
||||||
add(m_imageUpload, ColumnPanel.FULL_WIDTH | ColumnPanel.LEFT);
|
add(m_imageUpload, ColumnPanel.FULL_WIDTH | ColumnPanel.LEFT);
|
||||||
|
|
||||||
add(new Label(""));
|
//add(new Label());
|
||||||
CheckboxGroup pageBreak = new CheckboxGroup(PAGE_BREAK);
|
CheckboxGroup pageBreak = new CheckboxGroup(PAGE_BREAK);
|
||||||
pageBreak.addOption(new Option("true",
|
pageBreak.addOption(new Option("true",
|
||||||
new Label(MPArticleGlobalizationUtil
|
new Label(MPArticleGlobalizationUtil
|
||||||
|
|
|
||||||
|
|
@ -105,6 +105,8 @@ public class SectionTable extends Table {
|
||||||
setModelBuilder(new SectionTableModelBuilder(m_selArticle, m_moveSection));
|
setModelBuilder(new SectionTableModelBuilder(m_selArticle, m_moveSection));
|
||||||
|
|
||||||
addTableActionListener(new TableActionListener() {
|
addTableActionListener(new TableActionListener() {
|
||||||
|
|
||||||
|
@Override
|
||||||
public void cellSelected(TableActionEvent event) {
|
public void cellSelected(TableActionEvent event) {
|
||||||
PageState state = event.getPageState();
|
PageState state = event.getPageState();
|
||||||
|
|
||||||
|
|
@ -143,6 +145,7 @@ public class SectionTable extends Table {
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
public void headSelected(TableActionEvent event) {
|
public void headSelected(TableActionEvent event) {
|
||||||
// do nothing
|
// do nothing
|
||||||
}
|
}
|
||||||
|
|
@ -183,6 +186,7 @@ public class SectionTable extends Table {
|
||||||
* @param state
|
* @param state
|
||||||
* @return
|
* @return
|
||||||
*/
|
*/
|
||||||
|
@Override
|
||||||
public TableModel makeModel(Table table, PageState state) {
|
public TableModel makeModel(Table table, PageState state) {
|
||||||
table.getRowSelectionModel().clearSelection(state);
|
table.getRowSelectionModel().clearSelection(state);
|
||||||
|
|
||||||
|
|
@ -223,6 +227,7 @@ public class SectionTable extends Table {
|
||||||
}
|
}
|
||||||
|
|
||||||
/** Return the number of columsn this TableModel has. */
|
/** Return the number of columsn this TableModel has. */
|
||||||
|
@Override
|
||||||
public int getColumnCount() {
|
public int getColumnCount() {
|
||||||
return m_colModel.size();
|
return m_colModel.size();
|
||||||
}
|
}
|
||||||
|
|
@ -230,6 +235,7 @@ public class SectionTable extends Table {
|
||||||
/** Move to the next row and return true if the model is now positioned
|
/** Move to the next row and return true if the model is now positioned
|
||||||
* on a valid row.
|
* on a valid row.
|
||||||
*/
|
*/
|
||||||
|
@Override
|
||||||
public boolean nextRow() {
|
public boolean nextRow() {
|
||||||
if (m_sections.next()) {
|
if (m_sections.next()) {
|
||||||
m_section = (ArticleSection) m_sections.getArticleSection();
|
m_section = (ArticleSection) m_sections.getArticleSection();
|
||||||
|
|
@ -281,6 +287,7 @@ public class SectionTable extends Table {
|
||||||
/**
|
/**
|
||||||
* Return the key for the given column and the current row.
|
* Return the key for the given column and the current row.
|
||||||
*/
|
*/
|
||||||
|
@Override
|
||||||
public Object getKeyAt(int columnIndex) {
|
public Object getKeyAt(int columnIndex) {
|
||||||
return m_section.getID();
|
return m_section.getID();
|
||||||
}
|
}
|
||||||
|
|
@ -303,11 +310,12 @@ public class SectionTable extends Table {
|
||||||
m_active = active;
|
m_active = active;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
public Component getComponent(Table table, PageState state,
|
public Component getComponent(Table table, PageState state,
|
||||||
Object value, boolean isSelected,
|
Object value, boolean isSelected,
|
||||||
Object key, int row, int column) {
|
Object key, int row, int column) {
|
||||||
|
|
||||||
Component ret = null;
|
Component ret;
|
||||||
SecurityManager sm = CMS.getSecurityManager(state);
|
SecurityManager sm = CMS.getSecurityManager(state);
|
||||||
ContentItem item = (ContentItem) m_selArticle.getSelectedObject(state);
|
ContentItem item = (ContentItem) m_selArticle.getSelectedObject(state);
|
||||||
|
|
||||||
|
|
|
||||||
|
|
@ -91,15 +91,18 @@ public class NewsItemPropertyForm extends BasicPageForm
|
||||||
*/
|
*/
|
||||||
@Override
|
@Override
|
||||||
protected void addWidgets() {
|
protected void addWidgets() {
|
||||||
|
|
||||||
super.addWidgets();
|
super.addWidgets();
|
||||||
|
|
||||||
// summary (lead)
|
// summary (lead)
|
||||||
add(new Label(NewsItemGlobalizationUtil
|
// add(new Label(NewsItemGlobalizationUtil
|
||||||
.globalize("cms.contenttypes.ui.newsitem.lead")));
|
// .globalize("cms.contenttypes.ui.newsitem.lead")));
|
||||||
ParameterModel leadParam = new StringParameter(LEAD);
|
ParameterModel leadParam = new StringParameter(LEAD);
|
||||||
//leadParam
|
//leadParam
|
||||||
// .addParameterListener(new NotNullValidationListener());
|
// .addParameterListener(new NotNullValidationListener());
|
||||||
TextArea lead = new TextArea(leadParam);
|
TextArea lead = new TextArea(leadParam);
|
||||||
|
lead.setLabel(NewsItemGlobalizationUtil
|
||||||
|
.globalize("cms.contenttypes.ui.newsitem.lead"));
|
||||||
lead.setCols(50);
|
lead.setCols(50);
|
||||||
lead.setRows(5);
|
lead.setRows(5);
|
||||||
add(lead);
|
add(lead);
|
||||||
|
|
@ -114,24 +117,32 @@ public class NewsItemPropertyForm extends BasicPageForm
|
||||||
new Label(NewsItemGlobalizationUtil.globalize(
|
new Label(NewsItemGlobalizationUtil.globalize(
|
||||||
"cms.contenttypes.ui.newsitem.no"))));
|
"cms.contenttypes.ui.newsitem.no"))));
|
||||||
|
|
||||||
add(new Label(NewsItemGlobalizationUtil.globalize(
|
// add(new Label(NewsItemGlobalizationUtil.globalize(
|
||||||
"cms.contenttypes.ui.newsitem.homepage")));
|
// "cms.contenttypes.ui.newsitem.homepage")));
|
||||||
|
homepageWidget.setLabel(NewsItemGlobalizationUtil.globalize(
|
||||||
|
"cms.contenttypes.ui.newsitem.homepage"));
|
||||||
add(homepageWidget);
|
add(homepageWidget);
|
||||||
}
|
}
|
||||||
|
|
||||||
// publication date
|
// publication date
|
||||||
add(new Label(NewsItemGlobalizationUtil.globalize(
|
// add(new Label(NewsItemGlobalizationUtil.globalize(
|
||||||
"cms.contenttypes.ui.newsitem.date")));
|
// "cms.contenttypes.ui.newsitem.date")));
|
||||||
ParameterModel newsDateParam = new DateParameter(NEWS_DATE);
|
ParameterModel newsDateParam = new DateParameter(NEWS_DATE);
|
||||||
newsDateParam.addParameterListener(new NotNullValidationListener());
|
newsDateParam.addParameterListener(new NotNullValidationListener());
|
||||||
m_newsDate = new com.arsdigita.bebop.form.Date(newsDateParam);
|
m_newsDate = new com.arsdigita.bebop.form.Date(newsDateParam);
|
||||||
m_newsDate.setYearRange(NewsItem.getConfig().getStartYear(),
|
m_newsDate.setYearRange(NewsItem.getConfig().getStartYear(),
|
||||||
GregorianCalendar.getInstance().get(Calendar.YEAR)
|
GregorianCalendar.getInstance().get(Calendar.YEAR)
|
||||||
+ NewsItem.getConfig().getEndYearDelta());
|
+ NewsItem.getConfig().getEndYearDelta());
|
||||||
|
m_newsDate.setLabel(NewsItemGlobalizationUtil.globalize(
|
||||||
|
"cms.contenttypes.ui.newsitem.date"));
|
||||||
add(m_newsDate);
|
add(m_newsDate);
|
||||||
}
|
}
|
||||||
|
|
||||||
/** Form initialisation hook. Fills widgets with data. */
|
/**
|
||||||
|
* Form initialisation hook. Fills widgets with data.
|
||||||
|
* @param fse
|
||||||
|
*/
|
||||||
|
@Override
|
||||||
public void init(FormSectionEvent fse) {
|
public void init(FormSectionEvent fse) {
|
||||||
FormData data = fse.getFormData();
|
FormData data = fse.getFormData();
|
||||||
NewsItem item = (NewsItem) super.initBasicWidgets(fse);
|
NewsItem item = (NewsItem) super.initBasicWidgets(fse);
|
||||||
|
|
@ -151,7 +162,11 @@ public class NewsItemPropertyForm extends BasicPageForm
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
/** Cancels streamlined editing. */
|
/**
|
||||||
|
* Cancels streamlined editing.
|
||||||
|
* @param fse
|
||||||
|
*/
|
||||||
|
@Override
|
||||||
public void submitted(FormSectionEvent fse) {
|
public void submitted(FormSectionEvent fse) {
|
||||||
if (m_step != null
|
if (m_step != null
|
||||||
&& getSaveCancelSection().getCancelButton()
|
&& getSaveCancelSection().getCancelButton()
|
||||||
|
|
@ -160,7 +175,11 @@ public class NewsItemPropertyForm extends BasicPageForm
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
/** Form processing hook. Saves NewsItem object. */
|
/**
|
||||||
|
* Form processing hook. Saves NewsItem object.
|
||||||
|
* @param fse
|
||||||
|
*/
|
||||||
|
@Override
|
||||||
public void process(FormSectionEvent fse) {
|
public void process(FormSectionEvent fse) {
|
||||||
FormData data = fse.getFormData();
|
FormData data = fse.getFormData();
|
||||||
|
|
||||||
|
|
@ -175,7 +194,8 @@ public class NewsItemPropertyForm extends BasicPageForm
|
||||||
item.setLead((String) data.get(LEAD));
|
item.setLead((String) data.get(LEAD));
|
||||||
if (!NewsItem.getConfig().getHideHomepageField()) {
|
if (!NewsItem.getConfig().getHideHomepageField()) {
|
||||||
String isHomepage = (String) data.get(IS_HOMEPAGE);
|
String isHomepage = (String) data.get(IS_HOMEPAGE);
|
||||||
item.setIsHomepage(new Boolean(isHomepage));
|
// item.setIsHomepage(new Boolean(isHomepage));
|
||||||
|
item.setIsHomepage(Boolean.valueOf(isHomepage));
|
||||||
}
|
}
|
||||||
item.save();
|
item.save();
|
||||||
}
|
}
|
||||||
|
|
|
||||||
|
|
@ -118,6 +118,7 @@ public class OrganizationImageForm extends Form implements FormInitListener,
|
||||||
|
|
||||||
|
|
||||||
m_imageDisplay = new ImageDisplay(itemModel) {
|
m_imageDisplay = new ImageDisplay(itemModel) {
|
||||||
|
@Override
|
||||||
protected ImageAsset getImageAsset(PageState state) {
|
protected ImageAsset getImageAsset(PageState state) {
|
||||||
ImageAsset image = (ImageAsset) ((Organization)
|
ImageAsset image = (ImageAsset) ((Organization)
|
||||||
getImageSelectionModel()
|
getImageSelectionModel()
|
||||||
|
|
@ -150,13 +151,15 @@ public class OrganizationImageForm extends Form implements FormInitListener,
|
||||||
add(m_currentLabel);
|
add(m_currentLabel);
|
||||||
add(m_imageDisplay);
|
add(m_imageDisplay);
|
||||||
|
|
||||||
m_label = new Label(OrganizationGlobalizationUtil.globalize
|
// m_label = new Label(OrganizationGlobalizationUtil.globalize
|
||||||
("cms.contenttypes.ui.organization.image"));
|
// ("cms.contenttypes.ui.organization.image"));
|
||||||
add(m_label);
|
// add(m_label);
|
||||||
m_upload = new FileUpload(IMAGE);
|
m_upload = new FileUpload(IMAGE);
|
||||||
|
m_upload.setLabel(OrganizationGlobalizationUtil.globalize
|
||||||
|
("cms.contenttypes.ui.organization.image"));
|
||||||
add(m_upload);
|
add(m_upload);
|
||||||
|
|
||||||
m_radioLabel = new Label("");
|
m_radioLabel = new Label();
|
||||||
add(m_radioLabel);
|
add(m_radioLabel);
|
||||||
add(m_group);
|
add(m_group);
|
||||||
m_saveCancelSection = new SaveCancelSection();
|
m_saveCancelSection = new SaveCancelSection();
|
||||||
|
|
@ -172,14 +175,24 @@ public class OrganizationImageForm extends Form implements FormInitListener,
|
||||||
return m_itemModel;
|
return m_itemModel;
|
||||||
}
|
}
|
||||||
|
|
||||||
/** Form initialisation hook. Fills widgets with data. */
|
/**
|
||||||
|
* Form initialisation hook. Fills widgets with data.
|
||||||
|
* @param fse
|
||||||
|
*/
|
||||||
|
@Override
|
||||||
public void init( FormSectionEvent fse ) {
|
public void init( FormSectionEvent fse ) {
|
||||||
PageState state = fse.getPageState();
|
PageState state = fse.getPageState();
|
||||||
Organization item = (Organization) getItemSelectionModel()
|
Organization item = (Organization) getItemSelectionModel()
|
||||||
.getSelectedObject(state);
|
.getSelectedObject(state);
|
||||||
}
|
}
|
||||||
|
|
||||||
/** Form processing hook. Saves Organization object. */
|
/**
|
||||||
|
* Form processing hook. Saves Organization object.
|
||||||
|
*
|
||||||
|
* @param fse
|
||||||
|
* @throws com.arsdigita.bebop.FormProcessException
|
||||||
|
*/
|
||||||
|
@Override
|
||||||
public void process( FormSectionEvent fse ) throws FormProcessException {
|
public void process( FormSectionEvent fse ) throws FormProcessException {
|
||||||
PageState state = fse.getPageState();
|
PageState state = fse.getPageState();
|
||||||
FormData data = fse.getFormData();
|
FormData data = fse.getFormData();
|
||||||
|
|
@ -216,9 +229,8 @@ public class OrganizationImageForm extends Form implements FormInitListener,
|
||||||
}
|
}
|
||||||
} else {
|
} else {
|
||||||
throw new FormProcessException
|
throw new FormProcessException
|
||||||
((String)(OrganizationGlobalizationUtil.globalize
|
(OrganizationGlobalizationUtil.globalize
|
||||||
("cms.contenttypes.ui.organization.image_option_null")
|
("cms.contenttypes.ui.organization.image_option_null"));
|
||||||
.localize()));
|
|
||||||
}
|
}
|
||||||
} else if (imageOption != null && imageOption.equals(DELETE_OPTION)) {
|
} else if (imageOption != null && imageOption.equals(DELETE_OPTION)) {
|
||||||
//
|
//
|
||||||
|
|
@ -243,6 +255,12 @@ public class OrganizationImageForm extends Form implements FormInitListener,
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
*
|
||||||
|
* @param fse
|
||||||
|
* @throws FormProcessException
|
||||||
|
*/
|
||||||
|
@Override
|
||||||
public void validate(FormSectionEvent fse) throws FormProcessException {
|
public void validate(FormSectionEvent fse) throws FormProcessException {
|
||||||
FormData data = fse.getFormData();
|
FormData data = fse.getFormData();
|
||||||
String imageOption = (String)data.get(IMAGE + IMAGE_OPTIONS);
|
String imageOption = (String)data.get(IMAGE + IMAGE_OPTIONS);
|
||||||
|
|
@ -274,6 +292,12 @@ public class OrganizationImageForm extends Form implements FormInitListener,
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
*
|
||||||
|
* @param fse
|
||||||
|
* @throws FormProcessException
|
||||||
|
*/
|
||||||
|
@Override
|
||||||
public void submitted(FormSectionEvent fse) throws FormProcessException {
|
public void submitted(FormSectionEvent fse) throws FormProcessException {
|
||||||
if (m_step != null &&
|
if (m_step != null &&
|
||||||
m_saveCancelSection.getCancelButton()
|
m_saveCancelSection.getCancelButton()
|
||||||
|
|
|
||||||
|
|
@ -78,22 +78,31 @@ public class OrganizationPropertyForm
|
||||||
/**
|
/**
|
||||||
* Adds widgets to the form.
|
* Adds widgets to the form.
|
||||||
*/
|
*/
|
||||||
|
@Override
|
||||||
protected void addWidgets() {
|
protected void addWidgets() {
|
||||||
super.addWidgets();
|
super.addWidgets();
|
||||||
|
|
||||||
TextField link = new TextField(LINK);
|
TextField link = new TextField(LINK);
|
||||||
add(new Label(OrganizationGlobalizationUtil.globalize(
|
//add(new Label(OrganizationGlobalizationUtil.globalize(
|
||||||
"cms.contenttypes.ui.organization.link")));
|
// "cms.contenttypes.ui.organization.link")));
|
||||||
|
link.setLabel(OrganizationGlobalizationUtil.globalize(
|
||||||
|
"cms.contenttypes.ui.organization.link"));
|
||||||
add(link);
|
add(link);
|
||||||
|
|
||||||
TextField contact = new TextField(CONTACT);
|
TextField contact = new TextField(CONTACT);
|
||||||
add(new Label(OrganizationGlobalizationUtil.globalize(
|
//add(new Label(OrganizationGlobalizationUtil.globalize(
|
||||||
"cms.contenttypes.ui.organization.contact")));
|
// "cms.contenttypes.ui.organization.contact")));
|
||||||
|
contact.setLabel(OrganizationGlobalizationUtil.globalize(
|
||||||
|
"cms.contenttypes.ui.organization.contact"));
|
||||||
add(contact);
|
add(contact);
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
/** Form initialisation hook. Fills widgets with data. */
|
/**
|
||||||
|
* Form initialisation hook. Fills widgets with data.
|
||||||
|
* @param fse
|
||||||
|
*/
|
||||||
|
@Override
|
||||||
public void init( FormSectionEvent fse ) {
|
public void init( FormSectionEvent fse ) {
|
||||||
FormData data = fse.getFormData();
|
FormData data = fse.getFormData();
|
||||||
Organization glossary_item
|
Organization glossary_item
|
||||||
|
|
@ -103,7 +112,11 @@ public class OrganizationPropertyForm
|
||||||
data.put( CONTACT, glossary_item.getContact() );
|
data.put( CONTACT, glossary_item.getContact() );
|
||||||
}
|
}
|
||||||
|
|
||||||
/** Cancels streamlined editing. */
|
/**
|
||||||
|
* Cancels streamlined editing.
|
||||||
|
* @param fse
|
||||||
|
*/
|
||||||
|
@Override
|
||||||
public void submitted( FormSectionEvent fse ) {
|
public void submitted( FormSectionEvent fse ) {
|
||||||
if (m_step != null &&
|
if (m_step != null &&
|
||||||
getSaveCancelSection().getCancelButton()
|
getSaveCancelSection().getCancelButton()
|
||||||
|
|
@ -112,7 +125,11 @@ public class OrganizationPropertyForm
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
/** Form processing hook. Saves Organization object. */
|
/**
|
||||||
|
* Form processing hook. Saves Organization object.
|
||||||
|
* @param fse
|
||||||
|
*/
|
||||||
|
@Override
|
||||||
public void process( FormSectionEvent fse ) {
|
public void process( FormSectionEvent fse ) {
|
||||||
FormData data = fse.getFormData();
|
FormData data = fse.getFormData();
|
||||||
|
|
||||||
|
|
|
||||||
|
|
@ -20,7 +20,6 @@ package com.arsdigita.cms.contenttypes.ui;
|
||||||
|
|
||||||
|
|
||||||
import com.arsdigita.bebop.FormData;
|
import com.arsdigita.bebop.FormData;
|
||||||
import com.arsdigita.bebop.Label;
|
|
||||||
import com.arsdigita.bebop.event.FormInitListener;
|
import com.arsdigita.bebop.event.FormInitListener;
|
||||||
import com.arsdigita.bebop.event.FormProcessListener;
|
import com.arsdigita.bebop.event.FormProcessListener;
|
||||||
import com.arsdigita.bebop.event.FormSectionEvent;
|
import com.arsdigita.bebop.event.FormSectionEvent;
|
||||||
|
|
@ -87,31 +86,32 @@ public class PressReleasePropertyForm extends BasicPageForm
|
||||||
/**
|
/**
|
||||||
* Adds widgets to the form.
|
* Adds widgets to the form.
|
||||||
*/
|
*/
|
||||||
|
@Override
|
||||||
protected void addWidgets() {
|
protected void addWidgets() {
|
||||||
super.addWidgets();
|
super.addWidgets();
|
||||||
|
|
||||||
add(new Label(GlobalizationUtil
|
|
||||||
.globalize("cms.contenttypes.ui.summary")));
|
|
||||||
ParameterModel summaryParam = new StringParameter(SUMMARY);
|
ParameterModel summaryParam = new StringParameter(SUMMARY);
|
||||||
TextArea summary = new TextArea(summaryParam);
|
TextArea summary = new TextArea(summaryParam);
|
||||||
|
summary.setLabel(GlobalizationUtil
|
||||||
|
.globalize("cms.contenttypes.ui.summary"));
|
||||||
summary.setCols(40);
|
summary.setCols(40);
|
||||||
summary.setRows(7);
|
summary.setRows(7);
|
||||||
summary.addValidationListener(new StringLengthValidationListener(4000));
|
summary.addValidationListener(new StringLengthValidationListener(4000));
|
||||||
add(summary);
|
add(summary);
|
||||||
|
|
||||||
add(new Label(PressReleaseGlobalizationUtil
|
|
||||||
.globalize("cms.contenttypes.ui.pressrelease.contact_info")));
|
|
||||||
ParameterModel contactInfoParam = new StringParameter(CONTACT_INFO);
|
ParameterModel contactInfoParam = new StringParameter(CONTACT_INFO);
|
||||||
CMSDHTMLEditor contactInfo = new CMSDHTMLEditor(contactInfoParam);
|
CMSDHTMLEditor contactInfo = new CMSDHTMLEditor(contactInfoParam);
|
||||||
|
contactInfo.setLabel(PressReleaseGlobalizationUtil
|
||||||
|
.globalize("cms.contenttypes.ui.pressrelease.contact_info"));
|
||||||
contactInfo.setCols(40);
|
contactInfo.setCols(40);
|
||||||
contactInfo.setRows(10);
|
contactInfo.setRows(10);
|
||||||
contactInfo.addValidationListener(new StringLengthValidationListener(1000));
|
contactInfo.addValidationListener(new StringLengthValidationListener(1000));
|
||||||
add(contactInfo);
|
add(contactInfo);
|
||||||
|
|
||||||
add(new Label(PressReleaseGlobalizationUtil
|
|
||||||
.globalize("cms.contenttypes.ui.pressrelease.ref_code")));
|
|
||||||
ParameterModel refCodeParam = new StringParameter(REF_CODE);
|
ParameterModel refCodeParam = new StringParameter(REF_CODE);
|
||||||
TextField refCode = new TextField(refCodeParam);
|
TextField refCode = new TextField(refCodeParam);
|
||||||
|
refCode.setLabel(PressReleaseGlobalizationUtil
|
||||||
|
.globalize("cms.contenttypes.ui.pressrelease.ref_code"));
|
||||||
refCode.setSize(30);
|
refCode.setSize(30);
|
||||||
refCode.setMaxLength(30);
|
refCode.setMaxLength(30);
|
||||||
refCode.addValidationListener(new StringLengthValidationListener(80));
|
refCode.addValidationListener(new StringLengthValidationListener(80));
|
||||||
|
|
@ -120,7 +120,9 @@ public class PressReleasePropertyForm extends BasicPageForm
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Form initialisation hook. Fills widgets with data.
|
* Form initialisation hook. Fills widgets with data.
|
||||||
|
* @param fse
|
||||||
*/
|
*/
|
||||||
|
@Override
|
||||||
public void init(FormSectionEvent fse) {
|
public void init(FormSectionEvent fse) {
|
||||||
FormData data = fse.getFormData();
|
FormData data = fse.getFormData();
|
||||||
PressRelease release
|
PressRelease release
|
||||||
|
|
@ -133,7 +135,9 @@ public class PressReleasePropertyForm extends BasicPageForm
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Cancels streamlined editing.
|
* Cancels streamlined editing.
|
||||||
|
* @param fse
|
||||||
*/
|
*/
|
||||||
|
@Override
|
||||||
public void submitted( FormSectionEvent fse ) {
|
public void submitted( FormSectionEvent fse ) {
|
||||||
if (m_step != null &&
|
if (m_step != null &&
|
||||||
getSaveCancelSection().getCancelButton()
|
getSaveCancelSection().getCancelButton()
|
||||||
|
|
@ -144,7 +148,9 @@ public class PressReleasePropertyForm extends BasicPageForm
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Form processing hook. Saves PressRelease object.
|
* Form processing hook. Saves PressRelease object.
|
||||||
|
* @param fse
|
||||||
*/
|
*/
|
||||||
|
@Override
|
||||||
public void process(FormSectionEvent fse) {
|
public void process(FormSectionEvent fse) {
|
||||||
FormData data = fse.getFormData();
|
FormData data = fse.getFormData();
|
||||||
|
|
||||||
|
|
|
||||||
|
|
@ -35,8 +35,8 @@ public class ResearchNetworkMembershipPropertyForm extends FormSection implemen
|
||||||
|
|
||||||
private final static Logger s_log = Logger.getLogger(ResearchNetworkMembershipPropertyForm.class);
|
private final static Logger s_log = Logger.getLogger(ResearchNetworkMembershipPropertyForm.class);
|
||||||
public final static String ID = "researchnetwork_membership_edit";
|
public final static String ID = "researchnetwork_membership_edit";
|
||||||
private ItemSelectionModel m_itemModel;
|
private final ItemSelectionModel m_itemModel;
|
||||||
private ResearchNetworkMembershipSelectionModel m_membershipModel;
|
private final ResearchNetworkMembershipSelectionModel m_membershipModel;
|
||||||
private ItemSearchWidget m_personSearch;
|
private ItemSearchWidget m_personSearch;
|
||||||
private final static String PERSON_SEARCH = "membership";
|
private final static String PERSON_SEARCH = "membership";
|
||||||
private SaveCancelSection m_saveCancelSection;
|
private SaveCancelSection m_saveCancelSection;
|
||||||
|
|
@ -61,8 +61,9 @@ public class ResearchNetworkMembershipPropertyForm extends FormSection implemen
|
||||||
}
|
}
|
||||||
|
|
||||||
protected void addWidgets() {
|
protected void addWidgets() {
|
||||||
add(new Label(ResearchNetworkGlobalizationUtil.globalize("cms.contenttypes.ui.researchnetwork.membership.person")));
|
|
||||||
this.m_personSearch = new ItemSearchWidget(PERSON_SEARCH, ContentType.findByAssociatedObjectType("com.arsdigita.cms.contenttypes.Person"));
|
this.m_personSearch = new ItemSearchWidget(PERSON_SEARCH, ContentType.findByAssociatedObjectType("com.arsdigita.cms.contenttypes.Person"));
|
||||||
|
this.m_personSearch.setLabel(ResearchNetworkGlobalizationUtil.globalize(
|
||||||
|
"cms.contenttypes.ui.researchnetwork.membership.person"));
|
||||||
add(this.m_personSearch);
|
add(this.m_personSearch);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
@ -71,6 +72,7 @@ public class ResearchNetworkMembershipPropertyForm extends FormSection implemen
|
||||||
try {
|
try {
|
||||||
this.m_saveCancelSection.getCancelButton().addPrintListener(new PrintListener() {
|
this.m_saveCancelSection.getCancelButton().addPrintListener(new PrintListener() {
|
||||||
|
|
||||||
|
@Override
|
||||||
public void prepare(PrintEvent e) {
|
public void prepare(PrintEvent e) {
|
||||||
Submit target = (Submit) e.getTarget();
|
Submit target = (Submit) e.getTarget();
|
||||||
if (m_membershipModel.isSelected(e.getPageState())) {
|
if (m_membershipModel.isSelected(e.getPageState())) {
|
||||||
|
|
@ -83,6 +85,7 @@ public class ResearchNetworkMembershipPropertyForm extends FormSection implemen
|
||||||
|
|
||||||
this.m_saveCancelSection.getSaveButton().addPrintListener(new PrintListener() {
|
this.m_saveCancelSection.getSaveButton().addPrintListener(new PrintListener() {
|
||||||
|
|
||||||
|
@Override
|
||||||
public void prepare(PrintEvent e) {
|
public void prepare(PrintEvent e) {
|
||||||
Submit target = (Submit) e.getTarget();
|
Submit target = (Submit) e.getTarget();
|
||||||
if(m_membershipModel.isSelected(e.getPageState())) {
|
if(m_membershipModel.isSelected(e.getPageState())) {
|
||||||
|
|
@ -116,11 +119,13 @@ public class ResearchNetworkMembershipPropertyForm extends FormSection implemen
|
||||||
Assert.exists(network);
|
Assert.exists(network);
|
||||||
ResearchNetworkMembership membership = new ResearchNetworkMembership();
|
ResearchNetworkMembership membership = new ResearchNetworkMembership();
|
||||||
membership.setResearchNetworkMembershipOwner(network);
|
membership.setResearchNetworkMembershipOwner(network);
|
||||||
s_log.debug("set network to: " + membership.getResearchNetworkMembershipOwner().getResearchNetworkTitle());
|
s_log.debug("set network to: " + membership.getResearchNetworkMembershipOwner()
|
||||||
|
.getResearchNetworkTitle());
|
||||||
return membership;
|
return membership;
|
||||||
}
|
}
|
||||||
|
|
||||||
protected void setMembershipProperties(ResearchNetworkMembership membership, FormSectionEvent event) {
|
protected void setMembershipProperties(ResearchNetworkMembership membership,
|
||||||
|
FormSectionEvent event) {
|
||||||
PageState state = event.getPageState();
|
PageState state = event.getPageState();
|
||||||
FormData data = event.getFormData();
|
FormData data = event.getFormData();
|
||||||
|
|
||||||
|
|
@ -129,6 +134,7 @@ public class ResearchNetworkMembershipPropertyForm extends FormSection implemen
|
||||||
membership.save();
|
membership.save();
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
public void init(FormSectionEvent event) throws FormProcessException {
|
public void init(FormSectionEvent event) throws FormProcessException {
|
||||||
FormData data = event.getFormData();
|
FormData data = event.getFormData();
|
||||||
PageState state = event.getPageState();
|
PageState state = event.getPageState();
|
||||||
|
|
@ -148,6 +154,7 @@ public class ResearchNetworkMembershipPropertyForm extends FormSection implemen
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
public void process(FormSectionEvent event) throws FormProcessException {
|
public void process(FormSectionEvent event) throws FormProcessException {
|
||||||
PageState state = event.getPageState();
|
PageState state = event.getPageState();
|
||||||
ResearchNetworkMembership membership;
|
ResearchNetworkMembership membership;
|
||||||
|
|
@ -167,12 +174,14 @@ public class ResearchNetworkMembershipPropertyForm extends FormSection implemen
|
||||||
init(event);
|
init(event);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
public void validate(FormSectionEvent event) throws FormProcessException {
|
public void validate(FormSectionEvent event) throws FormProcessException {
|
||||||
if (event.getFormData().get(PERSON_SEARCH) == null) {
|
if (event.getFormData().get(PERSON_SEARCH) == null) {
|
||||||
throw new FormProcessException("Person selection is required");
|
throw new FormProcessException("Person selection is required");
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
public void submitted(FormSectionEvent event) throws FormProcessException {
|
public void submitted(FormSectionEvent event) throws FormProcessException {
|
||||||
if (this.m_saveCancelSection.getCancelButton().isSelected(event.getPageState())) {
|
if (this.m_saveCancelSection.getCancelButton().isSelected(event.getPageState())) {
|
||||||
m_membershipModel.clearSelection(event.getPageState());
|
m_membershipModel.clearSelection(event.getPageState());
|
||||||
|
|
|
||||||
|
|
@ -48,36 +48,47 @@ public class ResearchNetworkPropertyForm extends BasicPageForm implements FormPr
|
||||||
public void addWidgets() {
|
public void addWidgets() {
|
||||||
super.addWidgets();
|
super.addWidgets();
|
||||||
|
|
||||||
add(new Label(ResearchNetworkGlobalizationUtil.globalize("cms.contenttypes.researchnetwork.ui.title")));
|
|
||||||
ParameterModel researchNetworkTitleParam = new StringParameter(RESEARCHNETWORK_TITLE);
|
ParameterModel researchNetworkTitleParam = new StringParameter(RESEARCHNETWORK_TITLE);
|
||||||
TextField researchNetworkTitle = new TextField(researchNetworkTitleParam);
|
TextField researchNetworkTitle = new TextField(researchNetworkTitleParam);
|
||||||
researchNetworkTitle.addValidationListener(new NotNullValidationListener());
|
researchNetworkTitle.addValidationListener(new NotNullValidationListener());
|
||||||
|
researchNetworkTitle.setLabel(ResearchNetworkGlobalizationUtil.globalize(
|
||||||
|
"cms.contenttypes.researchnetwork.ui.title"));
|
||||||
add(researchNetworkTitle);
|
add(researchNetworkTitle);
|
||||||
|
|
||||||
add(new Label(ResearchNetworkGlobalizationUtil.globalize("cms.contenttypes.researchnetwork.ui.description")));
|
|
||||||
TextArea researchNetworkAreaDescription = new TextArea(RESEARCHNETWORK_DESCRIPTION);
|
TextArea researchNetworkAreaDescription = new TextArea(RESEARCHNETWORK_DESCRIPTION);
|
||||||
|
researchNetworkAreaDescription.setLabel(ResearchNetworkGlobalizationUtil
|
||||||
|
.globalize("cms.contenttypes.researchnetwork.ui.description"));
|
||||||
researchNetworkAreaDescription.setRows(10);
|
researchNetworkAreaDescription.setRows(10);
|
||||||
researchNetworkAreaDescription.setCols(30);
|
researchNetworkAreaDescription.setCols(30);
|
||||||
add(researchNetworkAreaDescription);
|
add(researchNetworkAreaDescription);
|
||||||
|
|
||||||
add(new Label(ResearchNetworkGlobalizationUtil.globalize("cms.contenttypes.researchnetwork.ui.direction")));
|
|
||||||
TextArea researchNetworkDirection = new TextArea(RESEARCHNETWORK_DIRECTION);
|
TextArea researchNetworkDirection = new TextArea(RESEARCHNETWORK_DIRECTION);
|
||||||
|
researchNetworkDirection.setLabel(ResearchNetworkGlobalizationUtil
|
||||||
|
.globalize("cms.contenttypes.researchnetwork.ui.direction"));
|
||||||
researchNetworkDirection.setRows(5);
|
researchNetworkDirection.setRows(5);
|
||||||
researchNetworkDirection.setCols(30);
|
researchNetworkDirection.setCols(30);
|
||||||
add(researchNetworkDirection);
|
add(researchNetworkDirection);
|
||||||
|
|
||||||
add(new Label(ResearchNetworkGlobalizationUtil.globalize("cms.contenttypes.researchnetwork.ui.coordination")));
|
|
||||||
TextArea researchNetworkCoordination = new TextArea(RESEARCHNETWORK_COORDINATION);
|
TextArea researchNetworkCoordination = new TextArea(RESEARCHNETWORK_COORDINATION);
|
||||||
|
researchNetworkCoordination.setLabel(ResearchNetworkGlobalizationUtil
|
||||||
|
.globalize("cms.contenttypes.researchnetwork.ui.coordination"));
|
||||||
researchNetworkCoordination.setRows(5);
|
researchNetworkCoordination.setRows(5);
|
||||||
researchNetworkCoordination.setCols(30);
|
researchNetworkCoordination.setCols(30);
|
||||||
add(researchNetworkCoordination);
|
add(researchNetworkCoordination);
|
||||||
|
|
||||||
add(new Label(ResearchNetworkGlobalizationUtil.globalize("cms.contenttypes.researchnetwork.ui.website")));
|
|
||||||
ParameterModel researchNetworkWebsiteParam = new StringParameter(RESEARCHNETWORK_WEBSITE);
|
ParameterModel researchNetworkWebsiteParam = new StringParameter(RESEARCHNETWORK_WEBSITE);
|
||||||
TextField researchNetworkWebsite = new TextField(researchNetworkWebsiteParam);
|
TextField researchNetworkWebsite = new TextField(researchNetworkWebsiteParam);
|
||||||
|
researchNetworkWebsite.setLabel(ResearchNetworkGlobalizationUtil
|
||||||
|
.globalize("cms.contenttypes.researchnetwork.ui.website"));
|
||||||
add(researchNetworkWebsite);
|
add(researchNetworkWebsite);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
*
|
||||||
|
* @param e
|
||||||
|
* @throws FormProcessException
|
||||||
|
*/
|
||||||
|
@Override
|
||||||
public void init(FormSectionEvent e) throws FormProcessException {
|
public void init(FormSectionEvent e) throws FormProcessException {
|
||||||
FormData data = e.getFormData();
|
FormData data = e.getFormData();
|
||||||
ResearchNetwork network = (ResearchNetwork) super.initBasicWidgets(e);
|
ResearchNetwork network = (ResearchNetwork) super.initBasicWidgets(e);
|
||||||
|
|
@ -89,6 +100,7 @@ public class ResearchNetworkPropertyForm extends BasicPageForm implements FormPr
|
||||||
data.put(RESEARCHNETWORK_DESCRIPTION, network.getResearchNetworkDescription());
|
data.put(RESEARCHNETWORK_DESCRIPTION, network.getResearchNetworkDescription());
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
public void process(FormSectionEvent e) throws FormProcessException {
|
public void process(FormSectionEvent e) throws FormProcessException {
|
||||||
FormData data = e.getFormData();
|
FormData data = e.getFormData();
|
||||||
|
|
||||||
|
|
@ -109,6 +121,7 @@ public class ResearchNetworkPropertyForm extends BasicPageForm implements FormPr
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
public void submitted(FormSectionEvent e) throws FormProcessException {
|
public void submitted(FormSectionEvent e) throws FormProcessException {
|
||||||
if ((this.m_step != null) && (getSaveCancelSection().getCancelButton().isSelected(e.getPageState()))) {
|
if ((this.m_step != null) && (getSaveCancelSection().getCancelButton().isSelected(e.getPageState()))) {
|
||||||
this.m_step.cancelStreamlinedCreation(e.getPageState());
|
this.m_step.cancelStreamlinedCreation(e.getPageState());
|
||||||
|
|
|
||||||
|
|
@ -87,46 +87,47 @@ public class ServicePropertyForm extends BasicPageForm
|
||||||
* Adds widgets to the form.
|
* Adds widgets to the form.
|
||||||
*/
|
*/
|
||||||
protected void addWidgets() {
|
protected void addWidgets() {
|
||||||
|
|
||||||
super.addWidgets();
|
super.addWidgets();
|
||||||
|
|
||||||
add(new Label(GlobalizationUtil
|
|
||||||
.globalize("cms.contenttypes.ui.summary")));
|
|
||||||
ParameterModel summaryParam = new StringParameter(SUMMARY);
|
ParameterModel summaryParam = new StringParameter(SUMMARY);
|
||||||
TextArea summary = new TextArea(summaryParam);
|
TextArea summary = new TextArea(summaryParam);
|
||||||
|
summary.setLabel(GlobalizationUtil
|
||||||
|
.globalize("cms.contenttypes.ui.summary"));
|
||||||
summary.setCols(40);
|
summary.setCols(40);
|
||||||
summary.setRows(5);
|
summary.setRows(5);
|
||||||
add(summary);
|
add(summary);
|
||||||
|
|
||||||
add(new Label(ServiceGlobalizationUtil
|
|
||||||
.globalize("cms.contenttypes.ui.service.services_provided")));
|
|
||||||
ParameterModel servicesProvidedParam =
|
ParameterModel servicesProvidedParam =
|
||||||
new StringParameter(SERVICES_PROVIDED);
|
new StringParameter(SERVICES_PROVIDED);
|
||||||
TextArea servicesProvided = new TextArea(servicesProvidedParam);
|
TextArea servicesProvided = new TextArea(servicesProvidedParam);
|
||||||
|
servicesProvided.setLabel(ServiceGlobalizationUtil
|
||||||
|
.globalize("cms.contenttypes.ui.service.services_provided"));
|
||||||
servicesProvided.setCols(40);
|
servicesProvided.setCols(40);
|
||||||
servicesProvided.setRows(5);
|
servicesProvided.setRows(5);
|
||||||
add(servicesProvided);
|
add(servicesProvided);
|
||||||
|
|
||||||
add(new Label(ServiceGlobalizationUtil
|
|
||||||
.globalize("cms.contenttypes.ui.service.opening_times")));
|
|
||||||
ParameterModel openingTimesParam = new StringParameter(OPENING_TIMES);
|
ParameterModel openingTimesParam = new StringParameter(OPENING_TIMES);
|
||||||
TextArea openingTimes = new TextArea(openingTimesParam);
|
TextArea openingTimes = new TextArea(openingTimesParam);
|
||||||
|
openingTimes.setLabel(ServiceGlobalizationUtil
|
||||||
|
.globalize("cms.contenttypes.ui.service.opening_times"));
|
||||||
openingTimes.setCols(40);
|
openingTimes.setCols(40);
|
||||||
openingTimes.setRows(5);
|
openingTimes.setRows(5);
|
||||||
add(openingTimes);
|
add(openingTimes);
|
||||||
|
|
||||||
add(new Label(ServiceGlobalizationUtil
|
|
||||||
.globalize("cms.contenttypes.ui.service.address")));
|
|
||||||
ParameterModel addressParam = new StringParameter(ADDRESS);
|
ParameterModel addressParam = new StringParameter(ADDRESS);
|
||||||
TextArea address = new TextArea(addressParam);
|
TextArea address = new TextArea(addressParam);
|
||||||
|
address.setLabel(ServiceGlobalizationUtil
|
||||||
|
.globalize("cms.contenttypes.ui.service.address"));
|
||||||
address.setCols(40);
|
address.setCols(40);
|
||||||
address.setRows(5);
|
address.setRows(5);
|
||||||
add(address);
|
add(address);
|
||||||
|
|
||||||
|
|
||||||
add(new Label(ServiceGlobalizationUtil
|
|
||||||
.globalize("cms.contenttypes.ui.service.contacts")));
|
|
||||||
ParameterModel contactsParam = new StringParameter(CONTACTS);
|
ParameterModel contactsParam = new StringParameter(CONTACTS);
|
||||||
TextArea contacts = new TextArea(contactsParam);
|
TextArea contacts = new TextArea(contactsParam);
|
||||||
|
contacts.setLabel(ServiceGlobalizationUtil
|
||||||
|
.globalize("cms.contenttypes.ui.service.contacts"));
|
||||||
contacts.setCols(40);
|
contacts.setCols(40);
|
||||||
contacts.setRows(5);
|
contacts.setRows(5);
|
||||||
add(contacts);
|
add(contacts);
|
||||||
|
|
@ -135,7 +136,9 @@ public class ServicePropertyForm extends BasicPageForm
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Form initialisation hook. Fills widgets with data.
|
* Form initialisation hook. Fills widgets with data.
|
||||||
|
* @param fse
|
||||||
*/
|
*/
|
||||||
|
@Override
|
||||||
public void init(FormSectionEvent fse) {
|
public void init(FormSectionEvent fse) {
|
||||||
FormData data = fse.getFormData();
|
FormData data = fse.getFormData();
|
||||||
Service service = (Service) super.initBasicWidgets(fse);
|
Service service = (Service) super.initBasicWidgets(fse);
|
||||||
|
|
@ -149,7 +152,9 @@ public class ServicePropertyForm extends BasicPageForm
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Cancels streamlined editing.
|
* Cancels streamlined editing.
|
||||||
|
* @param fse
|
||||||
*/
|
*/
|
||||||
|
@Override
|
||||||
public void submitted( FormSectionEvent fse ) {
|
public void submitted( FormSectionEvent fse ) {
|
||||||
if (m_step != null &&
|
if (m_step != null &&
|
||||||
getSaveCancelSection().getCancelButton()
|
getSaveCancelSection().getCancelButton()
|
||||||
|
|
@ -160,7 +165,9 @@ public class ServicePropertyForm extends BasicPageForm
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Form processing hook. Saves Service object.
|
* Form processing hook. Saves Service object.
|
||||||
|
* @param fse
|
||||||
*/
|
*/
|
||||||
|
@Override
|
||||||
public void process(FormSectionEvent fse) {
|
public void process(FormSectionEvent fse) {
|
||||||
FormData data = fse.getFormData();
|
FormData data = fse.getFormData();
|
||||||
|
|
||||||
|
|
|
||||||
|
|
@ -118,24 +118,24 @@ public class SimpleAddressPropertyForm extends BasicPageForm
|
||||||
protected void addWidgets() {
|
protected void addWidgets() {
|
||||||
super.addWidgets();
|
super.addWidgets();
|
||||||
|
|
||||||
add( new Label( SimpleAddressGlobalizationUtil.globalize(
|
|
||||||
"cms.contenttypes.ui.simpleaddress.address" ) ) );
|
|
||||||
ParameterModel addressBodyParam = new StringParameter( ADDRESS );
|
ParameterModel addressBodyParam = new StringParameter( ADDRESS );
|
||||||
addressBodyParam.addParameterListener( new NotNullValidationListener( ) );
|
addressBodyParam.addParameterListener( new NotNullValidationListener( ) );
|
||||||
addressBodyParam.addParameterListener(
|
addressBodyParam.addParameterListener(
|
||||||
new StringInRangeValidationListener(0, 1000) );
|
new StringInRangeValidationListener(0, 1000) );
|
||||||
TextArea addressBody = new TextArea( addressBodyParam );
|
TextArea addressBody = new TextArea( addressBodyParam );
|
||||||
|
addressBody.setLabel(SimpleAddressGlobalizationUtil.globalize(
|
||||||
|
"cms.contenttypes.ui.simpleaddress.address" ));
|
||||||
addressBody.setRows(5);
|
addressBody.setRows(5);
|
||||||
addressBody.setCols(30);
|
addressBody.setCols(30);
|
||||||
add( addressBody );
|
add( addressBody );
|
||||||
|
|
||||||
if (!SimpleAddress.getConfig().getHideCountryCodeSelection()) {
|
if (!SimpleAddress.getConfig().getHideCountryCodeSelection()) {
|
||||||
add( new Label(SimpleAddressGlobalizationUtil.globalize(
|
// add( new Label(SimpleAddressGlobalizationUtil.globalize(
|
||||||
"cms.contenttypes.ui.simpleaddress.iso_country_code") ));
|
// "cms.contenttypes.ui.simpleaddress.iso_country_code") ));
|
||||||
ParameterModel isoCountryCodeParam = new StringParameter( ISO_COUNTRY_CODE );
|
ParameterModel isoCountryCodeParam = new StringParameter( ISO_COUNTRY_CODE );
|
||||||
//isoCountryCodeParam.addParameterListener( new NotNullValidationListener( ) );
|
//isoCountryCodeParam.addParameterListener( new NotNullValidationListener( ) );
|
||||||
// Don't assume submission via drop-down menu isoCountryCode
|
// Don't assume submission via drop-down menu isoCountryCode
|
||||||
isoCountryCodeParam.addParameterListener(
|
isoCountryCodeParam.addParameterListener(
|
||||||
new StringInRangeValidationListener(0, 2) );
|
new StringInRangeValidationListener(0, 2) );
|
||||||
SingleSelect isoCountryCode = new SingleSelect( isoCountryCodeParam );
|
SingleSelect isoCountryCode = new SingleSelect( isoCountryCodeParam );
|
||||||
|
|
||||||
|
|
@ -154,6 +154,7 @@ public class SimpleAddressPropertyForm extends BasicPageForm
|
||||||
|
|
||||||
isoCountryCode.addValidationListener(
|
isoCountryCode.addValidationListener(
|
||||||
new ParameterListener() {
|
new ParameterListener() {
|
||||||
|
@Override
|
||||||
public void validate(ParameterEvent e) throws FormProcessException {
|
public void validate(ParameterEvent e) throws FormProcessException {
|
||||||
// the --select one-- option is not allowed
|
// the --select one-- option is not allowed
|
||||||
ParameterData data = e.getParameterData();
|
ParameterData data = e.getParameterData();
|
||||||
|
|
@ -167,93 +168,98 @@ public class SimpleAddressPropertyForm extends BasicPageForm
|
||||||
}
|
}
|
||||||
}});
|
}});
|
||||||
|
|
||||||
|
isoCountryCode.setLabel(SimpleAddressGlobalizationUtil.globalize(
|
||||||
|
"cms.contenttypes.ui.simpleaddress.iso_country_code"));
|
||||||
add( isoCountryCode );
|
add( isoCountryCode );
|
||||||
}
|
}
|
||||||
|
|
||||||
if (!SimpleAddress.getConfig().getHidePostalCode()) {
|
if (!SimpleAddress.getConfig().getHidePostalCode()) {
|
||||||
add( new Label(SimpleAddressGlobalizationUtil.globalize(
|
|
||||||
"cms.contenttypes.ui.simpleaddress.postal_code") ) );
|
|
||||||
ParameterModel postalCodeParam = new StringParameter( POSTAL_CODE );
|
ParameterModel postalCodeParam = new StringParameter( POSTAL_CODE );
|
||||||
// postalCodeParam.addParameterListener( new NotNullValidationListener( ) );
|
// postalCodeParam.addParameterListener( new NotNullValidationListener( ) );
|
||||||
postalCodeParam.addParameterListener(
|
postalCodeParam.addParameterListener(
|
||||||
new StringInRangeValidationListener(0, 20) );
|
new StringInRangeValidationListener(0, 20) );
|
||||||
TextField postalCode = new TextField( postalCodeParam );
|
TextField postalCode = new TextField( postalCodeParam );
|
||||||
|
postalCode.setLabel(SimpleAddressGlobalizationUtil.globalize(
|
||||||
|
"cms.contenttypes.ui.simpleaddress.postal_code"));
|
||||||
postalCode.setMaxLength( 20 );
|
postalCode.setMaxLength( 20 );
|
||||||
add( postalCode );
|
add( postalCode );
|
||||||
}
|
}
|
||||||
|
|
||||||
add( new Label( SimpleAddressGlobalizationUtil.globalize(
|
|
||||||
"cms.contenttypes.ui.simpleaddress.phone" ) ) );
|
|
||||||
ParameterModel phoneParam = new StringParameter( PHONE );
|
ParameterModel phoneParam = new StringParameter( PHONE );
|
||||||
phoneParam.addParameterListener( new StringInRangeValidationListener(0,20) );
|
phoneParam.addParameterListener( new StringInRangeValidationListener(0,20) );
|
||||||
TextField phone = new TextField( phoneParam );
|
TextField phone = new TextField( phoneParam );
|
||||||
|
phone.setLabel(SimpleAddressGlobalizationUtil.globalize(
|
||||||
|
"cms.contenttypes.ui.simpleaddress.phone" ));
|
||||||
phone.setSize(20);
|
phone.setSize(20);
|
||||||
phone.setMaxLength( 20 );
|
phone.setMaxLength( 20 );
|
||||||
add( phone );
|
add( phone );
|
||||||
|
|
||||||
add( new Label(SimpleAddressGlobalizationUtil.globalize(
|
|
||||||
"cms.contenttypes.ui.simpleaddress.mobile" ) ) );
|
|
||||||
ParameterModel mobileParam = new StringParameter( MOBILE );
|
ParameterModel mobileParam = new StringParameter( MOBILE );
|
||||||
mobileParam.addParameterListener( new StringInRangeValidationListener(0, 20) );
|
mobileParam.addParameterListener( new StringInRangeValidationListener(0, 20) );
|
||||||
TextField mobile = new TextField( mobileParam );
|
TextField mobile = new TextField( mobileParam );
|
||||||
|
mobile.setLabel(SimpleAddressGlobalizationUtil.globalize(
|
||||||
|
"cms.contenttypes.ui.simpleaddress.mobile" ));
|
||||||
mobile.setSize(20);
|
mobile.setSize(20);
|
||||||
mobile.setMaxLength( 20 );
|
mobile.setMaxLength( 20 );
|
||||||
add( mobile );
|
add( mobile );
|
||||||
|
|
||||||
add( new Label(SimpleAddressGlobalizationUtil.globalize(
|
|
||||||
"cms.contenttypes.ui.simpleaddress.fax") ) );
|
|
||||||
ParameterModel faxParam = new StringParameter( FAX );
|
ParameterModel faxParam = new StringParameter( FAX );
|
||||||
faxParam.addParameterListener( new StringInRangeValidationListener(0, 20) );
|
faxParam.addParameterListener( new StringInRangeValidationListener(0, 20) );
|
||||||
TextField fax = new TextField( faxParam );
|
TextField fax = new TextField( faxParam );
|
||||||
|
fax.setLabel(SimpleAddressGlobalizationUtil.globalize(
|
||||||
|
"cms.contenttypes.ui.simpleaddress.fax"));
|
||||||
fax.setSize(20);
|
fax.setSize(20);
|
||||||
fax.setMaxLength( 20 );
|
fax.setMaxLength( 20 );
|
||||||
add( fax );
|
add( fax );
|
||||||
|
|
||||||
add( new Label(SimpleAddressGlobalizationUtil.globalize(
|
|
||||||
"cms.contenttypes.ui.simpleaddress.email" ) ) );
|
|
||||||
ParameterModel emailParam = new StringParameter( EMAIL );
|
ParameterModel emailParam = new StringParameter( EMAIL );
|
||||||
emailParam.addParameterListener( new StringInRangeValidationListener(0, 75) );
|
emailParam.addParameterListener( new StringInRangeValidationListener(0, 75) );
|
||||||
TextField email = new TextField( emailParam );
|
TextField email = new TextField( emailParam );
|
||||||
|
email.setLabel(SimpleAddressGlobalizationUtil.globalize(
|
||||||
|
"cms.contenttypes.ui.simpleaddress.email" ));
|
||||||
email.setSize(25);
|
email.setSize(25);
|
||||||
email.setMaxLength( 75 );
|
email.setMaxLength( 75 );
|
||||||
email.setHint(SimpleAddressGlobalizationUtil.globalize
|
email.setHint(SimpleAddressGlobalizationUtil.globalize
|
||||||
( "cms.contenttypes.ui.simpleaddress.email_hint")
|
( "cms.contenttypes.ui.simpleaddress.email_hint"));
|
||||||
.localize().toString());
|
|
||||||
add( email );
|
add( email );
|
||||||
add(new Label(""));
|
|
||||||
|
add(new Label());
|
||||||
add(new Label(SimpleAddressGlobalizationUtil.globalize(
|
add(new Label(SimpleAddressGlobalizationUtil.globalize(
|
||||||
"cms.contenttypes.ui.simpleaddress.email_desc") ) );
|
"cms.contenttypes.ui.simpleaddress.email_desc") ) );
|
||||||
|
|
||||||
add( new Label(SimpleAddressGlobalizationUtil.globalize(
|
// add( new Label(SimpleAddressGlobalizationUtil.globalize(
|
||||||
"cms.contenttypes.ui.simpleaddress.uri") ) );
|
// "cms.contenttypes.ui.simpleaddress.uri") ) );
|
||||||
ParameterModel uriParam = new StringParameter( URI );
|
ParameterModel uriParam = new StringParameter( URI );
|
||||||
uriParam.addParameterListener( new StringInRangeValidationListener(0,250) );
|
uriParam.addParameterListener( new StringInRangeValidationListener(0,250) );
|
||||||
TextField uri = new TextField( uriParam );
|
TextField uri = new TextField( uriParam );
|
||||||
uri.addValidationListener(new URLValidationListener(){
|
uri.addValidationListener(new URLValidationListener() {
|
||||||
@Override
|
@Override
|
||||||
public void validate(ParameterEvent e)throws FormProcessException{
|
public void validate(ParameterEvent e) throws FormProcessException {
|
||||||
ParameterData d = e.getParameterData();
|
ParameterData d = e.getParameterData();
|
||||||
String value = (String)d.getValue();
|
String value = (String) d.getValue();
|
||||||
if(value.indexOf("http")<0)
|
if (value.indexOf("http") < 0) {
|
||||||
value = "http://" + value;
|
value = "http://" + value;
|
||||||
d.setValue(value);
|
}
|
||||||
super.validate(e);
|
d.setValue(value);
|
||||||
}
|
super.validate(e);
|
||||||
});
|
}
|
||||||
|
});
|
||||||
|
uri.setLabel(SimpleAddressGlobalizationUtil.globalize(
|
||||||
|
"cms.contenttypes.ui.simpleaddress.uri"));
|
||||||
uri.setSize(30);
|
uri.setSize(30);
|
||||||
uri.setMaxLength( 250 );
|
uri.setMaxLength( 250 );
|
||||||
uri.setHint(SimpleAddressGlobalizationUtil.globalize
|
uri.setHint(SimpleAddressGlobalizationUtil.globalize
|
||||||
( "cms.contenttypes.ui.simpleaddress.uri_hint")
|
( "cms.contenttypes.ui.simpleaddress.uri_hint"));
|
||||||
.localize().toString());
|
|
||||||
add( uri );
|
add( uri );
|
||||||
add(new Label(""));
|
|
||||||
|
add(new Label());
|
||||||
add(new Label(SimpleAddressGlobalizationUtil.globalize(
|
add(new Label(SimpleAddressGlobalizationUtil.globalize(
|
||||||
"cms.contenttypes.ui.simpleaddress.uri_desc") ) );
|
"cms.contenttypes.ui.simpleaddress.uri_desc") ) );
|
||||||
|
|
||||||
add( new Label(SimpleAddressGlobalizationUtil.globalize(
|
|
||||||
"cms.contenttypes.ui.simpleaddress.notes") ) );
|
|
||||||
ParameterModel notesParam = new StringParameter( NOTES );
|
ParameterModel notesParam = new StringParameter( NOTES );
|
||||||
TextArea notes = new TextArea( notesParam );
|
TextArea notes = new TextArea( notesParam );
|
||||||
|
notes.setLabel(SimpleAddressGlobalizationUtil.globalize(
|
||||||
|
"cms.contenttypes.ui.simpleaddress.notes"));
|
||||||
notes.setRows(8);
|
notes.setRows(8);
|
||||||
notes.setCols(30);
|
notes.setCols(30);
|
||||||
add( notes );
|
add( notes );
|
||||||
|
|
@ -261,7 +267,9 @@ public class SimpleAddressPropertyForm extends BasicPageForm
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Form initialization hook. Fills widgets with data.
|
* Form initialization hook. Fills widgets with data.
|
||||||
|
* @param fse
|
||||||
*/
|
*/
|
||||||
|
@Override
|
||||||
public void init(FormSectionEvent fse) {
|
public void init(FormSectionEvent fse) {
|
||||||
FormData data = fse.getFormData();
|
FormData data = fse.getFormData();
|
||||||
SimpleAddress address = ( SimpleAddress ) super.initBasicWidgets(fse);
|
SimpleAddress address = ( SimpleAddress ) super.initBasicWidgets(fse);
|
||||||
|
|
@ -292,7 +300,11 @@ public class SimpleAddressPropertyForm extends BasicPageForm
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
/** Cancels streamlined editing. */
|
/**
|
||||||
|
* Cancels streamlined editing.
|
||||||
|
* @param fse
|
||||||
|
*/
|
||||||
|
@Override
|
||||||
public void submitted( FormSectionEvent fse ) {
|
public void submitted( FormSectionEvent fse ) {
|
||||||
if (m_step != null &&
|
if (m_step != null &&
|
||||||
getSaveCancelSection().getCancelButton()
|
getSaveCancelSection().getCancelButton()
|
||||||
|
|
@ -303,7 +315,9 @@ public class SimpleAddressPropertyForm extends BasicPageForm
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Form processing hook. Saves SimpleAddress object.
|
* Form processing hook. Saves SimpleAddress object.
|
||||||
|
* @param fse
|
||||||
*/
|
*/
|
||||||
|
@Override
|
||||||
public void process(FormSectionEvent fse) {
|
public void process(FormSectionEvent fse) {
|
||||||
FormData data = fse.getFormData();
|
FormData data = fse.getFormData();
|
||||||
|
|
||||||
|
|
|
||||||
|
|
@ -7,11 +7,12 @@ import com.arsdigita.cms.ItemSelectionModel;
|
||||||
/**
|
/**
|
||||||
*
|
*
|
||||||
* @author Jens Pelzetter
|
* @author Jens Pelzetter
|
||||||
* @version $Id$
|
* @version $Id: SimpleOrganizationPropertyForm.java 1611 2012-04-23 08:57:28Z
|
||||||
|
* jensp $
|
||||||
*/
|
*/
|
||||||
public class SimpleOrganizationPropertyForm extends GenericOrganizationalUnitPropertyForm {
|
public class SimpleOrganizationPropertyForm extends GenericOrganizationalUnitPropertyForm {
|
||||||
|
|
||||||
private SimpleOrganizationPropertiesStep m_step;
|
private SimpleOrganizationPropertiesStep m_step;
|
||||||
public static final String ID = "SimpleOrganization_edit";
|
public static final String ID = "SimpleOrganization_edit";
|
||||||
|
|
||||||
public SimpleOrganizationPropertyForm(final ItemSelectionModel itemModel) {
|
public SimpleOrganizationPropertyForm(final ItemSelectionModel itemModel) {
|
||||||
|
|
@ -20,7 +21,7 @@ public class SimpleOrganizationPropertyForm extends GenericOrganizationalUnitPro
|
||||||
|
|
||||||
public SimpleOrganizationPropertyForm(
|
public SimpleOrganizationPropertyForm(
|
||||||
final ItemSelectionModel itemModel,
|
final ItemSelectionModel itemModel,
|
||||||
final SimpleOrganizationPropertiesStep step) {
|
final SimpleOrganizationPropertiesStep step) {
|
||||||
super(itemModel, step);
|
super(itemModel, step);
|
||||||
m_step = step;
|
m_step = step;
|
||||||
addSubmissionListener(this);
|
addSubmissionListener(this);
|
||||||
|
|
|
||||||
|
|
@ -35,80 +35,87 @@ import com.arsdigita.cms.ui.authoring.BasicItemForm;
|
||||||
*/
|
*/
|
||||||
public class SiteProxyAtoZPropertyForm extends BasicItemForm {
|
public class SiteProxyAtoZPropertyForm extends BasicItemForm {
|
||||||
|
|
||||||
private TextField m_title_atoz;
|
private TextField m_title_atoz;
|
||||||
|
|
||||||
private RadioGroup m_radiogroupUsedInAtoZ;
|
private RadioGroup m_radiogroupUsedInAtoZ;
|
||||||
|
|
||||||
private ItemSelectionModel m_selectionModel;
|
private ItemSelectionModel m_selectionModel;
|
||||||
|
|
||||||
private SiteProxy siteProxy;
|
private SiteProxy siteProxy;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Creates a new form to edit the SiteProxy object specified by the item
|
* Creates a new form to edit the SiteProxy object specified by the item
|
||||||
* selection model passed in.
|
* selection model passed in.
|
||||||
*
|
*
|
||||||
* @param itemModel
|
* @param itemModel The ItemSelectionModel to use to obtain the SiteProxy to
|
||||||
* The ItemSelectionModel to use to obtain the SiteProxy to work
|
* work on
|
||||||
* on
|
*/
|
||||||
*/
|
public SiteProxyAtoZPropertyForm(ItemSelectionModel itemModel) {
|
||||||
public SiteProxyAtoZPropertyForm(ItemSelectionModel itemModel) {
|
super("siteProxyAtoZEdit", itemModel);
|
||||||
super("siteProxyAtoZEdit", itemModel);
|
m_selectionModel = itemModel;
|
||||||
m_selectionModel = itemModel;
|
}
|
||||||
}
|
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Adds widgets to the form.
|
* Adds widgets to the form.
|
||||||
*/
|
*/
|
||||||
@Override
|
@Override
|
||||||
protected void addWidgets() {
|
protected void addWidgets() {
|
||||||
|
|
||||||
add(new Label(SiteProxyGlobalizationUtil
|
m_title_atoz = new TextField(SiteProxy.TITLE_ATOZ);
|
||||||
.globalize("cms.contenttypes.ui.siteproxy.label.atoztitle")));
|
m_title_atoz.setLabel(SiteProxyGlobalizationUtil
|
||||||
m_title_atoz = new TextField(SiteProxy.TITLE_ATOZ);
|
.globalize("cms.contenttypes.ui.siteproxy.label.atoztitle"));
|
||||||
m_title_atoz.setSize(50);
|
m_title_atoz.setSize(50);
|
||||||
add(m_title_atoz);
|
add(m_title_atoz);
|
||||||
|
|
||||||
add(new Label(SiteProxyGlobalizationUtil
|
m_radiogroupUsedInAtoZ = new RadioGroup(SiteProxy.USED_IN_ATOZ);
|
||||||
.globalize("cms.contenttypes.ui.siteproxy.label.usedinatoz")));
|
m_radiogroupUsedInAtoZ.addOption(new Option(Boolean.TRUE.toString(),
|
||||||
m_radiogroupUsedInAtoZ = new RadioGroup(SiteProxy.USED_IN_ATOZ);
|
new Label(SiteProxyGlobalizationUtil.globalize(
|
||||||
m_radiogroupUsedInAtoZ.addOption(new
|
"cms.contenttypes.ui.siteproxy.option.usedinatoz.yes"))
|
||||||
Option(Boolean.TRUE.toString(),
|
));
|
||||||
new Label( SiteProxyGlobalizationUtil.globalize(
|
m_radiogroupUsedInAtoZ.addOption(new Option(Boolean.FALSE.toString(),
|
||||||
"cms.contenttypes.ui.siteproxy.option.usedinatoz.yes"))
|
new Label(SiteProxyGlobalizationUtil.globalize(
|
||||||
));
|
"cms.contenttypes.ui.siteproxy.option.usedinatoz.no"))
|
||||||
m_radiogroupUsedInAtoZ.addOption(new
|
));
|
||||||
Option(Boolean.FALSE.toString(),
|
m_radiogroupUsedInAtoZ.setLabel(SiteProxyGlobalizationUtil
|
||||||
new Label( SiteProxyGlobalizationUtil.globalize(
|
.globalize("cms.contenttypes.ui.siteproxy.label.usedinatoz"));
|
||||||
"cms.contenttypes.ui.siteproxy.option.usedinatoz.no"))
|
add(m_radiogroupUsedInAtoZ);
|
||||||
));
|
}
|
||||||
add(m_radiogroupUsedInAtoZ);
|
|
||||||
}
|
|
||||||
|
|
||||||
/** Form initialisation hook. Fills widgets with data. */
|
/**
|
||||||
public void init(FormSectionEvent fse) {
|
* Form initialisation hook. Fills widgets with data.
|
||||||
PageState pageState = fse.getPageState();
|
* @param fse
|
||||||
siteProxy = (SiteProxy) m_selectionModel.getSelectedObject(pageState);
|
*/
|
||||||
if (siteProxy == null)
|
@Override
|
||||||
return;
|
public void init(FormSectionEvent fse) {
|
||||||
|
PageState pageState = fse.getPageState();
|
||||||
|
siteProxy = (SiteProxy) m_selectionModel.getSelectedObject(pageState);
|
||||||
|
if (siteProxy == null) {
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
|
||||||
m_title_atoz.setValue(pageState, siteProxy.getAtoZTitle());
|
m_title_atoz.setValue(pageState, siteProxy.getAtoZTitle());
|
||||||
m_radiogroupUsedInAtoZ.setValue(pageState, new Boolean(siteProxy
|
m_radiogroupUsedInAtoZ.setValue(pageState, Boolean.valueOf(siteProxy
|
||||||
.isUsedInAtoZ()).toString());
|
.isUsedInAtoZ()).toString());
|
||||||
}
|
}
|
||||||
|
|
||||||
/** Form processing hook. Saves SiteProxy object. */
|
/**
|
||||||
public void process(FormSectionEvent fse) {
|
* Form processing hook. Saves SiteProxy object.
|
||||||
PageState pageState = fse.getPageState();
|
* @param fse
|
||||||
siteProxy = (SiteProxy) m_selectionModel.getSelectedObject(pageState);
|
*/
|
||||||
/* proced only when siteProxy is present and save button was pressed */
|
@Override
|
||||||
if ((siteProxy == null)
|
public void process(FormSectionEvent fse) {
|
||||||
&& !getSaveCancelSection().getSaveButton()
|
PageState pageState = fse.getPageState();
|
||||||
.isSelected(pageState))
|
siteProxy = (SiteProxy) m_selectionModel.getSelectedObject(pageState);
|
||||||
return;
|
/* proced only when siteProxy is present and save button was pressed */
|
||||||
|
if ((siteProxy == null)
|
||||||
|
&& !getSaveCancelSection().getSaveButton()
|
||||||
|
.isSelected(pageState)) {
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
|
||||||
siteProxy.setAtoZTitle((String) m_title_atoz.getValue(pageState));
|
siteProxy.setAtoZTitle((String) m_title_atoz.getValue(pageState));
|
||||||
siteProxy.setUsedInAtoZ(new Boolean((String) m_radiogroupUsedInAtoZ
|
siteProxy.setUsedInAtoZ(Boolean.valueOf((String) m_radiogroupUsedInAtoZ
|
||||||
.getValue(pageState)).booleanValue());
|
.getValue(pageState)).booleanValue());
|
||||||
siteProxy.save();
|
siteProxy.save();
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
|
||||||
|
|
@ -19,15 +19,14 @@
|
||||||
package com.arsdigita.cms.contenttypes.ui;
|
package com.arsdigita.cms.contenttypes.ui;
|
||||||
|
|
||||||
import com.arsdigita.cms.contenttypes.SiteProxy;
|
import com.arsdigita.cms.contenttypes.SiteProxy;
|
||||||
import com.arsdigita.bebop.Label;
|
|
||||||
import com.arsdigita.bebop.event.FormInitListener;
|
import com.arsdigita.bebop.event.FormInitListener;
|
||||||
import com.arsdigita.bebop.event.FormProcessListener;
|
import com.arsdigita.bebop.event.FormProcessListener;
|
||||||
import com.arsdigita.bebop.event.FormSectionEvent;
|
import com.arsdigita.bebop.event.FormSectionEvent;
|
||||||
import com.arsdigita.bebop.form.TextField;
|
import com.arsdigita.bebop.form.TextField;
|
||||||
import com.arsdigita.bebop.parameters.ParameterModel;
|
import com.arsdigita.bebop.parameters.ParameterModel;
|
||||||
import com.arsdigita.bebop.parameters.ParameterModel;
|
|
||||||
import com.arsdigita.bebop.parameters.StringParameter;
|
import com.arsdigita.bebop.parameters.StringParameter;
|
||||||
import com.arsdigita.cms.ItemSelectionModel;
|
import com.arsdigita.cms.ItemSelectionModel;
|
||||||
|
import com.arsdigita.cms.contenttypes.util.SiteProxyGlobalizationUtil;
|
||||||
import com.arsdigita.cms.ui.authoring.BasicPageForm;
|
import com.arsdigita.cms.ui.authoring.BasicPageForm;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
|
|
@ -53,17 +52,24 @@ public class SiteProxyPropertyForm extends BasicPageForm
|
||||||
/**
|
/**
|
||||||
* Adds widgets to the form.
|
* Adds widgets to the form.
|
||||||
*/
|
*/
|
||||||
|
@Override
|
||||||
protected void addWidgets() {
|
protected void addWidgets() {
|
||||||
|
|
||||||
super.addWidgets();
|
super.addWidgets();
|
||||||
|
|
||||||
add(new Label("URL:"));
|
|
||||||
ParameterModel urlParam = new StringParameter("url");
|
ParameterModel urlParam = new StringParameter("url");
|
||||||
|
m_url.setLabel(SiteProxyGlobalizationUtil
|
||||||
|
.globalize("cms.contenttypes.ui.siteproxy.url"));
|
||||||
m_url = new TextField(urlParam);
|
m_url = new TextField(urlParam);
|
||||||
m_url.setSize(40);
|
m_url.setSize(40);
|
||||||
add(m_url);
|
add(m_url);
|
||||||
}
|
}
|
||||||
|
|
||||||
/** Form initialisation hook. Fills widgets with data. */
|
/**
|
||||||
|
* Form initialisation hook. Fills widgets with data.
|
||||||
|
* @param fse
|
||||||
|
*/
|
||||||
|
@Override
|
||||||
public void init(FormSectionEvent fse) {
|
public void init(FormSectionEvent fse) {
|
||||||
SiteProxy site = (SiteProxy) super.initBasicWidgets(fse);
|
SiteProxy site = (SiteProxy) super.initBasicWidgets(fse);
|
||||||
|
|
||||||
|
|
@ -71,7 +77,11 @@ public class SiteProxyPropertyForm extends BasicPageForm
|
||||||
site.getURL());
|
site.getURL());
|
||||||
}
|
}
|
||||||
|
|
||||||
/** Form processing hook. Saves SiteProxy object. */
|
/**
|
||||||
|
* Form processing hook. Saves SiteProxy object.
|
||||||
|
* @param fse
|
||||||
|
*/
|
||||||
|
@Override
|
||||||
public void process(FormSectionEvent fse) {
|
public void process(FormSectionEvent fse) {
|
||||||
SiteProxy site = (SiteProxy) super.processBasicWidgets(fse);
|
SiteProxy site = (SiteProxy) super.processBasicWidgets(fse);
|
||||||
|
|
||||||
|
|
|
||||||
|
|
@ -1,5 +1,5 @@
|
||||||
/*
|
/*
|
||||||
* Copyright (C) 2002-2004 Red Hat Inc. All Rights Reserved.
|
* Copyright (C) 2012 Univerity of Bremen. All Rights Reserved.
|
||||||
*
|
*
|
||||||
* This library is free software; you can redistribute it and/or
|
* This library is free software; you can redistribute it and/or
|
||||||
* modify it under the terms of the GNU Lesser General Public License
|
* modify it under the terms of the GNU Lesser General Public License
|
||||||
|
|
@ -44,6 +44,10 @@ import com.arsdigita.cms.contenttypes.Survey;
|
||||||
|
|
||||||
import com.arsdigita.cms.ui.authoring.BasicPageForm;
|
import com.arsdigita.cms.ui.authoring.BasicPageForm;
|
||||||
|
|
||||||
|
/**
|
||||||
|
*
|
||||||
|
*
|
||||||
|
*/
|
||||||
public class SurveyPropertiesForm extends BasicPageForm implements FormProcessListener, FormInitListener, FormSubmissionListener {
|
public class SurveyPropertiesForm extends BasicPageForm implements FormProcessListener, FormInitListener, FormSubmissionListener {
|
||||||
|
|
||||||
private SurveyPropertiesStep m_step;
|
private SurveyPropertiesStep m_step;
|
||||||
|
|
@ -81,52 +85,65 @@ public class SurveyPropertiesForm extends BasicPageForm implements FormProcessLi
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
public void addWidgets() {
|
public void addWidgets() {
|
||||||
|
|
||||||
super.addWidgets();
|
super.addWidgets();
|
||||||
|
|
||||||
add(new Label((String) SurveyGlobalizationUtil.globalize("cms.contenttypes.ui.survey.description").localize()));
|
|
||||||
ParameterModel descriptionParam = new StringParameter(DESCRIPTION);
|
ParameterModel descriptionParam = new StringParameter(DESCRIPTION);
|
||||||
descriptionParam.addParameterListener(new StringInRangeValidationListener(0, 4000));
|
descriptionParam.addParameterListener(new StringInRangeValidationListener(0, 4000));
|
||||||
TextArea description = new TextArea(descriptionParam);
|
TextArea description = new TextArea(descriptionParam);
|
||||||
|
description.setLabel(SurveyGlobalizationUtil
|
||||||
|
.globalize("cms.contenttypes.ui.survey.description"));
|
||||||
description.setRows(20);
|
description.setRows(20);
|
||||||
description.setCols(60);
|
description.setCols(60);
|
||||||
add(description);
|
add(description);
|
||||||
|
|
||||||
add(new Label((String) SurveyGlobalizationUtil.globalize("cms.contenttypes.ui.survey.start_date").localize()));
|
|
||||||
Date startDate = new Date(START_DATE);
|
Date startDate = new Date(START_DATE);
|
||||||
|
startDate.setLabel(SurveyGlobalizationUtil
|
||||||
|
.globalize("cms.contenttypes.ui.survey.start_date"));
|
||||||
add(startDate);
|
add(startDate);
|
||||||
|
|
||||||
add(new Label((String) SurveyGlobalizationUtil.globalize("cms.contenttypes.ui.survey.end_date").localize()));
|
|
||||||
Date endDate = new Date(END_DATE);
|
Date endDate = new Date(END_DATE);
|
||||||
|
endDate.setLabel(SurveyGlobalizationUtil
|
||||||
|
.globalize("cms.contenttypes.ui.survey.end_date"));
|
||||||
add(endDate);
|
add(endDate);
|
||||||
|
|
||||||
add(new Label((String) SurveyGlobalizationUtil.globalize("cms.contenttypes.ui.survey.should_quiz_responses_be_public").localize()));
|
|
||||||
ParameterModel responsesPublicParam = new BooleanParameter(RESPONSES_PUBLIC);
|
ParameterModel responsesPublicParam = new BooleanParameter(RESPONSES_PUBLIC);
|
||||||
responsesPublicParam.addParameterListener(new NotNullValidationListener());
|
responsesPublicParam.addParameterListener(new NotNullValidationListener());
|
||||||
RadioGroup responsesPublic = new RadioGroup(responsesPublicParam);
|
RadioGroup responsesPublic = new RadioGroup(responsesPublicParam);
|
||||||
Option rp1 = new Option("true", new Label((String) SurveyGlobalizationUtil.globalize("cms.contenttypes.ui.survey.Yes").localize()));
|
Option rp1 = new Option("true", new Label(SurveyGlobalizationUtil.globalize(
|
||||||
Option rp2 = new Option("false", new Label((String) SurveyGlobalizationUtil.globalize("cms.contenttypes.ui.survey.No").localize()));
|
"cms.contenttypes.ui.survey.Yes")));
|
||||||
|
Option rp2 = new Option("false", new Label(SurveyGlobalizationUtil.globalize(
|
||||||
|
"cms.contenttypes.ui.survey.No")));
|
||||||
|
responsesPublic.setLabel(SurveyGlobalizationUtil.globalize(
|
||||||
|
"cms.contenttypes.ui.survey.should_quiz_responses_be_public"));
|
||||||
responsesPublic.addOption(rp1);
|
responsesPublic.addOption(rp1);
|
||||||
responsesPublic.addOption(rp2);
|
responsesPublic.addOption(rp2);
|
||||||
add(responsesPublic);
|
add(responsesPublic);
|
||||||
|
|
||||||
add(new Label((String) SurveyGlobalizationUtil.globalize("cms.contenttypes.ui.survey.show_results_during_survey").localize()));
|
|
||||||
ParameterModel resultsDuringSurveyParam = new BooleanParameter(RESULTS_DURING_SURVEY);
|
ParameterModel resultsDuringSurveyParam = new BooleanParameter(RESULTS_DURING_SURVEY);
|
||||||
resultsDuringSurveyParam.addParameterListener(new NotNullValidationListener());
|
resultsDuringSurveyParam.addParameterListener(new NotNullValidationListener());
|
||||||
RadioGroup resultsDuringSurvey = new RadioGroup(resultsDuringSurveyParam);
|
RadioGroup resultsDuringSurvey = new RadioGroup(resultsDuringSurveyParam);
|
||||||
Option rds1 = new Option("true", new Label((String) SurveyGlobalizationUtil.globalize("cms.contenttypes.ui.survey.Yes").localize()));
|
Option rds1 = new Option("true", new Label(SurveyGlobalizationUtil.globalize(
|
||||||
Option rds2 = new Option("false", new Label((String) SurveyGlobalizationUtil.globalize("cms.contenttypes.ui.survey.No").localize()));
|
"cms.contenttypes.ui.survey.Yes")));
|
||||||
|
Option rds2 = new Option("false", new Label(SurveyGlobalizationUtil.globalize(
|
||||||
|
"cms.contenttypes.ui.survey.No")));
|
||||||
|
resultsDuringSurvey.setLabel(SurveyGlobalizationUtil.globalize(
|
||||||
|
"cms.contenttypes.ui.survey.show_results_during_survey"));
|
||||||
resultsDuringSurvey.addOption(rds1);
|
resultsDuringSurvey.addOption(rds1);
|
||||||
resultsDuringSurvey.addOption(rds2);
|
resultsDuringSurvey.addOption(rds2);
|
||||||
add(resultsDuringSurvey);
|
add(resultsDuringSurvey);
|
||||||
|
|
||||||
add(new Label((String) SurveyGlobalizationUtil.globalize("cms.contenttypes.ui.survey.should_quiz_responses_be_anonym").localize()));
|
|
||||||
ParameterModel responsesAnonymParam = new BooleanParameter(RESPONSES_ANONYM);
|
ParameterModel responsesAnonymParam = new BooleanParameter(RESPONSES_ANONYM);
|
||||||
responsesAnonymParam.addParameterListener(new NotNullValidationListener());
|
responsesAnonymParam.addParameterListener(new NotNullValidationListener());
|
||||||
RadioGroup responsesAnonym = new RadioGroup(responsesAnonymParam);
|
RadioGroup responsesAnonym = new RadioGroup(responsesAnonymParam);
|
||||||
Option ra1 = new Option("true", new Label((String) SurveyGlobalizationUtil.globalize("cms.contenttypes.ui.survey.Yes").localize()));
|
Option ra1 = new Option("true", new Label(SurveyGlobalizationUtil.globalize(
|
||||||
Option ra2 = new Option("false", new Label((String) SurveyGlobalizationUtil.globalize("cms.contenttypes.ui.survey.No").localize()));
|
"cms.contenttypes.ui.survey.Yes")));
|
||||||
|
Option ra2 = new Option("false", new Label(SurveyGlobalizationUtil.globalize(
|
||||||
|
"cms.contenttypes.ui.survey.No")));
|
||||||
responsesAnonym.addOption(ra1);
|
responsesAnonym.addOption(ra1);
|
||||||
responsesAnonym.addOption(ra2);
|
responsesAnonym.addOption(ra2);
|
||||||
|
responsesAnonym.setLabel(SurveyGlobalizationUtil.globalize(
|
||||||
|
"cms.contenttypes.ui.survey.should_quiz_responses_be_anonym"));
|
||||||
add(responsesAnonym);
|
add(responsesAnonym);
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
@ -172,6 +189,7 @@ public class SurveyPropertiesForm extends BasicPageForm implements FormProcessLi
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
public void submitted(FormSectionEvent e) throws FormProcessException {
|
public void submitted(FormSectionEvent e) throws FormProcessException {
|
||||||
if ((m_step != null) && (getSaveCancelSection().getCancelButton().isSelected(e.getPageState()))) {
|
if ((m_step != null) && (getSaveCancelSection().getCancelButton().isSelected(e.getPageState()))) {
|
||||||
m_step.cancelStreamlinedCreation(e.getPageState());
|
m_step.cancelStreamlinedCreation(e.getPageState());
|
||||||
|
|
|
||||||
|
|
@ -65,11 +65,11 @@ public class XMLFeedProperties extends FormProperties {
|
||||||
super.addWidgets();
|
super.addWidgets();
|
||||||
|
|
||||||
m_url = new TextField(new StringParameter("url"));
|
m_url = new TextField(new StringParameter("url"));
|
||||||
|
m_url.setLabel(XMLFeedGlobalizationUtil.globalize(
|
||||||
|
"cms.contenttypes.ui.xmlfeed.feed_url"));
|
||||||
m_url.setHint(XMLFeedGlobalizationUtil.globalize(
|
m_url.setHint(XMLFeedGlobalizationUtil.globalize(
|
||||||
"cms.contenttypes.ui.xmlfeed.feed_url_hint"));
|
"cms.contenttypes.ui.xmlfeed.feed_url_hint"));
|
||||||
m_url.setSize(50);
|
m_url.setSize(50);
|
||||||
add(new Label(XMLFeedGlobalizationUtil.globalize(
|
|
||||||
"cms.contenttypes.ui.xmlfeed.feed_url")));
|
|
||||||
add(m_url);
|
add(m_url);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
||||||
|
|
@ -27,149 +27,150 @@ import com.arsdigita.web.Web;
|
||||||
* @author Peter Kopunec
|
* @author Peter Kopunec
|
||||||
*/
|
*/
|
||||||
public class WebLogEditForm extends Form implements FormInitListener,
|
public class WebLogEditForm extends Form implements FormInitListener,
|
||||||
FormValidationListener, FormProcessListener {
|
FormValidationListener,
|
||||||
|
FormProcessListener {
|
||||||
|
|
||||||
private static final String NAME_TITLE = "title";
|
private static final String NAME_TITLE = "title";
|
||||||
|
|
||||||
private static final String NAME_LEAD = "lead";
|
private static final String NAME_LEAD = "lead";
|
||||||
|
|
||||||
private static final String NAME_BODY = "body";
|
private static final String NAME_BODY = "body";
|
||||||
|
|
||||||
private final WebLogView m_parent;
|
private final WebLogView m_parent;
|
||||||
|
|
||||||
private Submit m_save;
|
private Submit m_save;
|
||||||
|
|
||||||
private final boolean m_createNew;
|
private final boolean m_createNew;
|
||||||
|
|
||||||
public WebLogEditForm(WebLogView parent, boolean createNew) {
|
public WebLogEditForm(WebLogView parent, boolean createNew) {
|
||||||
super("webLogEditForm");
|
|
||||||
m_parent = parent;
|
|
||||||
m_createNew = createNew;
|
|
||||||
|
|
||||||
setMethod("POST");
|
super("webLogEditForm");
|
||||||
|
|
||||||
add(new Label(GlobalizationUtil.localize("webLogEditForm.title")),
|
m_parent = parent;
|
||||||
BlockStylable.RIGHT | BlockStylable.TOP);
|
m_createNew = createNew;
|
||||||
add(new TextField(NAME_TITLE));
|
|
||||||
|
|
||||||
add(new Label(GlobalizationUtil.localize("webLogEditForm.lead")),
|
setMethod("POST");
|
||||||
BlockStylable.RIGHT | BlockStylable.TOP);
|
|
||||||
TextArea lead = new TextArea(NAME_LEAD);
|
|
||||||
lead.setCols(80);
|
|
||||||
lead.setRows(12);
|
|
||||||
add(lead);
|
|
||||||
|
|
||||||
add(new Label(GlobalizationUtil.localize("webLogEditForm.body")),
|
add(new Label(GlobalizationUtil.globalize("webLogEditForm.title")),
|
||||||
BlockStylable.RIGHT | BlockStylable.TOP);
|
BlockStylable.RIGHT | BlockStylable.TOP);
|
||||||
DHTMLEditor body = new DHTMLEditor(NAME_BODY);
|
add(new TextField(NAME_TITLE));
|
||||||
body.setCols(80);
|
|
||||||
body.setRows(20);
|
|
||||||
add(body);
|
|
||||||
|
|
||||||
add(new Label(""));
|
TextArea lead = new TextArea(NAME_LEAD);
|
||||||
SimpleContainer buttons = new SimpleContainer();
|
lead.setLabel(GlobalizationUtil.globalize("webLogEditForm.lead"));
|
||||||
m_save = new Submit(GlobalizationUtil.localize("saveButton"));
|
lead.setCols(80);
|
||||||
buttons.add(m_save);
|
lead.setRows(12);
|
||||||
buttons.add(new Submit(GlobalizationUtil.localize("cancelButton")));
|
add(lead);
|
||||||
add(buttons);
|
|
||||||
|
|
||||||
addInitListener(this);
|
DHTMLEditor body = new DHTMLEditor(NAME_BODY);
|
||||||
addValidationListener(this);
|
body.setLabel(GlobalizationUtil.globalize("webLogEditForm.body"));
|
||||||
addProcessListener(this);
|
body.setCols(80);
|
||||||
}
|
body.setRows(20);
|
||||||
|
add(body);
|
||||||
|
|
||||||
public void init(FormSectionEvent e) throws FormProcessException {
|
add(new Label(""));
|
||||||
if (!m_createNew) {
|
SimpleContainer buttons = new SimpleContainer();
|
||||||
BigDecimal enityID = m_parent.getEntityID(e.getPageState());
|
m_save = new Submit(GlobalizationUtil.globalize("saveButton"));
|
||||||
if (enityID != null) {
|
buttons.add(m_save);
|
||||||
WebLog entity = new WebLog(enityID);
|
buttons.add(new Submit(GlobalizationUtil.globalize("cancelButton")));
|
||||||
FormData data = e.getFormData();
|
add(buttons);
|
||||||
data.put(NAME_TITLE, entity.getTitle());
|
|
||||||
data.put(NAME_LEAD, entity.getLead());
|
|
||||||
data.put(NAME_BODY, entity.getBody());
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
public void validate(FormSectionEvent e) throws FormProcessException {
|
addInitListener(this);
|
||||||
if (m_save.isSelected(e.getPageState())) {
|
addValidationListener(this);
|
||||||
validate(e.getFormData());
|
addProcessListener(this);
|
||||||
}
|
}
|
||||||
}
|
|
||||||
|
|
||||||
private boolean validate(FormData data) {
|
public void init(FormSectionEvent e) throws FormProcessException {
|
||||||
if (!m_parent.canUserAdminApplication()) {
|
if (!m_createNew) {
|
||||||
data.addError("Insufficient rights");
|
BigDecimal enityID = m_parent.getEntityID(e.getPageState());
|
||||||
}
|
if (enityID != null) {
|
||||||
|
WebLog entity = new WebLog(enityID);
|
||||||
|
FormData data = e.getFormData();
|
||||||
|
data.put(NAME_TITLE, entity.getTitle());
|
||||||
|
data.put(NAME_LEAD, entity.getLead());
|
||||||
|
data.put(NAME_BODY, entity.getBody());
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
String title = (String) data.get(NAME_TITLE);
|
public void validate(FormSectionEvent e) throws FormProcessException {
|
||||||
if (title == null || title.length() == 0) {
|
if (m_save.isSelected(e.getPageState())) {
|
||||||
data.addError(NAME_TITLE, GlobalizationUtil
|
validate(e.getFormData());
|
||||||
.localize("error.parameterRequired"));
|
}
|
||||||
} else {
|
}
|
||||||
if (title.length() > 200) {
|
|
||||||
data.addError(NAME_TITLE, GlobalizationUtil
|
|
||||||
.localize("error.parameterSize200"));
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
String lead = (String) data.get(NAME_LEAD);
|
private boolean validate(FormData data) {
|
||||||
if (lead == null || lead.length() == 0) {
|
if (!m_parent.canUserAdminApplication()) {
|
||||||
data.addError(NAME_LEAD, GlobalizationUtil
|
data.addError("Insufficient rights");
|
||||||
.localize("error.parameterRequired"));
|
}
|
||||||
} else {
|
|
||||||
if (lead.length() > 4000) {
|
|
||||||
data.addError(NAME_LEAD, GlobalizationUtil
|
|
||||||
.localize("error.parameterSize4000"));
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
String body = (String) data.get(NAME_BODY);
|
String title = (String) data.get(NAME_TITLE);
|
||||||
if (body == null || body.length() == 0) {
|
if (title == null || title.length() == 0) {
|
||||||
data.addError(NAME_BODY, GlobalizationUtil
|
data.addError(NAME_TITLE, GlobalizationUtil
|
||||||
.localize("error.parameterRequired"));
|
.localize("error.parameterRequired"));
|
||||||
}
|
} else {
|
||||||
|
if (title.length() > 200) {
|
||||||
|
data.addError(NAME_TITLE, GlobalizationUtil
|
||||||
|
.localize("error.parameterSize200"));
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
return data.isValid();
|
String lead = (String) data.get(NAME_LEAD);
|
||||||
}
|
if (lead == null || lead.length() == 0) {
|
||||||
|
data.addError(NAME_LEAD, GlobalizationUtil
|
||||||
|
.localize("error.parameterRequired"));
|
||||||
|
} else {
|
||||||
|
if (lead.length() > 4000) {
|
||||||
|
data.addError(NAME_LEAD, GlobalizationUtil
|
||||||
|
.localize("error.parameterSize4000"));
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
public void process(FormSectionEvent e) throws FormProcessException {
|
String body = (String) data.get(NAME_BODY);
|
||||||
PageState ps = e.getPageState();
|
if (body == null || body.length() == 0) {
|
||||||
if (m_save.isSelected(ps)) {
|
data.addError(NAME_BODY, GlobalizationUtil
|
||||||
FormData data = e.getFormData();
|
.localize("error.parameterRequired"));
|
||||||
if (validate(data)) {
|
}
|
||||||
String title = (String) data.get(NAME_TITLE);
|
|
||||||
String lead = (String) data.get(NAME_LEAD);
|
|
||||||
String body = (String) data.get(NAME_BODY);
|
|
||||||
|
|
||||||
WebLog entity;
|
return data.isValid();
|
||||||
if (m_createNew) {
|
}
|
||||||
entity = new WebLog();
|
|
||||||
entity.setApplication((WebLogApplication) Web.getWebContext()
|
|
||||||
.getApplication());
|
|
||||||
entity.setOwner(Web.getWebContext().getUser());
|
|
||||||
} else {
|
|
||||||
BigDecimal enityID = (BigDecimal) m_parent
|
|
||||||
.getEntityIDParam().transformValue(
|
|
||||||
e.getPageState().getRequest());
|
|
||||||
entity = new WebLog(enityID);
|
|
||||||
}
|
|
||||||
entity.setTitle(title);
|
|
||||||
entity.setLead(lead);
|
|
||||||
entity.setBody(body);
|
|
||||||
entity.save();
|
|
||||||
processBack(ps);
|
|
||||||
}
|
|
||||||
} else {
|
|
||||||
processBack(ps);
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
protected WebLogView getParent() {
|
public void process(FormSectionEvent e) throws FormProcessException {
|
||||||
return m_parent;
|
PageState ps = e.getPageState();
|
||||||
}
|
if (m_save.isSelected(ps)) {
|
||||||
|
FormData data = e.getFormData();
|
||||||
|
if (validate(data)) {
|
||||||
|
String title = (String) data.get(NAME_TITLE);
|
||||||
|
String lead = (String) data.get(NAME_LEAD);
|
||||||
|
String body = (String) data.get(NAME_BODY);
|
||||||
|
|
||||||
protected void processBack(PageState ps) {
|
WebLog entity;
|
||||||
m_parent.displayWebLogsList(ps);
|
if (m_createNew) {
|
||||||
}
|
entity = new WebLog();
|
||||||
|
entity.setApplication((WebLogApplication) Web.getWebContext()
|
||||||
|
.getApplication());
|
||||||
|
entity.setOwner(Web.getWebContext().getUser());
|
||||||
|
} else {
|
||||||
|
BigDecimal enityID = (BigDecimal) m_parent
|
||||||
|
.getEntityIDParam().transformValue(
|
||||||
|
e.getPageState().getRequest());
|
||||||
|
entity = new WebLog(enityID);
|
||||||
|
}
|
||||||
|
entity.setTitle(title);
|
||||||
|
entity.setLead(lead);
|
||||||
|
entity.setBody(body);
|
||||||
|
entity.save();
|
||||||
|
processBack(ps);
|
||||||
|
}
|
||||||
|
} else {
|
||||||
|
processBack(ps);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
protected WebLogView getParent() {
|
||||||
|
return m_parent;
|
||||||
|
}
|
||||||
|
|
||||||
|
protected void processBack(PageState ps) {
|
||||||
|
m_parent.displayWebLogsList(ps);
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
|
||||||
Loading…
Reference in New Issue