Modified various forms to use the label attribute instead of Label widget to name an input field.
git-svn-id: https://svn.libreccm.org/ccm/trunk@2737 8810af33-2d31-482b-a856-94f89814c4dfmaster
parent
40f71ce13f
commit
550c37569b
|
|
@ -44,6 +44,7 @@ public class FileAttachmentModelBuilder extends AbstractTableModelBuilder {
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Constructor
|
* Constructor
|
||||||
|
* @param model
|
||||||
**/
|
**/
|
||||||
public FileAttachmentModelBuilder(ItemSelectionModel model) {
|
public FileAttachmentModelBuilder(ItemSelectionModel model) {
|
||||||
super();
|
super();
|
||||||
|
|
@ -51,14 +52,18 @@ public class FileAttachmentModelBuilder extends AbstractTableModelBuilder {
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
|
* @param table
|
||||||
|
* @param state
|
||||||
* @return a TableModel represented by the PageState
|
* @return a TableModel represented by the PageState
|
||||||
**/
|
**/
|
||||||
|
@Override
|
||||||
public TableModel makeModel(Table table, PageState state) {
|
public TableModel makeModel(Table table, PageState state) {
|
||||||
m_table = table;
|
m_table = table;
|
||||||
return new FileAttachmentTableModel(getDataCollection(state));
|
return new FileAttachmentTableModel(getDataCollection(state));
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
|
* @param state
|
||||||
* @return a data collection of Contacts
|
* @return a data collection of Contacts
|
||||||
**/
|
**/
|
||||||
public DataCollection getDataCollection(PageState state) {
|
public DataCollection getDataCollection(PageState state) {
|
||||||
|
|
@ -86,6 +91,7 @@ public class FileAttachmentModelBuilder extends AbstractTableModelBuilder {
|
||||||
/**
|
/**
|
||||||
* @return the number of columns in the table model
|
* @return the number of columns in the table model
|
||||||
**/
|
**/
|
||||||
|
@Override
|
||||||
public int getColumnCount() {
|
public int getColumnCount() {
|
||||||
return 1;
|
return 1;
|
||||||
}
|
}
|
||||||
|
|
@ -94,6 +100,7 @@ public class FileAttachmentModelBuilder extends AbstractTableModelBuilder {
|
||||||
* @return true if there is more rows in this table model and
|
* @return true if there is more rows in this table model and
|
||||||
* false otherwise
|
* false otherwise
|
||||||
**/
|
**/
|
||||||
|
@Override
|
||||||
public boolean nextRow() {
|
public boolean nextRow() {
|
||||||
if (_collection == null) {
|
if (_collection == null) {
|
||||||
return false;
|
return false;
|
||||||
|
|
@ -115,6 +122,7 @@ public class FileAttachmentModelBuilder extends AbstractTableModelBuilder {
|
||||||
* @return the Object for the specified column for the
|
* @return the Object for the specified column for the
|
||||||
* the current row
|
* the current row
|
||||||
**/
|
**/
|
||||||
|
@Override
|
||||||
public Object getElementAt(int columnIndex) {
|
public Object getElementAt(int columnIndex) {
|
||||||
if (columnIndex == 4) {
|
if (columnIndex == 4) {
|
||||||
if(FileAttachment.getConfig().isShowAssetIDEnabled()){
|
if(FileAttachment.getConfig().isShowAssetIDEnabled()){
|
||||||
|
|
@ -137,6 +145,7 @@ public class FileAttachmentModelBuilder extends AbstractTableModelBuilder {
|
||||||
/**
|
/**
|
||||||
* @returns the Object key for the specified column
|
* @returns the Object key for the specified column
|
||||||
**/
|
**/
|
||||||
|
@Override
|
||||||
public Object getKeyAt(int columnIndex) {
|
public Object getKeyAt(int columnIndex) {
|
||||||
return _file.getID().toString();
|
return _file.getID().toString();
|
||||||
}
|
}
|
||||||
|
|
|
||||||
|
|
@ -96,13 +96,7 @@ public class FileAttachmentsStep extends SecurityPropertyEditor {
|
||||||
// The upload form.
|
// The upload form.
|
||||||
m_uploadForm = new FileAttachmentUpload(m_item);
|
m_uploadForm = new FileAttachmentUpload(m_item);
|
||||||
add("upload",
|
add("upload",
|
||||||
// XXX todo: method add expects a plain string as label parameter. Use
|
FileAttachmentGlobalize.UploadNewFileLabel(),
|
||||||
// of tostring() is ugly and not supported API (for debugging only).
|
|
||||||
// add method has to be refactored to accept a GlobalizedMessage
|
|
||||||
// Parameter instead of a plain string for the Label (2. parameter) !
|
|
||||||
// It is uggly to make an additional localize() to get an object which
|
|
||||||
// can be casted to String!
|
|
||||||
(String)FileAttachmentGlobalize.UploadNewFileLabel().localize(),
|
|
||||||
new WorkflowLockedComponentAccess(m_uploadForm, m_item),
|
new WorkflowLockedComponentAccess(m_uploadForm, m_item),
|
||||||
m_uploadForm.getSaveCancelSection().getCancelButton());
|
m_uploadForm.getSaveCancelSection().getCancelButton());
|
||||||
|
|
||||||
|
|
|
||||||
|
|
@ -87,7 +87,9 @@ public class FileDescriptionForm extends FormSection implements
|
||||||
*
|
*
|
||||||
* @param e
|
* @param e
|
||||||
* the FormSectionEvent
|
* the FormSectionEvent
|
||||||
|
* @throws com.arsdigita.bebop.FormProcessException
|
||||||
*/
|
*/
|
||||||
|
@Override
|
||||||
public void submitted(FormSectionEvent e) throws FormProcessException {
|
public void submitted(FormSectionEvent e) throws FormProcessException {
|
||||||
if (m_cancel.isSelected(e.getPageState())) {
|
if (m_cancel.isSelected(e.getPageState())) {
|
||||||
m_fileModel.clearSelection(e.getPageState());
|
m_fileModel.clearSelection(e.getPageState());
|
||||||
|
|
@ -99,9 +101,10 @@ public class FileDescriptionForm extends FormSection implements
|
||||||
/**
|
/**
|
||||||
* Validation listener.
|
* Validation listener.
|
||||||
*
|
*
|
||||||
* @param event
|
* @param event the FormSectionEvent
|
||||||
* the FormSectionEvent
|
* @throws com.arsdigita.bebop.FormProcessException
|
||||||
*/
|
*/
|
||||||
|
@Override
|
||||||
public void validate(FormSectionEvent event) throws FormProcessException {
|
public void validate(FormSectionEvent event) throws FormProcessException {
|
||||||
PageState state = event.getPageState();
|
PageState state = event.getPageState();
|
||||||
FormData data = event.getFormData();
|
FormData data = event.getFormData();
|
||||||
|
|
@ -116,6 +119,7 @@ public class FileDescriptionForm extends FormSection implements
|
||||||
* @param fse
|
* @param fse
|
||||||
* the FormSectionEvent
|
* the FormSectionEvent
|
||||||
*/
|
*/
|
||||||
|
@Override
|
||||||
public void init(FormSectionEvent fse) throws FormProcessException {
|
public void init(FormSectionEvent fse) throws FormProcessException {
|
||||||
FormData data = fse.getFormData();
|
FormData data = fse.getFormData();
|
||||||
PageState state = fse.getPageState();
|
PageState state = fse.getPageState();
|
||||||
|
|
@ -133,7 +137,9 @@ public class FileDescriptionForm extends FormSection implements
|
||||||
*
|
*
|
||||||
* @param fse
|
* @param fse
|
||||||
* the FormSectionEvent
|
* the FormSectionEvent
|
||||||
|
* @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();
|
||||||
|
|
||||||
|
|
|
||||||
|
|
@ -97,78 +97,97 @@ public class AgendaPropertyForm extends BasicPageForm
|
||||||
protected void addWidgets() {
|
protected void addWidgets() {
|
||||||
super.addWidgets();
|
super.addWidgets();
|
||||||
|
|
||||||
add(new Label(AgendaGlobalizationUtil
|
// add(new Label(AgendaGlobalizationUtil
|
||||||
.globalize("cms.contenttypes.ui.summary")));
|
// .globalize("cms.contenttypes.ui.summary")));
|
||||||
ParameterModel summaryParam = new StringParameter(SUMMARY);
|
ParameterModel summaryParam = new StringParameter(SUMMARY);
|
||||||
//summaryParam
|
//summaryParam
|
||||||
// .addParameterListener(new NotNullValidationListener());
|
// .addParameterListener(new NotNullValidationListener());
|
||||||
summaryParam.addParameterListener(new StringInRangeValidationListener(0, 4000));
|
summaryParam.addParameterListener(new StringInRangeValidationListener(0, 4000));
|
||||||
TextArea summary = new TextArea(summaryParam);
|
TextArea summary = new TextArea(summaryParam);
|
||||||
|
summary.setLabel(AgendaGlobalizationUtil
|
||||||
|
.globalize("cms.contenttypes.ui.summary"));
|
||||||
summary.setCols(40);
|
summary.setCols(40);
|
||||||
summary.setRows(5);
|
summary.setRows(5);
|
||||||
summary.setHint(AgendaGlobalizationUtil.globalize(
|
summary.setHint(AgendaGlobalizationUtil.globalize(
|
||||||
"cms.contenttypes.ui.summary"));
|
"cms.contenttypes.ui.summary"));
|
||||||
add(summary);
|
add(summary);
|
||||||
|
|
||||||
add(new Label(AgendaGlobalizationUtil
|
// add(new Label(AgendaGlobalizationUtil
|
||||||
.globalize("cms.contenttypes.ui.agenda.agenda_date")));
|
// .globalize("cms.contenttypes.ui.agenda.agenda_date")));
|
||||||
ParameterModel agendaDateParam = new DateTimeParameter(AGENDA_DATE);
|
ParameterModel agendaDateParam = new DateTimeParameter(AGENDA_DATE);
|
||||||
agendaDateParam
|
agendaDateParam
|
||||||
.addParameterListener(new NotNullValidationListener());
|
.addParameterListener(new NotNullValidationListener());
|
||||||
DateTime agendaDate = new DateTime(agendaDateParam);
|
DateTime agendaDate = new DateTime(agendaDateParam);
|
||||||
|
agendaDate.setLabel(AgendaGlobalizationUtil
|
||||||
|
.globalize("cms.contenttypes.ui.agenda.agenda_date"));
|
||||||
add(agendaDate);
|
add(agendaDate);
|
||||||
|
|
||||||
add(new Label(AgendaGlobalizationUtil
|
/* Input field for Location */
|
||||||
.globalize("cms.contenttypes.ui.agenda.location")));
|
// add(new Label(AgendaGlobalizationUtil
|
||||||
|
// .globalize("cms.contenttypes.ui.agenda.location")));
|
||||||
ParameterModel locationParam = new StringParameter(LOCATION);
|
ParameterModel locationParam = new StringParameter(LOCATION);
|
||||||
//locationParam
|
//locationParam
|
||||||
// .addParameterListener(new NotNullValidationListener());
|
// .addParameterListener(new NotNullValidationListener());
|
||||||
locationParam.addParameterListener(new StringInRangeValidationListener(0, 1000));
|
locationParam.addParameterListener(new StringInRangeValidationListener(0, 1000));
|
||||||
TextArea location = new TextArea(locationParam);
|
TextArea location = new TextArea(locationParam);
|
||||||
|
location.setLabel(AgendaGlobalizationUtil
|
||||||
|
.globalize("cms.contenttypes.ui.agenda.location"));
|
||||||
location.setCols(40);
|
location.setCols(40);
|
||||||
location.setRows(3);
|
location.setRows(3);
|
||||||
add(location);
|
add(location);
|
||||||
|
|
||||||
add(new Label(AgendaGlobalizationUtil
|
/* Input field for Attendees */
|
||||||
.globalize("cms.contenttypes.ui.agenda.attendees")));
|
// add(new Label(AgendaGlobalizationUtil
|
||||||
|
// .globalize("cms.contenttypes.ui.agenda.attendees")));
|
||||||
ParameterModel attendeesParam = new StringParameter(ATTENDEES);
|
ParameterModel attendeesParam = new StringParameter(ATTENDEES);
|
||||||
//attendeesParam
|
//attendeesParam
|
||||||
// .addParameterListener(new NotNullValidationListener());
|
// .addParameterListener(new NotNullValidationListener());
|
||||||
attendeesParam.addParameterListener(new StringInRangeValidationListener(0, 1000));
|
attendeesParam.addParameterListener(new StringInRangeValidationListener(0, 1000));
|
||||||
TextArea attendees = new TextArea(attendeesParam);
|
TextArea attendees = new TextArea(attendeesParam);
|
||||||
|
attendees.setLabel(AgendaGlobalizationUtil
|
||||||
|
.globalize("cms.contenttypes.ui.agenda.attendees"));
|
||||||
attendees.setCols(40);
|
attendees.setCols(40);
|
||||||
attendees.setRows(3);
|
attendees.setRows(3);
|
||||||
add(attendees);
|
add(attendees);
|
||||||
|
|
||||||
add(new Label(AgendaGlobalizationUtil
|
/* Input field for Subject Items */
|
||||||
.globalize("cms.contenttypes.ui.agenda.subject_items")));
|
// add(new Label(AgendaGlobalizationUtil
|
||||||
|
// .globalize("cms.contenttypes.ui.agenda.subject_items")));
|
||||||
ParameterModel subjectItemsParam = new StringParameter(SUBJECT_ITEMS);
|
ParameterModel subjectItemsParam = new StringParameter(SUBJECT_ITEMS);
|
||||||
//subjectItemsParam
|
//subjectItemsParam
|
||||||
// .addParameterListener(new NotNullValidationListener());
|
// .addParameterListener(new NotNullValidationListener());
|
||||||
subjectItemsParam.addParameterListener(new StringInRangeValidationListener(0, 1000));
|
subjectItemsParam.addParameterListener(new StringInRangeValidationListener(0, 1000));
|
||||||
TextArea subjectItems = new TextArea(subjectItemsParam);
|
TextArea subjectItems = new TextArea(subjectItemsParam);
|
||||||
|
subjectItems.setLabel(AgendaGlobalizationUtil
|
||||||
|
.globalize("cms.contenttypes.ui.agenda.subject_items"));
|
||||||
subjectItems.setCols(40);
|
subjectItems.setCols(40);
|
||||||
subjectItems.setRows(3);
|
subjectItems.setRows(3);
|
||||||
add(subjectItems);
|
add(subjectItems);
|
||||||
|
|
||||||
add(new Label(AgendaGlobalizationUtil
|
/* Input field for Contact Info */
|
||||||
.globalize("cms.contenttypes.ui.agenda.contact_info")));
|
// add(new Label(AgendaGlobalizationUtil
|
||||||
|
// .globalize("cms.contenttypes.ui.agenda.contact_info")));
|
||||||
ParameterModel contactInfoParam = new StringParameter(CONTACT_INFO);
|
ParameterModel contactInfoParam = new StringParameter(CONTACT_INFO);
|
||||||
//contactInfoParam
|
//contactInfoParam
|
||||||
// .addParameterListener(new NotNullValidationListener());
|
// .addParameterListener(new NotNullValidationListener());
|
||||||
contactInfoParam.addParameterListener(new StringInRangeValidationListener(0, 1000));
|
contactInfoParam.addParameterListener(new StringInRangeValidationListener(0, 1000));
|
||||||
TextArea contactInfo = new TextArea(contactInfoParam);
|
TextArea contactInfo = new TextArea(contactInfoParam);
|
||||||
|
contactInfo.setLabel(AgendaGlobalizationUtil
|
||||||
|
.globalize("cms.contenttypes.ui.agenda.contact_info"));
|
||||||
contactInfo.setCols(40);
|
contactInfo.setCols(40);
|
||||||
contactInfo.setRows(3);
|
contactInfo.setRows(3);
|
||||||
add(contactInfo);
|
add(contactInfo);
|
||||||
|
|
||||||
add(new Label(AgendaGlobalizationUtil
|
/* Input field for Contact Info */
|
||||||
.globalize("cms.contenttypes.ui.agenda.creation_date")));
|
// add(new Label(AgendaGlobalizationUtil
|
||||||
|
// .globalize("cms.contenttypes.ui.agenda.creation_date")));
|
||||||
ParameterModel creationDateParam = new DateParameter(CREATION_DATE);
|
ParameterModel creationDateParam = new DateParameter(CREATION_DATE);
|
||||||
creationDateParam
|
creationDateParam
|
||||||
.addParameterListener(new NotNullValidationListener());
|
.addParameterListener(new NotNullValidationListener());
|
||||||
com.arsdigita.bebop.form.Date creationDate
|
com.arsdigita.bebop.form.Date creationDate
|
||||||
= new com.arsdigita.bebop.form.Date(creationDateParam);
|
= new com.arsdigita.bebop.form.Date(creationDateParam);
|
||||||
|
creationDate.setLabel(AgendaGlobalizationUtil
|
||||||
|
.globalize("cms.contenttypes.ui.agenda.creation_date"));
|
||||||
add(creationDate);
|
add(creationDate);
|
||||||
|
|
||||||
|
|
||||||
|
|
@ -176,7 +195,9 @@ public class AgendaPropertyForm 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();
|
||||||
Agenda agenda = (Agenda) super.initBasicWidgets(fse);
|
Agenda agenda = (Agenda) super.initBasicWidgets(fse);
|
||||||
|
|
@ -197,7 +218,9 @@ public class AgendaPropertyForm extends BasicPageForm
|
||||||
data.put(SUMMARY, agenda.getSummary());
|
data.put(SUMMARY, agenda.getSummary());
|
||||||
}
|
}
|
||||||
|
|
||||||
/** 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()
|
||||||
|
|
@ -207,8 +230,10 @@ public class AgendaPropertyForm extends BasicPageForm
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Form processing hook. Saves Agenda object.
|
* Form processing hook, saves Agenda 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.FormProcessException;
|
import com.arsdigita.bebop.FormProcessException;
|
||||||
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.FormSubmissionListener;
|
import com.arsdigita.bebop.event.FormSubmissionListener;
|
||||||
|
|
@ -78,24 +77,20 @@ public class ArticlePropertyForm extends GenericArticlePropertyForm
|
||||||
protected void addWidgets() {
|
protected void addWidgets() {
|
||||||
super.addWidgets();
|
super.addWidgets();
|
||||||
|
|
||||||
//add(new Label(GlobalizationUtil.globalize("cms.contenttypes.ui.lead")));
|
|
||||||
ParameterModel leadParam = new StringParameter(LEAD);
|
ParameterModel leadParam = new StringParameter(LEAD);
|
||||||
|
|
||||||
if (ContentSection.getConfig().mandatoryDescriptions()) {
|
if (ContentSection.getConfig().mandatoryDescriptions()) {
|
||||||
leadParam.addParameterListener(
|
leadParam.addParameterListener(
|
||||||
new NotEmptyValidationListener(
|
new NotEmptyValidationListener(
|
||||||
GlobalizationUtil.globalize(
|
GlobalizationUtil.globalize(
|
||||||
"cms.contenttypes.ui.description_missing")));
|
"cms.contenttypes.ui.description_missing")));
|
||||||
}
|
}
|
||||||
//leadParam
|
|
||||||
// .addParameterListener( new NotNullValidationListener() );
|
|
||||||
leadParam.addParameterListener(new StringInRangeValidationListener(0,
|
leadParam.addParameterListener(new StringInRangeValidationListener(0,
|
||||||
1000));
|
1000));
|
||||||
TextArea lead = new TextArea(leadParam);
|
TextArea lead = new TextArea(leadParam);
|
||||||
lead.setCols(40);
|
|
||||||
lead.setRows(5);
|
|
||||||
lead.setLabel(GlobalizationUtil.globalize("cms.contenttypes.ui.lead"));
|
lead.setLabel(GlobalizationUtil.globalize("cms.contenttypes.ui.lead"));
|
||||||
lead.setHint(GlobalizationUtil.globalize("cms.contenttypes.ui.lead_hint"));
|
lead.setHint(GlobalizationUtil.globalize("cms.contenttypes.ui.lead_hint"));
|
||||||
|
lead.setCols(40);
|
||||||
|
lead.setRows(5);
|
||||||
add(lead);
|
add(lead);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
||||||
|
|
@ -36,10 +36,12 @@ import com.arsdigita.cms.util.GlobalizationUtil;
|
||||||
import com.arsdigita.globalization.GlobalizedMessage;
|
import com.arsdigita.globalization.GlobalizedMessage;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* to edit BasicPageForm the basic properties of an Bookmark. This form can be extended to create forms for Bookmark
|
* to edit BasicPageForm the basic properties of an Bookmark. This form can be
|
||||||
* subclasses.
|
* extended to create forms for Bookmarksubclasses.
|
||||||
*/
|
*/
|
||||||
public class BookmarkPropertyForm extends BasicPageForm implements FormProcessListener, FormInitListener {
|
public class BookmarkPropertyForm extends BasicPageForm
|
||||||
|
implements FormProcessListener,
|
||||||
|
FormInitListener {
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* parameter names
|
* parameter names
|
||||||
|
|
@ -57,11 +59,15 @@ public class BookmarkPropertyForm extends BasicPageForm implements FormProcessLi
|
||||||
private final BookmarkPropertiesStep step;
|
private final BookmarkPropertiesStep step;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Creates a new form to edit the Bookmark object specified by the item selection model passed in.
|
* Creates a new form to edit the Bookmark object specified by the
|
||||||
|
* item selection model passed in.
|
||||||
*
|
*
|
||||||
* @param itemModel The ItemSelectionModel to use to obtain the Bookmark to work on
|
* @param itemModel The ItemSelectionModel to use to obtain the Bookmark
|
||||||
|
* to work on
|
||||||
|
* @param step
|
||||||
*/
|
*/
|
||||||
public BookmarkPropertyForm(final ItemSelectionModel itemModel, final BookmarkPropertiesStep step) {
|
public BookmarkPropertyForm(final ItemSelectionModel itemModel,
|
||||||
|
final BookmarkPropertiesStep step) {
|
||||||
super(ID, itemModel);
|
super(ID, itemModel);
|
||||||
this.step = step;
|
this.step = step;
|
||||||
}
|
}
|
||||||
|
|
@ -73,27 +79,33 @@ public class BookmarkPropertyForm extends BasicPageForm implements FormProcessLi
|
||||||
protected void addWidgets() {
|
protected void addWidgets() {
|
||||||
super.addWidgets();
|
super.addWidgets();
|
||||||
|
|
||||||
add(new Label(GlobalizationUtil.globalize(
|
//add(new Label(GlobalizationUtil.globalize(
|
||||||
"cms.contenttypes.ui.summary")));
|
// "cms.contenttypes.ui.summary")));
|
||||||
final ParameterModel descriptionParam = new StringParameter(DESCRIPTION);
|
final ParameterModel descriptionParam = new StringParameter(DESCRIPTION);
|
||||||
final TextArea description = new TextArea(descriptionParam);
|
final TextArea description = new TextArea(descriptionParam);
|
||||||
|
description.setLabel(GlobalizationUtil.globalize(
|
||||||
|
"cms.contenttypes.ui.summary"));
|
||||||
description.setCols(40);
|
description.setCols(40);
|
||||||
description.setRows(5);
|
description.setRows(5);
|
||||||
description.setHint(GlobalizationUtil.globalize(
|
description.setHint(GlobalizationUtil.globalize(
|
||||||
"cms.contenttypes.ui.summary_hint"));
|
"cms.contenttypes.ui.summary_hint"));
|
||||||
add(description);
|
add(description);
|
||||||
|
|
||||||
add(new Label(new GlobalizedMessage("cms.contenttypes.ui.bookmark.url", Bookmark.RESOURCES)));
|
// add(new Label(new GlobalizedMessage("cms.contenttypes.ui.bookmark.url", Bookmark.RESOURCES)));
|
||||||
final ParameterModel urlParam = new StringParameter(URL);
|
final ParameterModel urlParam = new StringParameter(URL);
|
||||||
final TextField url = new TextField(urlParam);
|
final TextField url = new TextField(urlParam);
|
||||||
|
url.setLabel(GlobalizationUtil.globalize(
|
||||||
|
"cms.contenttypes.ui.bookmark.url"));
|
||||||
url.setSize(40);
|
url.setSize(40);
|
||||||
add(url);
|
add(url);
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
|
* @param fse
|
||||||
* Form initialisation hook. Fills widgets with data.
|
* Form initialisation hook. Fills widgets with data.
|
||||||
*/
|
*/
|
||||||
|
@Override
|
||||||
public void init(final FormSectionEvent fse) {
|
public void init(final FormSectionEvent fse) {
|
||||||
final FormData data = fse.getFormData();
|
final FormData data = fse.getFormData();
|
||||||
final Bookmark item = (Bookmark) super.initBasicWidgets(fse);
|
final Bookmark item = (Bookmark) super.initBasicWidgets(fse);
|
||||||
|
|
@ -104,7 +116,9 @@ public class BookmarkPropertyForm extends BasicPageForm implements FormProcessLi
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Form processing hook. Saves Bookmark object.
|
* Form processing hook. Saves Bookmark object.
|
||||||
|
* @param fse
|
||||||
*/
|
*/
|
||||||
|
@Override
|
||||||
public void process(final FormSectionEvent fse) {
|
public void process(final FormSectionEvent fse) {
|
||||||
final FormData data = fse.getFormData();
|
final FormData data = fse.getFormData();
|
||||||
|
|
||||||
|
|
|
||||||
|
|
@ -89,7 +89,7 @@ public class DecisionTreeOptionEditForm extends Form
|
||||||
/**
|
/**
|
||||||
* Constructor.
|
* Constructor.
|
||||||
*
|
*
|
||||||
* @param selArticle the current article
|
* @param selTree the current decision tree
|
||||||
* @param selOption the current section
|
* @param selOption the current section
|
||||||
* @param container container which this form is added to
|
* @param container container which this form is added to
|
||||||
*/
|
*/
|
||||||
|
|
@ -133,6 +133,7 @@ public class DecisionTreeOptionEditForm extends Form
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Returns the save/cancel section from this form.
|
* Returns the save/cancel section from this form.
|
||||||
|
* @return
|
||||||
*/
|
*/
|
||||||
public SaveCancelSection getSaveCancelSection() {
|
public SaveCancelSection getSaveCancelSection() {
|
||||||
return m_saveCancelSection;
|
return m_saveCancelSection;
|
||||||
|
|
@ -161,7 +162,9 @@ public class DecisionTreeOptionEditForm extends Form
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Form initialisation hook.
|
* Form initialisation hook.
|
||||||
|
* @param fse
|
||||||
*/
|
*/
|
||||||
|
@Override
|
||||||
public void init(FormSectionEvent fse) {
|
public void init(FormSectionEvent fse) {
|
||||||
PageState state = fse.getPageState();
|
PageState state = fse.getPageState();
|
||||||
FormData data = fse.getFormData();
|
FormData data = fse.getFormData();
|
||||||
|
|
@ -205,27 +208,34 @@ public class DecisionTreeOptionEditForm extends Form
|
||||||
|
|
||||||
add(m_sectionWidget);
|
add(m_sectionWidget);
|
||||||
|
|
||||||
add(new Label(DecisionTreeGlobalizationUtil.globalize(
|
// add(new Label(DecisionTreeGlobalizationUtil.globalize(
|
||||||
"cms.contenttypes.ui.decisiontree.options.form.label")));
|
// "cms.contenttypes.ui.decisiontree.options.form.label")));
|
||||||
TextField labelWidget = new TextField(new TrimmedStringParameter(LABEL));
|
TextField labelWidget = new TextField(new TrimmedStringParameter(LABEL));
|
||||||
|
labelWidget.setLabel(DecisionTreeGlobalizationUtil.globalize(
|
||||||
|
"cms.contenttypes.ui.decisiontree.options.form.label"));
|
||||||
labelWidget.addValidationListener(new NotNullValidationListener());
|
labelWidget.addValidationListener(new NotNullValidationListener());
|
||||||
labelWidget.setSize(60);
|
labelWidget.setSize(60);
|
||||||
add(labelWidget);
|
add(labelWidget);
|
||||||
|
|
||||||
add(new Label(DecisionTreeGlobalizationUtil.globalize(
|
// add(new Label(DecisionTreeGlobalizationUtil.globalize(
|
||||||
"cms.contenttypes.ui.decisiontree.options.form.value")));
|
// "cms.contenttypes.ui.decisiontree.options.form.value")));
|
||||||
TextField valueWidget = new TextField(new TrimmedStringParameter(VALUE));
|
TextField valueWidget = new TextField(new TrimmedStringParameter(VALUE));
|
||||||
|
valueWidget.setLabel(DecisionTreeGlobalizationUtil.globalize(
|
||||||
|
"cms.contenttypes.ui.decisiontree.options.form.value"));
|
||||||
valueWidget.addValidationListener(new NotNullValidationListener());
|
valueWidget.addValidationListener(new NotNullValidationListener());
|
||||||
valueWidget.setSize(60);
|
valueWidget.setSize(60);
|
||||||
add(valueWidget);
|
add(valueWidget);
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
|
* @param event
|
||||||
|
* @throws com.arsdigita.bebop.FormProcessException
|
||||||
* Called on form submission. Check to see if the user clicked the
|
* Called on form submission. Check to see if the user clicked the
|
||||||
* cancel button. If they did, don't continue with the form.
|
* cancel button. If they did, don't continue with the form.
|
||||||
*/
|
*/
|
||||||
|
@Override
|
||||||
public void submitted(FormSectionEvent event)
|
public void submitted(FormSectionEvent event)
|
||||||
throws FormProcessException {
|
throws FormProcessException {
|
||||||
PageState state = event.getPageState();
|
PageState state = event.getPageState();
|
||||||
|
|
||||||
if ( m_saveCancelSection.getCancelButton()
|
if ( m_saveCancelSection.getCancelButton()
|
||||||
|
|
@ -234,23 +244,27 @@ public class DecisionTreeOptionEditForm extends Form
|
||||||
state, DecisionTreeOptionStep.OPTION_TABLE +
|
state, DecisionTreeOptionStep.OPTION_TABLE +
|
||||||
m_container.getTypeIDStr());
|
m_container.getTypeIDStr());
|
||||||
throw new FormProcessException(
|
throw new FormProcessException(
|
||||||
(String)DecisionTreeGlobalizationUtil.globalize(
|
DecisionTreeGlobalizationUtil.globalize(
|
||||||
"cms.contenttypes.ui.decisiontree.options.form.submission_cancelled")
|
"cms.contenttypes.ui.decisiontree.options.form.submission_cancelled")
|
||||||
.localize());
|
);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Called after form has been validated. Create the new SectionOption and
|
* Called after form has been validated. Create the new SectionOption and
|
||||||
* assign it to the current DecisionTree.
|
* assign it to the current DecisionTree.
|
||||||
|
*
|
||||||
|
* @param event
|
||||||
|
* @throws com.arsdigita.bebop.FormProcessException
|
||||||
*/
|
*/
|
||||||
|
@Override
|
||||||
public void process(FormSectionEvent event) throws FormProcessException {
|
public void process(FormSectionEvent event) throws FormProcessException {
|
||||||
PageState state = event.getPageState();
|
PageState state = event.getPageState();
|
||||||
FormData data = event.getFormData();
|
FormData data = event.getFormData();
|
||||||
|
|
||||||
DecisionTreeSection section = new DecisionTreeSection(new BigDecimal((String)data.get(SECTION)));
|
DecisionTreeSection section = new DecisionTreeSection(new BigDecimal((String)data.get(SECTION)));
|
||||||
|
|
||||||
DecisionTreeSectionOption option = null;
|
DecisionTreeSectionOption option;
|
||||||
if (m_selOption.getSelectedKey(state) != null) {
|
if (m_selOption.getSelectedKey(state) != null) {
|
||||||
BigDecimal id = new BigDecimal(m_selOption
|
BigDecimal id = new BigDecimal(m_selOption
|
||||||
.getSelectedKey(state).toString());
|
.getSelectedKey(state).toString());
|
||||||
|
|
|
||||||
|
|
@ -19,7 +19,6 @@
|
||||||
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.PageState;
|
import com.arsdigita.bebop.PageState;
|
||||||
import com.arsdigita.bebop.event.FormInitListener;
|
import com.arsdigita.bebop.event.FormInitListener;
|
||||||
import com.arsdigita.bebop.event.FormProcessListener;
|
import com.arsdigita.bebop.event.FormProcessListener;
|
||||||
|
|
@ -43,11 +42,11 @@ import com.arsdigita.cms.ui.authoring.BasicPageForm;
|
||||||
public class DecisionTreePropertiesForm extends BasicPageForm implements
|
public class DecisionTreePropertiesForm extends BasicPageForm implements
|
||||||
FormProcessListener, FormInitListener, FormSubmissionListener {
|
FormProcessListener, FormInitListener, FormSubmissionListener {
|
||||||
|
|
||||||
private final static String ID = "FORM_PROPERTIES";
|
private final static String ID = "FORM_PROPERTIES";
|
||||||
public final static String DESCRIPTION = "description";
|
public final static String DESCRIPTION = "description";
|
||||||
public final static String CANCEL_URL = "cancelURL";
|
public final static String CANCEL_URL = "cancelURL";
|
||||||
|
|
||||||
private DecisionTreePropertiesStep m_step;
|
private final DecisionTreePropertiesStep m_step;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Creates a new form to edit the Consultation object specified by the item
|
* Creates a new form to edit the Consultation object specified by the item
|
||||||
|
|
@ -69,22 +68,30 @@ public class DecisionTreePropertiesForm extends BasicPageForm implements
|
||||||
protected void addWidgets() {
|
protected void addWidgets() {
|
||||||
super.addWidgets();
|
super.addWidgets();
|
||||||
|
|
||||||
add(new Label(DecisionTreeGlobalizationUtil.globalize(
|
// add(new Label(DecisionTreeGlobalizationUtil.globalize(
|
||||||
"cms.contenttypes.ui.decisiontree.properties.form.description_label")));
|
// "cms.contenttypes.ui.decisiontree.properties.form.description_label")));
|
||||||
|
|
||||||
TextArea description = new TextArea(new TrimmedStringParameter(DESCRIPTION));
|
TextArea description = new TextArea(new TrimmedStringParameter(DESCRIPTION));
|
||||||
|
description.setLabel(DecisionTreeGlobalizationUtil.globalize(
|
||||||
|
"cms.contenttypes.ui.decisiontree.properties.form.description_label"));
|
||||||
description.setRows(5);
|
description.setRows(5);
|
||||||
description.setCols(30);
|
description.setCols(30);
|
||||||
add(description);
|
add(description);
|
||||||
|
|
||||||
add(new Label(DecisionTreeGlobalizationUtil.globalize
|
// add(new Label(DecisionTreeGlobalizationUtil.globalize
|
||||||
("cms.contenttypes.ui.decisiontree.properties.cancel_url")));
|
// ("cms.contenttypes.ui.decisiontree.properties.cancel_url")));
|
||||||
TextField cancelURL = new TextField(new StringParameter(CANCEL_URL));
|
TextField cancelURL = new TextField(new StringParameter(CANCEL_URL));
|
||||||
|
cancelURL.setLabel(DecisionTreeGlobalizationUtil.globalize
|
||||||
|
("cms.contenttypes.ui.decisiontree.properties.cancel_url"));
|
||||||
cancelURL.setSize(60);
|
cancelURL.setSize(60);
|
||||||
add(cancelURL);
|
add(cancelURL);
|
||||||
}
|
}
|
||||||
|
|
||||||
/** Cancels streamlined editing. */
|
/**
|
||||||
|
* Cancels streamlined editing.
|
||||||
|
* @param fse
|
||||||
|
*/
|
||||||
|
@Override
|
||||||
public void submitted(FormSectionEvent fse) {
|
public void submitted(FormSectionEvent fse) {
|
||||||
PageState state = fse.getPageState();
|
PageState state = fse.getPageState();
|
||||||
|
|
||||||
|
|
@ -94,7 +101,11 @@ public class DecisionTreePropertiesForm extends BasicPageForm implements
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
/** Form processing hook. Saves Event object. */
|
/**
|
||||||
|
* Form processing hook. Saves Event object.
|
||||||
|
* @param fse
|
||||||
|
*/
|
||||||
|
@Override
|
||||||
public void process(FormSectionEvent fse) {
|
public void process(FormSectionEvent fse) {
|
||||||
PageState state = fse.getPageState();
|
PageState state = fse.getPageState();
|
||||||
FormData data = fse.getFormData();
|
FormData data = fse.getFormData();
|
||||||
|
|
@ -108,7 +119,11 @@ public class DecisionTreePropertiesForm extends BasicPageForm implements
|
||||||
m_step.maybeForwardToNextStep(state);
|
m_step.maybeForwardToNextStep(state);
|
||||||
}
|
}
|
||||||
|
|
||||||
/** 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) {
|
||||||
DecisionTree item = (DecisionTree)initBasicWidgets(fse);
|
DecisionTree item = (DecisionTree)initBasicWidgets(fse);
|
||||||
|
|
||||||
|
|
|
||||||
|
|
@ -109,6 +109,7 @@ public class DecisionTreeSectionDeleteForm extends Form
|
||||||
* @param event
|
* @param event
|
||||||
* @throws FormProcessException
|
* @throws FormProcessException
|
||||||
*/
|
*/
|
||||||
|
@Override
|
||||||
public void init ( FormSectionEvent event ) throws FormProcessException {
|
public void init ( FormSectionEvent event ) throws FormProcessException {
|
||||||
|
|
||||||
String sectionTitle = " ";
|
String sectionTitle = " ";
|
||||||
|
|
@ -127,17 +128,19 @@ public class DecisionTreeSectionDeleteForm extends Form
|
||||||
m_sectionNameValue[0] = sectionTitle;
|
m_sectionNameValue[0] = sectionTitle;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
public void submitted ( FormSectionEvent event ) throws FormProcessException {
|
public void submitted ( FormSectionEvent event ) throws FormProcessException {
|
||||||
PageState state = event.getPageState();
|
PageState state = event.getPageState();
|
||||||
|
|
||||||
if ( m_saveCancelSection.getCancelButton().isSelected(state) ) {
|
if ( m_saveCancelSection.getCancelButton().isSelected(state) ) {
|
||||||
throw new FormProcessException( (String)
|
throw new FormProcessException(
|
||||||
DecisionTreeGlobalizationUtil.globalize(
|
DecisionTreeGlobalizationUtil.globalize(
|
||||||
"cms.contenttypes.ui.decisiontree.sections.form.submission_cancelled")
|
"cms.contenttypes.ui.decisiontree.sections.form.submission_cancelled")
|
||||||
.localize());
|
);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
public void process ( FormSectionEvent event ) throws FormProcessException {
|
public void process ( FormSectionEvent event ) throws FormProcessException {
|
||||||
PageState state = event.getPageState();
|
PageState state = event.getPageState();
|
||||||
|
|
||||||
|
|
|
||||||
|
|
@ -27,7 +27,6 @@ import com.arsdigita.bebop.ColumnPanel;
|
||||||
import com.arsdigita.bebop.Form;
|
import com.arsdigita.bebop.Form;
|
||||||
import com.arsdigita.bebop.FormData;
|
import com.arsdigita.bebop.FormData;
|
||||||
import com.arsdigita.bebop.FormProcessException;
|
import com.arsdigita.bebop.FormProcessException;
|
||||||
import com.arsdigita.bebop.Label;
|
|
||||||
import com.arsdigita.bebop.Page;
|
import com.arsdigita.bebop.Page;
|
||||||
import com.arsdigita.bebop.PageState;
|
import com.arsdigita.bebop.PageState;
|
||||||
import com.arsdigita.bebop.SaveCancelSection;
|
import com.arsdigita.bebop.SaveCancelSection;
|
||||||
|
|
@ -91,7 +90,7 @@ public class DecisionTreeSectionEditForm extends Form
|
||||||
/**
|
/**
|
||||||
* Constructor creates an emnpty section form.
|
* Constructor creates an emnpty section form.
|
||||||
*
|
*
|
||||||
* @param selArticle the current article
|
* @param selTree the current Decision Tree
|
||||||
* @param selSection the current section
|
* @param selSection the current section
|
||||||
* @param container container which this form is added to
|
* @param container container which this form is added to
|
||||||
*/
|
*/
|
||||||
|
|
@ -140,6 +139,8 @@ public class DecisionTreeSectionEditForm extends Form
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Returns the save/cancel section from this form.
|
* Returns the save/cancel section from this form.
|
||||||
|
*
|
||||||
|
* @return
|
||||||
*/
|
*/
|
||||||
public SaveCancelSection getSaveCancelSection() {
|
public SaveCancelSection getSaveCancelSection() {
|
||||||
return m_saveCancelSection;
|
return m_saveCancelSection;
|
||||||
|
|
@ -149,24 +150,30 @@ public class DecisionTreeSectionEditForm extends Form
|
||||||
* Add form widgets for a Section.
|
* Add form widgets for a Section.
|
||||||
*/
|
*/
|
||||||
protected void addWidgets() {
|
protected void addWidgets() {
|
||||||
add(new Label(DecisionTreeGlobalizationUtil.globalize(
|
// add(new Label(DecisionTreeGlobalizationUtil.globalize(
|
||||||
"cms.contenttypes.ui.decisiontree.sections.form.title_label")));
|
// "cms.contenttypes.ui.decisiontree.sections.form.title_label")));
|
||||||
TextField titleWidget = new TextField(new TrimmedStringParameter(TITLE));
|
TextField titleWidget = new TextField(new TrimmedStringParameter(TITLE));
|
||||||
|
titleWidget.setLabel(DecisionTreeGlobalizationUtil.globalize(
|
||||||
|
"cms.contenttypes.ui.decisiontree.sections.form.title_label"));
|
||||||
titleWidget.addValidationListener(new NotEmptyValidationListener());
|
titleWidget.addValidationListener(new NotEmptyValidationListener());
|
||||||
add(titleWidget);
|
add(titleWidget);
|
||||||
|
|
||||||
add(new Label(DecisionTreeGlobalizationUtil.globalize(
|
// add(new Label(DecisionTreeGlobalizationUtil.globalize(
|
||||||
"cms.contenttypes.ui.decisiontree.sections.form.parameter_name_label")));
|
// "cms.contenttypes.ui.decisiontree.sections.form.parameter_name_label")));
|
||||||
TextField parameterWidget = new TextField(new TrimmedStringParameter(PARAMETER_NAME));
|
TextField parameterWidget = new TextField(new TrimmedStringParameter(PARAMETER_NAME));
|
||||||
|
parameterWidget.setLabel(DecisionTreeGlobalizationUtil.globalize(
|
||||||
|
"cms.contenttypes.ui.decisiontree.sections.form.parameter_name_label"));
|
||||||
parameterWidget.addValidationListener(new NotEmptyValidationListener());
|
parameterWidget.addValidationListener(new NotEmptyValidationListener());
|
||||||
parameterWidget.addValidationListener(new DecisionTreeParameterNameValidationListener());
|
parameterWidget.addValidationListener(new DecisionTreeParameterNameValidationListener());
|
||||||
add(parameterWidget);
|
add(parameterWidget);
|
||||||
|
|
||||||
add(new Label(DecisionTreeGlobalizationUtil.globalize(
|
// add(new Label(DecisionTreeGlobalizationUtil.globalize(
|
||||||
"cms.contenttypes.ui.decisiontree.sections.form.instructions_label")),
|
// "cms.contenttypes.ui.decisiontree.sections.form.instructions_label")),
|
||||||
ColumnPanel.LEFT | ColumnPanel.FULL_WIDTH);
|
// ColumnPanel.LEFT | ColumnPanel.FULL_WIDTH);
|
||||||
CMSDHTMLEditor textWidget =
|
CMSDHTMLEditor textWidget =
|
||||||
new CMSDHTMLEditor(new TrimmedStringParameter(INSTRUCTIONS));
|
new CMSDHTMLEditor(new TrimmedStringParameter(INSTRUCTIONS));
|
||||||
|
textWidget.setLabel(DecisionTreeGlobalizationUtil.globalize(
|
||||||
|
"cms.contenttypes.ui.decisiontree.sections.form.instructions_label"));
|
||||||
textWidget.setRows(40);
|
textWidget.setRows(40);
|
||||||
textWidget.setCols(70);
|
textWidget.setCols(70);
|
||||||
textWidget.setWrap(CMSDHTMLEditor.SOFT);
|
textWidget.setWrap(CMSDHTMLEditor.SOFT);
|
||||||
|
|
@ -178,9 +185,13 @@ public class DecisionTreeSectionEditForm extends Form
|
||||||
* Initialize the form. If there is a selected section, ie. this
|
* Initialize the form. If there is a selected section, ie. this
|
||||||
* is an 'edit' step rather than a 'create new' step, load the data
|
* is an 'edit' step rather than a 'create new' step, load the data
|
||||||
* into the form fields.
|
* into the form fields.
|
||||||
|
*
|
||||||
|
* @param event
|
||||||
|
* @throws com.arsdigita.bebop.FormProcessException
|
||||||
*/
|
*/
|
||||||
|
@Override
|
||||||
public void init( FormSectionEvent event )
|
public void init( FormSectionEvent event )
|
||||||
throws FormProcessException {
|
throws FormProcessException {
|
||||||
PageState state = event.getPageState();
|
PageState state = event.getPageState();
|
||||||
FormData data = event.getFormData();
|
FormData data = event.getFormData();
|
||||||
m_selInstructions.setSelectedObject(state,null);
|
m_selInstructions.setSelectedObject(state,null);
|
||||||
|
|
@ -211,9 +222,12 @@ public class DecisionTreeSectionEditForm extends Form
|
||||||
/**
|
/**
|
||||||
* Called on form submission. Check to see if the user clicked the
|
* Called on form submission. Check to see if the user clicked the
|
||||||
* cancel button. If they did, don't continue with the form.
|
* cancel button. If they did, don't continue with the form.
|
||||||
|
* @param event
|
||||||
|
* @throws com.arsdigita.bebop.FormProcessException
|
||||||
*/
|
*/
|
||||||
|
@Override
|
||||||
public void submitted( FormSectionEvent event )
|
public void submitted( FormSectionEvent event )
|
||||||
throws FormProcessException {
|
throws FormProcessException {
|
||||||
PageState state = event.getPageState();
|
PageState state = event.getPageState();
|
||||||
|
|
||||||
if ( m_saveCancelSection.getCancelButton()
|
if ( m_saveCancelSection.getCancelButton()
|
||||||
|
|
@ -222,18 +236,22 @@ public class DecisionTreeSectionEditForm extends Form
|
||||||
state, DecisionTreeSectionStep.SECTION_TABLE +
|
state, DecisionTreeSectionStep.SECTION_TABLE +
|
||||||
m_container.getTypeIDStr());
|
m_container.getTypeIDStr());
|
||||||
throw new FormProcessException(
|
throw new FormProcessException(
|
||||||
(String)DecisionTreeGlobalizationUtil.globalize(
|
DecisionTreeGlobalizationUtil.globalize(
|
||||||
"cms.contenttypes.ui.decisiontree.sections.form.submission_cancelled")
|
"cms.contenttypes.ui.decisiontree.sections.form.submission_cancelled")
|
||||||
.localize());
|
);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Called after form has been validated. Create the new TreeSection and
|
* Called after form has been validated. Create the new TreeSection and
|
||||||
* assign it to the current DecisionTree.
|
* assign it to the current DecisionTree.
|
||||||
|
*
|
||||||
|
* @param event
|
||||||
|
* @throws com.arsdigita.bebop.FormProcessException
|
||||||
*/
|
*/
|
||||||
|
@Override
|
||||||
public void process(FormSectionEvent event)
|
public void process(FormSectionEvent event)
|
||||||
throws FormProcessException {
|
throws FormProcessException {
|
||||||
PageState state = event.getPageState();
|
PageState state = event.getPageState();
|
||||||
FormData data = event.getFormData();
|
FormData data = event.getFormData();
|
||||||
|
|
||||||
|
|
@ -282,6 +300,10 @@ public class DecisionTreeSectionEditForm extends Form
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Utility method to create a Section from the form data supplied.
|
* Utility method to create a Section from the form data supplied.
|
||||||
|
*
|
||||||
|
* @param event
|
||||||
|
* @param tree
|
||||||
|
* @return
|
||||||
*/
|
*/
|
||||||
protected DecisionTreeSection createSection(FormSectionEvent event,
|
protected DecisionTreeSection createSection(FormSectionEvent event,
|
||||||
DecisionTree tree) {
|
DecisionTree tree) {
|
||||||
|
|
|
||||||
|
|
@ -50,6 +50,7 @@ import com.arsdigita.cms.contenttypes.DecisionTreeSection;
|
||||||
import com.arsdigita.cms.contenttypes.DecisionTreeSectionCollection;
|
import com.arsdigita.cms.contenttypes.DecisionTreeSectionCollection;
|
||||||
import com.arsdigita.cms.contenttypes.util.DecisionTreeGlobalizationUtil;
|
import com.arsdigita.cms.contenttypes.util.DecisionTreeGlobalizationUtil;
|
||||||
import com.arsdigita.cms.ItemSelectionModel;
|
import com.arsdigita.cms.ItemSelectionModel;
|
||||||
|
import com.arsdigita.globalization.GlobalizedMessage;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Form to edit an DecisionTreeOptionTarget for a DecisionTree.
|
* Form to edit an DecisionTreeOptionTarget for a DecisionTree.
|
||||||
|
|
@ -248,47 +249,50 @@ public class DecisionTreeTargetEditForm extends Form
|
||||||
new Label( DecisionTreeGlobalizationUtil.globalize(
|
new Label( DecisionTreeGlobalizationUtil.globalize(
|
||||||
"cms.contenttypes.ui.decisiontree.targets.form.none")));
|
"cms.contenttypes.ui.decisiontree.targets.form.none")));
|
||||||
|
|
||||||
add(new Label(DecisionTreeGlobalizationUtil.globalize(
|
// add(new Label(DecisionTreeGlobalizationUtil.globalize(
|
||||||
"cms.contenttypes.ui.decisiontree.targets.form.match_value")));
|
// "cms.contenttypes.ui.decisiontree.targets.form.match_value")));
|
||||||
m_matchValueWidget = new SingleSelect(MATCH_OPTION);
|
m_matchValueWidget = new SingleSelect(MATCH_OPTION);
|
||||||
|
m_matchValueWidget.setLabel(DecisionTreeGlobalizationUtil.globalize(
|
||||||
|
"cms.contenttypes.ui.decisiontree.targets.form.match_value"));
|
||||||
m_matchValueWidget.addValidationListener(new NotNullValidationListener());
|
m_matchValueWidget.addValidationListener(new NotNullValidationListener());
|
||||||
m_matchValueWidget.addOption(pleaseSelect);
|
m_matchValueWidget.addOption(pleaseSelect);
|
||||||
|
try {
|
||||||
try {
|
m_matchValueWidget.addPrintListener(new PrintListener() {
|
||||||
m_matchValueWidget.addPrintListener(new PrintListener() {
|
@Override
|
||||||
public void prepare(PrintEvent e) {
|
public void prepare(PrintEvent e) {
|
||||||
initMatchOptions(e);
|
initMatchOptions(e);
|
||||||
}
|
}
|
||||||
});
|
});
|
||||||
} catch (TooManyListenersException e) {
|
} catch (TooManyListenersException e) {
|
||||||
throw new RuntimeException(e);
|
throw new RuntimeException(e);
|
||||||
}
|
}
|
||||||
|
add(m_matchValueWidget);
|
||||||
|
|
||||||
add(m_matchValueWidget);
|
// add(new Label(DecisionTreeGlobalizationUtil.globalize(
|
||||||
|
// "cms.contenttypes.ui.decisiontree.targets.form.target_url_label")));
|
||||||
add(new Label(DecisionTreeGlobalizationUtil.globalize(
|
|
||||||
"cms.contenttypes.ui.decisiontree.targets.form.target_url_label")));
|
|
||||||
m_targetURLWidget = new TextField(TARGET_URL);
|
m_targetURLWidget = new TextField(TARGET_URL);
|
||||||
|
m_targetURLWidget.setLabel(DecisionTreeGlobalizationUtil.globalize(
|
||||||
|
"cms.contenttypes.ui.decisiontree.targets.form.target_url_label"));
|
||||||
m_targetURLWidget.setSize(60);
|
m_targetURLWidget.setSize(60);
|
||||||
add(m_targetURLWidget);
|
add(m_targetURLWidget);
|
||||||
|
|
||||||
add(new Label(DecisionTreeGlobalizationUtil.globalize(
|
// add(new Label(DecisionTreeGlobalizationUtil.globalize(
|
||||||
"cms.contenttypes.ui.decisiontree.targets.form.target_section_label")));
|
// "cms.contenttypes.ui.decisiontree.targets.form.target_section_label")));
|
||||||
m_targetSectionWidget = new SingleSelect(TARGET_SECTION);
|
m_targetSectionWidget = new SingleSelect(TARGET_SECTION);
|
||||||
|
m_targetSectionWidget.setLabel(DecisionTreeGlobalizationUtil.globalize(
|
||||||
|
"cms.contenttypes.ui.decisiontree.targets.form.target_section_label"));
|
||||||
m_targetSectionWidget.addOption(none);
|
m_targetSectionWidget.addOption(none);
|
||||||
|
try {
|
||||||
try {
|
m_targetSectionWidget.addPrintListener(new PrintListener() {
|
||||||
m_targetSectionWidget.addPrintListener(new PrintListener() {
|
|
||||||
@Override
|
@Override
|
||||||
public void prepare(PrintEvent e) {
|
public void prepare(PrintEvent e) {
|
||||||
initTargetOptions(e);
|
initTargetOptions(e);
|
||||||
}
|
}
|
||||||
});
|
});
|
||||||
} catch (TooManyListenersException e) {
|
} catch (TooManyListenersException e) {
|
||||||
throw new RuntimeException(e);
|
throw new RuntimeException(e);
|
||||||
}
|
}
|
||||||
|
add(m_targetSectionWidget);
|
||||||
add(m_targetSectionWidget);
|
|
||||||
|
|
||||||
addValidationListener(new FormValidationListener() {
|
addValidationListener(new FormValidationListener() {
|
||||||
@Override
|
@Override
|
||||||
|
|
@ -297,17 +301,15 @@ public class DecisionTreeTargetEditForm extends Form
|
||||||
final PageState state = event.getPageState();
|
final PageState state = event.getPageState();
|
||||||
if ("".equals(m_targetURLWidget.getValue(state))
|
if ("".equals(m_targetURLWidget.getValue(state))
|
||||||
&& "".equals(m_targetSectionWidget.getValue(state))) {
|
&& "".equals(m_targetSectionWidget.getValue(state))) {
|
||||||
String msg = (String) DecisionTreeGlobalizationUtil.globalize(
|
GlobalizedMessage msg = DecisionTreeGlobalizationUtil.globalize(
|
||||||
"cms.contenttypes.ui.decisiontree.targets.form.target_required")
|
"cms.contenttypes.ui.decisiontree.targets.form.target_required");
|
||||||
.localize();
|
|
||||||
throw new FormProcessException(msg);
|
throw new FormProcessException(msg);
|
||||||
}
|
}
|
||||||
|
|
||||||
if (!"".equals(m_targetURLWidget.getValue(state))
|
if (!"".equals(m_targetURLWidget.getValue(state))
|
||||||
&& !"".equals(m_targetSectionWidget.getValue(state))) {
|
&& !"".equals(m_targetSectionWidget.getValue(state))) {
|
||||||
String msg = (String) DecisionTreeGlobalizationUtil.globalize(
|
GlobalizedMessage msg = DecisionTreeGlobalizationUtil.globalize(
|
||||||
"cms.contenttypes.ui.decisiontree.targets.form.duplicate_target")
|
"cms.contenttypes.ui.decisiontree.targets.form.duplicate_target");
|
||||||
.localize();
|
|
||||||
throw new FormProcessException(msg);
|
throw new FormProcessException(msg);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
@ -325,21 +327,22 @@ public class DecisionTreeTargetEditForm extends Form
|
||||||
throws FormProcessException {
|
throws FormProcessException {
|
||||||
PageState state = event.getPageState();
|
PageState state = event.getPageState();
|
||||||
|
|
||||||
if ( m_saveCancelSection.getCancelButton()
|
if ( m_saveCancelSection.getCancelButton().isSelected(state)
|
||||||
.isSelected(state) && m_container != null) {
|
&& m_container != null) {
|
||||||
m_container.onlyShowComponent(
|
m_container.onlyShowComponent(state,
|
||||||
state, DecisionTreeTargetStep.TARGET_TABLE +
|
DecisionTreeTargetStep.TARGET_TABLE +
|
||||||
m_container.getTypeIDStr());
|
m_container.getTypeIDStr());
|
||||||
throw new FormProcessException(
|
throw new FormProcessException(
|
||||||
(String)DecisionTreeGlobalizationUtil.globalize(
|
DecisionTreeGlobalizationUtil.globalize(
|
||||||
"cms.contenttypes.ui.decisiontree.targets.form.submission_cancelled")
|
"cms.contenttypes.ui.decisiontree.targets.form.submission_cancelled")
|
||||||
.localize());
|
);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Called after form has been validated. Create the new
|
* Called after form has been validated. Create the new
|
||||||
* DecisionTreeOptionTarget and assign it to the current DecisionTree.
|
* DecisionTreeOptionTarget and assign it to the current DecisionTree.
|
||||||
|
*
|
||||||
* @param event
|
* @param event
|
||||||
* @throws com.arsdigita.bebop.FormProcessException
|
* @throws com.arsdigita.bebop.FormProcessException
|
||||||
*/
|
*/
|
||||||
|
|
@ -358,7 +361,7 @@ public class DecisionTreeTargetEditForm extends Form
|
||||||
targetSection = new DecisionTreeSection(new BigDecimal(sectionID));
|
targetSection = new DecisionTreeSection(new BigDecimal(sectionID));
|
||||||
}
|
}
|
||||||
|
|
||||||
DecisionTreeOptionTarget target = null;
|
DecisionTreeOptionTarget target;
|
||||||
if (m_selTarget.getSelectedKey(state) != null) {
|
if (m_selTarget.getSelectedKey(state) != null) {
|
||||||
BigDecimal id = new BigDecimal(m_selTarget
|
BigDecimal id = new BigDecimal(m_selTarget
|
||||||
.getSelectedKey(state).toString());
|
.getSelectedKey(state).toString());
|
||||||
|
|
|
||||||
|
|
@ -82,39 +82,49 @@ public class FAQItemPropertyForm 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(FAQGlobalizationUtil
|
// add( new Label(FAQGlobalizationUtil
|
||||||
.globalize("cms.contenttypes.ui.faq.question")) );
|
// .globalize("cms.contenttypes.ui.faq.question")) );
|
||||||
ParameterModel questionParam
|
ParameterModel questionParam
|
||||||
= new StringParameter( QUESTION );
|
= new StringParameter( QUESTION );
|
||||||
questionParam
|
questionParam
|
||||||
.addParameterListener( new NotNullValidationListener() );
|
.addParameterListener( new NotNullValidationListener() );
|
||||||
TextArea question = new TextArea( questionParam );
|
TextArea question = new TextArea( questionParam );
|
||||||
|
question.setLabel(FAQGlobalizationUtil
|
||||||
|
.globalize("cms.contenttypes.ui.faq.question"));
|
||||||
question.setCols( 40 );
|
question.setCols( 40 );
|
||||||
question.setRows( 5 );
|
question.setRows( 5 );
|
||||||
add( question );
|
add( question );
|
||||||
|
|
||||||
add( new Label(FAQGlobalizationUtil
|
// add( new Label(FAQGlobalizationUtil
|
||||||
.globalize("cms.contenttypes.ui.faq.answer")) );
|
// .globalize("cms.contenttypes.ui.faq.answer")) );
|
||||||
ParameterModel answerParam = new StringParameter( ANSWER );
|
ParameterModel answerParam = new StringParameter( ANSWER );
|
||||||
answerParam
|
answerParam.addParameterListener( new NotNullValidationListener() );
|
||||||
.addParameterListener( new NotNullValidationListener() );
|
|
||||||
TextArea answer = new TextArea( answerParam );
|
TextArea answer = new TextArea( answerParam );
|
||||||
|
answer.setLabel(FAQGlobalizationUtil
|
||||||
|
.globalize("cms.contenttypes.ui.faq.answer"));
|
||||||
answer.setCols( 40 );
|
answer.setCols( 40 );
|
||||||
answer.setRows( 5 );
|
answer.setRows( 5 );
|
||||||
add( answer );
|
add( answer );
|
||||||
|
|
||||||
add( new Label(FAQGlobalizationUtil
|
// add( new Label(FAQGlobalizationUtil
|
||||||
.globalize("cms.contenttypes.ui.faq.sectionName")) );
|
// .globalize("cms.contenttypes.ui.faq.sectionName")) );
|
||||||
ParameterModel sectionNameParam = new StringParameter( SECTION_NAME );
|
ParameterModel sectionNameParam = new StringParameter( SECTION_NAME );
|
||||||
TextField sectionName = new TextField(sectionNameParam);
|
TextField sectionName = new TextField(sectionNameParam);
|
||||||
|
sectionName.setLabel(FAQGlobalizationUtil
|
||||||
|
.globalize("cms.contenttypes.ui.faq.sectionName"));
|
||||||
add(sectionName);
|
add(sectionName);
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
/** 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();
|
||||||
FAQItem faqItem = (FAQItem) super.initBasicWidgets( fse );
|
FAQItem faqItem = (FAQItem) super.initBasicWidgets( fse );
|
||||||
|
|
@ -124,7 +134,12 @@ public class FAQItemPropertyForm extends BasicPageForm
|
||||||
data.put(SECTION_NAME , faqItem.getSectionName());
|
data.put(SECTION_NAME , faqItem.getSectionName());
|
||||||
}
|
}
|
||||||
|
|
||||||
/** 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()
|
||||||
|
|
@ -133,20 +148,22 @@ public class FAQItemPropertyForm extends BasicPageForm
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
/** Form processing hook. Saves FAQItem object. */
|
/**
|
||||||
|
* Form processing hook. Saves FAQItem object.
|
||||||
|
* @param fse */
|
||||||
|
@Override
|
||||||
public void process( FormSectionEvent fse ) {
|
public void process( FormSectionEvent fse ) {
|
||||||
FormData data = fse.getFormData();
|
FormData data = fse.getFormData();
|
||||||
|
|
||||||
FAQItem faqItem = (FAQItem) super.processBasicWidgets( fse );
|
FAQItem faqItem = (FAQItem) super.processBasicWidgets( fse );
|
||||||
|
|
||||||
// save only if save button was pressed
|
// save only if save button was pressed
|
||||||
if( faqItem != null
|
if( faqItem != null && getSaveCancelSection().getSaveButton()
|
||||||
&& getSaveCancelSection().getSaveButton()
|
.isSelected( fse.getPageState() ) ) {
|
||||||
.isSelected( fse.getPageState() ) ) {
|
faqItem.setQuestion( (String) data.get( QUESTION ) );
|
||||||
faqItem.setQuestion( (String) data.get( QUESTION ) );
|
faqItem.setAnswer( (String) data.get( ANSWER ) );
|
||||||
faqItem.setAnswer( (String) data.get( ANSWER ) );
|
faqItem.setSectionName( (String) data.get( SECTION_NAME) );
|
||||||
faqItem.setSectionName( (String) data.get( SECTION_NAME) );
|
faqItem.save();
|
||||||
faqItem.save();
|
|
||||||
}
|
}
|
||||||
if (m_step != null) {
|
if (m_step != null) {
|
||||||
m_step.maybeForwardToNextStep(fse.getPageState());
|
m_step.maybeForwardToNextStep(fse.getPageState());
|
||||||
|
|
|
||||||
|
|
@ -79,18 +79,23 @@ public class FileStorageItemPropertyForm
|
||||||
protected void addWidgets() {
|
protected void addWidgets() {
|
||||||
super.addWidgets();
|
super.addWidgets();
|
||||||
|
|
||||||
add( new Label( GlobalizationUtil.globalize("cms.contenttypes.ui.lead") ) );
|
// add( new Label( GlobalizationUtil.globalize("cms.contenttypes.ui.lead") ) );
|
||||||
ParameterModel descriptionParam
|
ParameterModel descriptionParam = new StringParameter( FileStorageItem
|
||||||
= new StringParameter( FileStorageItem.DESCRIPTION );
|
.DESCRIPTION );
|
||||||
// descriptionParam.addParameterListener( new NotNullValidationListener() );
|
// descriptionParam.addParameterListener( new NotNullValidationListener() );
|
||||||
CMSDHTMLEditor description = new CMSDHTMLEditor( descriptionParam );
|
CMSDHTMLEditor description = new CMSDHTMLEditor( descriptionParam );
|
||||||
|
description.setLabel(GlobalizationUtil.globalize("cms.contenttypes.ui.lead"));
|
||||||
description.setCols( 40 );
|
description.setCols( 40 );
|
||||||
description.setRows( 8 );
|
description.setRows( 8 );
|
||||||
add( description );
|
add( description );
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
/** 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();
|
||||||
FileStorageItem glossary_item
|
FileStorageItem glossary_item
|
||||||
|
|
@ -99,7 +104,11 @@ public class FileStorageItemPropertyForm
|
||||||
data.put( FileStorageItem.DESCRIPTION, glossary_item.getDescription() );
|
data.put( FileStorageItem.DESCRIPTION, glossary_item.getDescription() );
|
||||||
}
|
}
|
||||||
|
|
||||||
/** 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()
|
||||||
|
|
@ -108,7 +117,9 @@ public class FileStorageItemPropertyForm
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
/** Form processing hook. Saves FileStorageItem object. */
|
/** Form processing hook. Saves FileStorageItem object.
|
||||||
|
* @param fse */
|
||||||
|
@Override
|
||||||
public void process( FormSectionEvent fse ) {
|
public void process( FormSectionEvent fse ) {
|
||||||
FormData data = fse.getFormData();
|
FormData data = fse.getFormData();
|
||||||
|
|
||||||
|
|
|
||||||
|
|
@ -105,8 +105,8 @@ public class FormActions extends ProcessListenerEditor {
|
||||||
panel.setColumnWidth(2, "80%");
|
panel.setColumnWidth(2, "80%");
|
||||||
panel.setWidth("100%");
|
panel.setWidth("100%");
|
||||||
|
|
||||||
m_lrForm.add(new Label(FormItemGlobalizationUtil.globalize(
|
// m_lrForm.add(new Label(FormItemGlobalizationUtil.globalize(
|
||||||
"cms.contenttypes.ui.form_item.form_mode_label")) );
|
// "cms.contenttypes.ui.form_item.form_mode_label")) );
|
||||||
|
|
||||||
m_localRemote = new RadioGroup("remote");
|
m_localRemote = new RadioGroup("remote");
|
||||||
Option local = new Option(Boolean.FALSE.toString(),
|
Option local = new Option(Boolean.FALSE.toString(),
|
||||||
|
|
@ -118,9 +118,12 @@ public class FormActions extends ProcessListenerEditor {
|
||||||
"cms.contenttypes.ui.form_item.form_mode_remote")) );
|
"cms.contenttypes.ui.form_item.form_mode_remote")) );
|
||||||
m_localRemote.addOption(local);
|
m_localRemote.addOption(local);
|
||||||
m_localRemote.addOption(remote);
|
m_localRemote.addOption(remote);
|
||||||
|
m_localRemote.setLabel(FormItemGlobalizationUtil.globalize(
|
||||||
|
"cms.contenttypes.ui.form_item.form_mode_label"));
|
||||||
m_localRemote.setLayout(RadioGroup.VERTICAL);
|
m_localRemote.setLayout(RadioGroup.VERTICAL);
|
||||||
m_lrForm.add(m_localRemote);
|
m_lrForm.add(m_localRemote);
|
||||||
|
|
||||||
|
|
||||||
m_remoteLabel = new Label(FormItemGlobalizationUtil.globalize(
|
m_remoteLabel = new Label(FormItemGlobalizationUtil.globalize(
|
||||||
"cms.contenttypes.ui.form_item.remote_url_label"));
|
"cms.contenttypes.ui.form_item.remote_url_label"));
|
||||||
m_lrForm.add(m_remoteLabel);
|
m_lrForm.add(m_remoteLabel);
|
||||||
|
|
|
||||||
|
|
@ -18,14 +18,20 @@
|
||||||
*/
|
*/
|
||||||
package com.arsdigita.cms.contenttypes.ui;
|
package com.arsdigita.cms.contenttypes.ui;
|
||||||
|
|
||||||
|
import com.arsdigita.bebop.Bebop;
|
||||||
import com.arsdigita.bebop.FormData;
|
import com.arsdigita.bebop.FormData;
|
||||||
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.DHTMLEditor;
|
||||||
|
import com.arsdigita.bebop.form.TextArea;
|
||||||
|
import com.arsdigita.bebop.parameters.NotNullValidationListener;
|
||||||
|
import com.arsdigita.bebop.util.BebopConstants;
|
||||||
import com.arsdigita.cms.contenttypes.GlossaryItem;
|
import com.arsdigita.cms.contenttypes.GlossaryItem;
|
||||||
import com.arsdigita.cms.contenttypes.util.GlossaryGlobalizationUtil;
|
import com.arsdigita.cms.contenttypes.util.GlossaryGlobalizationUtil;
|
||||||
import com.arsdigita.cms.ItemSelectionModel;
|
import com.arsdigita.cms.ItemSelectionModel;
|
||||||
|
import com.arsdigita.cms.ui.CMSDHTMLEditor;
|
||||||
import com.arsdigita.cms.ui.authoring.BasicPageForm;
|
import com.arsdigita.cms.ui.authoring.BasicPageForm;
|
||||||
import com.arsdigita.globalization.GlobalizedMessage;
|
import com.arsdigita.globalization.GlobalizedMessage;
|
||||||
|
|
||||||
|
|
@ -83,9 +89,39 @@ public class GlossaryItemPropertyForm extends BasicPageForm
|
||||||
*/
|
*/
|
||||||
super.addWidgets();
|
super.addWidgets();
|
||||||
|
|
||||||
GlossaryItemWidgetBuilder builder = new GlossaryItemWidgetBuilder();
|
TextArea definition;
|
||||||
add(builder.makeDefinitionLabel());
|
switch (GlossaryItem.getConfig().getDefinitionEditorType()) {
|
||||||
add(builder.makeDefinitionArea());
|
case WYSIWYG:
|
||||||
|
definition = new CMSDHTMLEditor(DEFINITION);
|
||||||
|
((CMSDHTMLEditor) definition).setWrap(DHTMLEditor.SOFT);
|
||||||
|
if (Bebop.getConfig().getDHTMLEditor()
|
||||||
|
.equals(BebopConstants.BEBOP_FCKEDITOR))
|
||||||
|
{
|
||||||
|
((CMSDHTMLEditor) definition).setConfig(
|
||||||
|
new DHTMLEditor.Config("glossaryitem",
|
||||||
|
GlossaryItem.getConfig().getFckEditorConfig()));
|
||||||
|
} else {
|
||||||
|
// remove this so end users cannot browse through back end
|
||||||
|
// folder system
|
||||||
|
((CMSDHTMLEditor) definition).hideButton("insertlink");
|
||||||
|
}
|
||||||
|
break;
|
||||||
|
default:
|
||||||
|
definition = new TextArea(DEFINITION);
|
||||||
|
definition.setWrap(TextArea.SOFT);
|
||||||
|
break;
|
||||||
|
}
|
||||||
|
|
||||||
|
definition.setLabel(GlossaryGlobalizationUtil
|
||||||
|
.globalize("cms.contenttypes.ui.glossary.definition"));
|
||||||
|
definition.addValidationListener(new NotNullValidationListener());
|
||||||
|
definition.setCols(40);
|
||||||
|
definition.setRows(5);
|
||||||
|
add(definition);
|
||||||
|
|
||||||
|
// GlossaryItemWidgetBuilder builder = new GlossaryItemWidgetBuilder();
|
||||||
|
// add(builder.makeDefinitionLabel());
|
||||||
|
// add(builder.makeDefinitionArea());
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
|
|
|
||||||
|
|
@ -39,7 +39,9 @@ import static com.arsdigita.cms.contenttypes.ui.GlossaryItemPropertyForm.DEFINIT
|
||||||
public class GlossaryItemWidgetBuilder {
|
public class GlossaryItemWidgetBuilder {
|
||||||
|
|
||||||
public TextArea makeDefinitionArea() {
|
public TextArea makeDefinitionArea() {
|
||||||
TextArea definition = null;
|
|
||||||
|
TextArea definition;
|
||||||
|
|
||||||
switch (GlossaryItem.getConfig().getDefinitionEditorType()) {
|
switch (GlossaryItem.getConfig().getDefinitionEditorType()) {
|
||||||
case WYSIWYG:
|
case WYSIWYG:
|
||||||
definition = new CMSDHTMLEditor(DEFINITION);
|
definition = new CMSDHTMLEditor(DEFINITION);
|
||||||
|
|
@ -62,14 +64,16 @@ public class GlossaryItemWidgetBuilder {
|
||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
definition.setLabel(GlossaryGlobalizationUtil
|
||||||
|
.globalize("cms.contenttypes.ui.glossary.definition"));
|
||||||
definition.addValidationListener(new NotNullValidationListener());
|
definition.addValidationListener(new NotNullValidationListener());
|
||||||
definition.setCols(40);
|
definition.setCols(40);
|
||||||
definition.setRows(5);
|
definition.setRows(5);
|
||||||
return definition;
|
return definition;
|
||||||
}
|
}
|
||||||
|
|
||||||
public Label makeDefinitionLabel() {
|
// public Label makeDefinitionLabel() {
|
||||||
return new Label(GlossaryGlobalizationUtil
|
// return new Label(GlossaryGlobalizationUtil
|
||||||
.globalize("cms.contenttypes.ui.glossary.definition"));
|
// .globalize("cms.contenttypes.ui.glossary.definition"));
|
||||||
}
|
// }
|
||||||
}
|
}
|
||||||
|
|
|
||||||
|
|
@ -67,7 +67,7 @@ public class GlossaryItemCreate extends PageCreate {
|
||||||
super.addWidgets();
|
super.addWidgets();
|
||||||
|
|
||||||
GlossaryItemWidgetBuilder builder = new GlossaryItemWidgetBuilder();
|
GlossaryItemWidgetBuilder builder = new GlossaryItemWidgetBuilder();
|
||||||
add(builder.makeDefinitionLabel());
|
// add(builder.makeDefinitionLabel());
|
||||||
add(builder.makeDefinitionArea());
|
add(builder.makeDefinitionArea());
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
||||||
|
|
@ -116,9 +116,9 @@ public class HealthCareFacilityAttachAddressPropertyForm extends BasicPageForm i
|
||||||
Submit target = (Submit) e.getTarget();
|
Submit target = (Submit) e.getTarget();
|
||||||
|
|
||||||
if (healthCareFacility.getAddress() != null) {
|
if (healthCareFacility.getAddress() != null) {
|
||||||
target.setButtonLabel((String) HealthCareFacilityGlobalizationUtil.globalize("cms.contenttypes.ui.healthCareFacility.select_address.change").localize());
|
target.setButtonLabel(HealthCareFacilityGlobalizationUtil.globalize("cms.contenttypes.ui.healthCareFacility.select_address.change"));
|
||||||
} else {
|
} else {
|
||||||
target.setButtonLabel((String) HealthCareFacilityGlobalizationUtil.globalize("cms.contenttypes.ui.healthCareFacility.select_address.add").localize());
|
target.setButtonLabel(HealthCareFacilityGlobalizationUtil.globalize("cms.contenttypes.ui.healthCareFacility.select_address.add"));
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
});
|
});
|
||||||
|
|
@ -130,14 +130,14 @@ public class HealthCareFacilityAttachAddressPropertyForm extends BasicPageForm i
|
||||||
@Override
|
@Override
|
||||||
public void validate(FormSectionEvent e) throws FormProcessException {
|
public void validate(FormSectionEvent e) throws FormProcessException {
|
||||||
if (e.getFormData().get(ITEM_SEARCH) == null) {
|
if (e.getFormData().get(ITEM_SEARCH) == null) {
|
||||||
throw new FormProcessException((String) HealthCareFacilityGlobalizationUtil.globalize("cms.contenttypes.ui.healthCareFacility.select_address.wrong_type").localize());
|
throw new FormProcessException(HealthCareFacilityGlobalizationUtil.globalize("cms.contenttypes.ui.healthCareFacility.select_address.wrong_type"));
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
public void submitted(FormSectionEvent e) throws FormProcessException {
|
public void submitted(FormSectionEvent e) throws FormProcessException {
|
||||||
if (getSaveCancelSection().getCancelButton().isSelected(e.getPageState())) {
|
if (getSaveCancelSection().getCancelButton().isSelected(e.getPageState())) {
|
||||||
init(e);
|
init(e);
|
||||||
throw new FormProcessException((String) HealthCareFacilityGlobalizationUtil.globalize("cms.contenttypes.ui.healthCareFacility.select_address.cancelled").localize());
|
throw new FormProcessException(HealthCareFacilityGlobalizationUtil.globalize("cms.contenttypes.ui.healthCareFacility.select_address.cancelled"));
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
|
||||||
|
|
@ -69,17 +69,16 @@ public class HealthCareFacilityContactAddForm extends BasicItemForm {
|
||||||
protected void addWidgets() {
|
protected void addWidgets() {
|
||||||
|
|
||||||
// Attach a GenericContact object
|
// Attach a GenericContact object
|
||||||
add(new Label(HealthCareFacilityGlobalizationUtil.globalize(
|
|
||||||
"cms.contenttypes.ui.healthCareFacility.select_contact")));
|
|
||||||
this.m_itemSearch = new ItemSearchWidget(ITEM_SEARCH, ContentType.findByAssociatedObjectType("com.arsdigita.cms.contenttypes.GenericContact"));
|
this.m_itemSearch = new ItemSearchWidget(ITEM_SEARCH, ContentType.findByAssociatedObjectType("com.arsdigita.cms.contenttypes.GenericContact"));
|
||||||
|
this.m_itemSearch.setLabel(HealthCareFacilityGlobalizationUtil.globalize(
|
||||||
|
"cms.contenttypes.ui.healthCareFacility.select_contact"));
|
||||||
add(this.m_itemSearch);
|
add(this.m_itemSearch);
|
||||||
|
|
||||||
// GenericContact type field
|
// GenericContact type field
|
||||||
add(new Label(HealthCareFacilityGlobalizationUtil.globalize("cms.contenttypes.ui.healthCareFacility.contact.type")));
|
|
||||||
ParameterModel contactTypeParam = new StringParameter(HealthCareFacilityContactCollection.CONTACT_TYPE);
|
ParameterModel contactTypeParam = new StringParameter(HealthCareFacilityContactCollection.CONTACT_TYPE);
|
||||||
SingleSelect contactType = new SingleSelect(contactTypeParam);
|
SingleSelect contactType = new SingleSelect(contactTypeParam);
|
||||||
contactType.addValidationListener(new NotNullValidationListener());
|
contactType.addValidationListener(new NotNullValidationListener());
|
||||||
contactType.addOption(new Option("", new Label((String) ContenttypesGlobalizationUtil.globalize("cms.ui.select_one").localize())));
|
contactType.addOption(new Option("", new Label(ContenttypesGlobalizationUtil.globalize("cms.ui.select_one"))));
|
||||||
|
|
||||||
// Add the Options to the SingleSelect widget
|
// Add the Options to the SingleSelect widget
|
||||||
StringTokenizer keyList = HealthCareFacility.getConfig().getContactTypeKeys();
|
StringTokenizer keyList = HealthCareFacility.getConfig().getContactTypeKeys();
|
||||||
|
|
@ -87,7 +86,8 @@ public class HealthCareFacilityContactAddForm extends BasicItemForm {
|
||||||
String currentKey = keyList.nextToken();
|
String currentKey = keyList.nextToken();
|
||||||
contactType.addOption(new Option(currentKey, ((String) HealthCareFacilityGlobalizationUtil.globalize("cms.contenttypes.ui.healthCareFacility.contactType.key." + currentKey).localize())));
|
contactType.addOption(new Option(currentKey, ((String) HealthCareFacilityGlobalizationUtil.globalize("cms.contenttypes.ui.healthCareFacility.contactType.key." + currentKey).localize())));
|
||||||
}
|
}
|
||||||
|
contactType.setLabel(HealthCareFacilityGlobalizationUtil.globalize(
|
||||||
|
"cms.contenttypes.ui.healthCareFacility.contact.type"));
|
||||||
add(contactType);
|
add(contactType);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
||||||
|
|
@ -58,7 +58,7 @@ public class HealthCareFacilityDeleteAddressForm extends BasicPageForm implement
|
||||||
public void prepare(PrintEvent e) {
|
public void prepare(PrintEvent e) {
|
||||||
HealthCareFacility healthCareFacility = (HealthCareFacility) getItemSelectionModel().getSelectedObject(e.getPageState());
|
HealthCareFacility healthCareFacility = (HealthCareFacility) getItemSelectionModel().getSelectedObject(e.getPageState());
|
||||||
Submit target = (Submit) e.getTarget();
|
Submit target = (Submit) e.getTarget();
|
||||||
target.setButtonLabel((String) HealthCareFacilityGlobalizationUtil.globalize("cms.contenttypes.ui.healthCareFacility.delete_address.button_label").localize());
|
target.setButtonLabel(HealthCareFacilityGlobalizationUtil.globalize("cms.contenttypes.ui.healthCareFacility.delete_address.button_label"));
|
||||||
}
|
}
|
||||||
});
|
});
|
||||||
} catch (Exception ex) {
|
} catch (Exception ex) {
|
||||||
|
|
|
||||||
|
|
@ -77,42 +77,45 @@ public class HealthCareFacilityEditAddressPropertyForm extends BasicPageForm imp
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
public void addWidgets() {
|
public void addWidgets() {
|
||||||
add(new Label(ContenttypesGlobalizationUtil.globalize(
|
|
||||||
"cms.contenttypes.ui.address.address")));
|
// add(new Label(ContenttypesGlobalizationUtil.globalize(
|
||||||
|
// "cms.contenttypes.ui.address.address")));
|
||||||
ParameterModel addressParam = new StringParameter(ADDRESS);
|
ParameterModel addressParam = new StringParameter(ADDRESS);
|
||||||
addressParam.addParameterListener(new NotNullValidationListener());
|
addressParam.addParameterListener(new NotNullValidationListener());
|
||||||
addressParam.addParameterListener(new StringInRangeValidationListener(0, 1000));
|
addressParam.addParameterListener(new StringInRangeValidationListener(0, 1000));
|
||||||
TextArea address = new TextArea(addressParam);
|
TextArea address = new TextArea(addressParam);
|
||||||
|
address.setLabel(ContenttypesGlobalizationUtil.globalize(
|
||||||
|
"cms.contenttypes.ui.address.address"));
|
||||||
address.setRows(5);
|
address.setRows(5);
|
||||||
address.setCols(30);
|
address.setCols(30);
|
||||||
add(address);
|
add(address);
|
||||||
|
|
||||||
if (!HealthCareFacility.getConfig().getHideAddressPostalCode()) {
|
if (!HealthCareFacility.getConfig().getHideAddressPostalCode()) {
|
||||||
add(new Label(ContenttypesGlobalizationUtil.globalize(
|
|
||||||
"cms.contenttypes.ui.address.postal_code") ));
|
|
||||||
ParameterModel postalCodeParam = new StringParameter(POSTAL_CODE);
|
ParameterModel postalCodeParam = new StringParameter(POSTAL_CODE);
|
||||||
TextField postalCode = new TextField(postalCodeParam);
|
TextField postalCode = new TextField(postalCodeParam);
|
||||||
/* XXX NumberListener ?*/
|
/* XXX NumberListener ?*/
|
||||||
|
postalCode.setLabel(ContenttypesGlobalizationUtil.globalize(
|
||||||
|
"cms.contenttypes.ui.address.postal_code"));
|
||||||
add(postalCode);
|
add(postalCode);
|
||||||
}
|
}
|
||||||
|
|
||||||
add(new Label(ContenttypesGlobalizationUtil.globalize(
|
|
||||||
"cms.contenttypes.ui.address.city") ));
|
|
||||||
ParameterModel cityParam = new StringParameter(CITY);
|
ParameterModel cityParam = new StringParameter(CITY);
|
||||||
TextField city = new TextField(cityParam);
|
TextField city = new TextField(cityParam);
|
||||||
|
city.setLabel(ContenttypesGlobalizationUtil.globalize(
|
||||||
|
"cms.contenttypes.ui.address.city"));
|
||||||
add(city);
|
add(city);
|
||||||
|
|
||||||
if (!HealthCareFacility.getConfig().getHideAddressState()) {
|
if (!HealthCareFacility.getConfig().getHideAddressState()) {
|
||||||
add(new Label(ContenttypesGlobalizationUtil.globalize(
|
|
||||||
"cms.contenttypes.ui.address.state") ));
|
|
||||||
ParameterModel stateParam = new StringParameter(STATE);
|
ParameterModel stateParam = new StringParameter(STATE);
|
||||||
TextField state = new TextField(stateParam);
|
TextField state = new TextField(stateParam);
|
||||||
|
state.setLabel(ContenttypesGlobalizationUtil.globalize(
|
||||||
|
"cms.contenttypes.ui.address.state"));
|
||||||
add(state);
|
add(state);
|
||||||
}
|
}
|
||||||
|
|
||||||
if (!HealthCareFacility.getConfig().getHideAddressCountry()) {
|
if (!HealthCareFacility.getConfig().getHideAddressCountry()) {
|
||||||
add(new Label(ContenttypesGlobalizationUtil.globalize(
|
// add(new Label(ContenttypesGlobalizationUtil.globalize(
|
||||||
"cms.contenttypes.ui.address.iso_country_code") ));
|
// "cms.contenttypes.ui.address.iso_country_code") ));
|
||||||
ParameterModel countryParam = new StringParameter(ISO_COUNTRY_CODE);
|
ParameterModel countryParam = new StringParameter(ISO_COUNTRY_CODE);
|
||||||
countryParam.addParameterListener(new StringInRangeValidationListener(0, 2));
|
countryParam.addParameterListener(new StringInRangeValidationListener(0, 2));
|
||||||
|
|
||||||
|
|
@ -140,6 +143,8 @@ public class HealthCareFacilityEditAddressPropertyForm extends BasicPageForm imp
|
||||||
}
|
}
|
||||||
});
|
});
|
||||||
|
|
||||||
|
country.setLabel(ContenttypesGlobalizationUtil.globalize(
|
||||||
|
"cms.contenttypes.ui.address.iso_country_code"));
|
||||||
add(country);
|
add(country);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
||||||
|
|
@ -66,32 +66,27 @@ public class HistoricDatePropertyForm extends BasicPageForm implements FormProce
|
||||||
public void addWidgets() {
|
public void addWidgets() {
|
||||||
super.addWidgets();
|
super.addWidgets();
|
||||||
|
|
||||||
add(new Label(HistoricDateGlobalizationUtil.globalize("historicdate.ui.year")));
|
|
||||||
final IntegerParameter yearParam = new IntegerParameter(HistoricDate.YEAR);
|
final IntegerParameter yearParam = new IntegerParameter(HistoricDate.YEAR);
|
||||||
final TextField year = new TextField(yearParam);
|
final TextField year = new TextField(yearParam);
|
||||||
year.setLabel(HistoricDateGlobalizationUtil.globalize("historicdate.ui.year"));
|
year.setLabel(HistoricDateGlobalizationUtil.globalize("historicdate.ui.year"));
|
||||||
add(year);
|
add(year);
|
||||||
|
|
||||||
add(new Label(HistoricDateGlobalizationUtil.globalize("historicdate.ui.month")));
|
|
||||||
final IntegerParameter monthParam = new IntegerParameter(HistoricDate.MONTH);
|
final IntegerParameter monthParam = new IntegerParameter(HistoricDate.MONTH);
|
||||||
final TextField month = new TextField(monthParam);
|
final TextField month = new TextField(monthParam);
|
||||||
month.setLabel(HistoricDateGlobalizationUtil.globalize("historicdate.ui.month"));
|
month.setLabel(HistoricDateGlobalizationUtil.globalize("historicdate.ui.month"));
|
||||||
add(month);
|
add(month);
|
||||||
|
|
||||||
add(new Label(HistoricDateGlobalizationUtil.globalize("historicdate.ui.day_of_month")));
|
|
||||||
final IntegerParameter dayOfMonthParam = new IntegerParameter(HistoricDate.DAY_OF_MONTH);
|
final IntegerParameter dayOfMonthParam = new IntegerParameter(HistoricDate.DAY_OF_MONTH);
|
||||||
final TextField dayOfMonth = new TextField(dayOfMonthParam);
|
final TextField dayOfMonth = new TextField(dayOfMonthParam);
|
||||||
dayOfMonth.setLabel(HistoricDateGlobalizationUtil.globalize("historicdate.ui.day_of_month"));
|
dayOfMonth.setLabel(HistoricDateGlobalizationUtil.globalize("historicdate.ui.day_of_month"));
|
||||||
add(dayOfMonth);
|
add(dayOfMonth);
|
||||||
|
|
||||||
add(new Label(HistoricDateGlobalizationUtil.globalize("historicdate.ui.date_is_approx")));
|
|
||||||
dateIsApprox = new CheckboxGroup(HistoricDate.DATE_IS_APPROX + "Group");
|
dateIsApprox = new CheckboxGroup(HistoricDate.DATE_IS_APPROX + "Group");
|
||||||
dateIsApprox.setLabel(HistoricDateGlobalizationUtil.globalize(
|
dateIsApprox.setLabel(HistoricDateGlobalizationUtil.globalize(
|
||||||
"historicdate.ui.date_is_approx"));
|
"historicdate.ui.date_is_approx"));
|
||||||
dateIsApprox.addOption(new Option(HistoricDate.DATE_IS_APPROX, ""));
|
dateIsApprox.addOption(new Option(HistoricDate.DATE_IS_APPROX, ""));
|
||||||
add(dateIsApprox);
|
add(dateIsApprox);
|
||||||
|
|
||||||
add(new Label(HistoricDateGlobalizationUtil.globalize("historicdate.ui.lead")));
|
|
||||||
final ParameterModel leadParam = new StringParameter(HistoricDate.LEAD);
|
final ParameterModel leadParam = new StringParameter(HistoricDate.LEAD);
|
||||||
final TextArea lead = new TextArea(leadParam);
|
final TextArea lead = new TextArea(leadParam);
|
||||||
lead.setCols(80);
|
lead.setCols(80);
|
||||||
|
|
|
||||||
|
|
@ -28,8 +28,6 @@ import com.arsdigita.bebop.event.FormSubmissionListener;
|
||||||
import com.arsdigita.bebop.event.FormSectionEvent;
|
import com.arsdigita.bebop.event.FormSectionEvent;
|
||||||
import com.arsdigita.bebop.form.Date;
|
import com.arsdigita.bebop.form.Date;
|
||||||
import com.arsdigita.bebop.form.Hidden;
|
import com.arsdigita.bebop.form.Hidden;
|
||||||
import com.arsdigita.bebop.form.Option;
|
|
||||||
import com.arsdigita.bebop.form.RadioGroup;
|
|
||||||
import com.arsdigita.bebop.form.TextArea;
|
import com.arsdigita.bebop.form.TextArea;
|
||||||
import com.arsdigita.bebop.form.TextField;
|
import com.arsdigita.bebop.form.TextField;
|
||||||
import com.arsdigita.bebop.parameters.BooleanParameter;
|
import com.arsdigita.bebop.parameters.BooleanParameter;
|
||||||
|
|
@ -53,6 +51,10 @@ public class ImagePropertyForm
|
||||||
extends BasicPageForm
|
extends BasicPageForm
|
||||||
implements FormProcessListener, FormInitListener, FormSubmissionListener {
|
implements FormProcessListener, FormInitListener, FormSubmissionListener {
|
||||||
|
|
||||||
|
/** Internal logger instance to faciliate debugging. Enable logging output
|
||||||
|
* by editing /WEB-INF/conf/log4j.properties int the runtime environment
|
||||||
|
* and set com.arsdigita.cms.contenttypes.ui.ImagePropertyForm=DEBUG
|
||||||
|
* by uncommenting or adding the line. */
|
||||||
private final static org.apache.log4j.Logger s_log =
|
private final static org.apache.log4j.Logger s_log =
|
||||||
org.apache.log4j.Logger.getLogger(ImagePropertyForm.class);
|
org.apache.log4j.Logger.getLogger(ImagePropertyForm.class);
|
||||||
private ImagePropertiesStep m_step;
|
private ImagePropertiesStep m_step;
|
||||||
|
|
@ -87,11 +89,13 @@ public class ImagePropertyForm
|
||||||
protected void addWidgets() {
|
protected void addWidgets() {
|
||||||
super.addWidgets();
|
super.addWidgets();
|
||||||
|
|
||||||
add(new Label(ImageGlobalizationUtil
|
// add(new Label(ImageGlobalizationUtil
|
||||||
.globalize("cms.contenttypes.ui.image.caption")));
|
// .globalize("cms.contenttypes.ui.image.caption")));
|
||||||
ParameterModel captionParam = new StringParameter(Image.CAPTION);
|
ParameterModel captionParam = new StringParameter(Image.CAPTION);
|
||||||
captionParam.addParameterListener(new StringInRangeValidationListener(0, 400));
|
captionParam.addParameterListener(new StringInRangeValidationListener(0, 400));
|
||||||
TextField caption = new TextField(captionParam);
|
TextField caption = new TextField(captionParam);
|
||||||
|
caption.setLabel(ImageGlobalizationUtil
|
||||||
|
.globalize("cms.contenttypes.ui.image.caption"));
|
||||||
add(caption);
|
add(caption);
|
||||||
|
|
||||||
/* Image doesn't use the description property part of the basic
|
/* Image doesn't use the description property part of the basic
|
||||||
|
|
@ -102,15 +106,17 @@ public class ImagePropertyForm
|
||||||
ParameterModel descriptionParam = new StringParameter(Image.DESCRIPTION);
|
ParameterModel descriptionParam = new StringParameter(Image.DESCRIPTION);
|
||||||
descriptionParam.addParameterListener(new StringInRangeValidationListener(0, 1000));
|
descriptionParam.addParameterListener(new StringInRangeValidationListener(0, 1000));
|
||||||
TextArea description = new TextArea(descriptionParam);
|
TextArea description = new TextArea(descriptionParam);
|
||||||
|
description.setLabel(GlobalizationUtil
|
||||||
|
.globalize("cms.contenttypes.ui.description"));
|
||||||
description.setRows(10);
|
description.setRows(10);
|
||||||
description.setCols(60);
|
description.setCols(60);
|
||||||
add(description);
|
add(description);
|
||||||
|
|
||||||
add(new Label(ImageGlobalizationUtil
|
|
||||||
.globalize("cms.contenttypes.ui.image.artist")));
|
|
||||||
ParameterModel artistParam = new StringParameter(Image.ARTIST);
|
ParameterModel artistParam = new StringParameter(Image.ARTIST);
|
||||||
artistParam.addParameterListener(new StringInRangeValidationListener(0, 200));
|
artistParam.addParameterListener(new StringInRangeValidationListener(0, 200));
|
||||||
TextField artist = new TextField(artistParam);
|
TextField artist = new TextField(artistParam);
|
||||||
|
artist.setLabel(ImageGlobalizationUtil
|
||||||
|
.globalize("cms.contenttypes.ui.image.artist"));
|
||||||
add(artist);
|
add(artist);
|
||||||
|
|
||||||
ParameterModel skipDayParam = new BooleanParameter(Image.SKIPDAY);
|
ParameterModel skipDayParam = new BooleanParameter(Image.SKIPDAY);
|
||||||
|
|
@ -121,49 +127,51 @@ public class ImagePropertyForm
|
||||||
Hidden skipMonth = new Hidden(skipMonthParam);
|
Hidden skipMonth = new Hidden(skipMonthParam);
|
||||||
add(skipMonth);
|
add(skipMonth);
|
||||||
|
|
||||||
add(new Label(ImageGlobalizationUtil
|
// add(new Label(ImageGlobalizationUtil
|
||||||
.globalize("cms.contenttypes.ui.image.publishDate")));
|
// .globalize("cms.contenttypes.ui.image.publishDate")));
|
||||||
IncompleteDateParameter publishDateParam = new IncompleteDateParameter(Image.PUBLISHDATE);
|
IncompleteDateParameter publishDateParam = new IncompleteDateParameter(Image.PUBLISHDATE);
|
||||||
publishDateParam.allowSkipDay(true);
|
publishDateParam.allowSkipDay(true);
|
||||||
publishDateParam.allowSkipMonth(true);
|
publishDateParam.allowSkipMonth(true);
|
||||||
Date publishDate = new Date(publishDateParam);
|
Date publishDate = new Date(publishDateParam);
|
||||||
publishDate.setYearRange(Image.getConfig().getStartYear(),
|
publishDate.setYearRange(Image.getConfig().getStartYear(),
|
||||||
GregorianCalendar.getInstance().get(Calendar.YEAR) + Image.getConfig().getEndYearDelta());
|
GregorianCalendar.getInstance().get(Calendar.YEAR) + Image.getConfig().getEndYearDelta());
|
||||||
|
publishDate.setLabel(ImageGlobalizationUtil
|
||||||
|
.globalize("cms.contenttypes.ui.image.publishDate"));
|
||||||
add(publishDate);
|
add(publishDate);
|
||||||
|
|
||||||
add(new Label(ImageGlobalizationUtil
|
|
||||||
.globalize("cms.contenttypes.ui.image.source")));
|
|
||||||
ParameterModel sourceParam = new StringParameter(Image.SOURCE);
|
ParameterModel sourceParam = new StringParameter(Image.SOURCE);
|
||||||
sourceParam.addParameterListener(new StringInRangeValidationListener(0, 600));
|
sourceParam.addParameterListener(new StringInRangeValidationListener(0, 600));
|
||||||
TextField source = new TextField(sourceParam);
|
TextField source = new TextField(sourceParam);
|
||||||
|
source.setLabel(ImageGlobalizationUtil
|
||||||
|
.globalize("cms.contenttypes.ui.image.source"));
|
||||||
add(source);
|
add(source);
|
||||||
|
|
||||||
add(new Label(ImageGlobalizationUtil
|
|
||||||
.globalize("cms.contenttypes.ui.image.media")));
|
|
||||||
ParameterModel mediaParam = new StringParameter(Image.MEDIA);
|
ParameterModel mediaParam = new StringParameter(Image.MEDIA);
|
||||||
mediaParam.addParameterListener(new StringInRangeValidationListener(0, 300));
|
mediaParam.addParameterListener(new StringInRangeValidationListener(0, 300));
|
||||||
TextField media = new TextField(mediaParam);
|
TextField media = new TextField(mediaParam);
|
||||||
|
media.setLabel(ImageGlobalizationUtil
|
||||||
|
.globalize("cms.contenttypes.ui.image.media"));
|
||||||
add(media);
|
add(media);
|
||||||
|
|
||||||
add(new Label(ImageGlobalizationUtil
|
|
||||||
.globalize("cms.contenttypes.ui.image.copyright")));
|
|
||||||
ParameterModel copyrightParam = new StringParameter(Image.COPYRIGHT);
|
ParameterModel copyrightParam = new StringParameter(Image.COPYRIGHT);
|
||||||
copyrightParam.addParameterListener(new StringInRangeValidationListener(0, 400));
|
copyrightParam.addParameterListener(new StringInRangeValidationListener(0, 400));
|
||||||
TextField copyright = new TextField(copyrightParam);
|
TextField copyright = new TextField(copyrightParam);
|
||||||
|
copyright.setLabel(ImageGlobalizationUtil
|
||||||
|
.globalize("cms.contenttypes.ui.image.copyright"));
|
||||||
add(copyright);
|
add(copyright);
|
||||||
|
|
||||||
add(new Label(ImageGlobalizationUtil
|
|
||||||
.globalize("cms.contenttypes.ui.image.site")));
|
|
||||||
ParameterModel siteParam = new StringParameter(Image.SITE);
|
ParameterModel siteParam = new StringParameter(Image.SITE);
|
||||||
siteParam.addParameterListener(new StringInRangeValidationListener(0, 500));
|
siteParam.addParameterListener(new StringInRangeValidationListener(0, 500));
|
||||||
TextField site = new TextField(siteParam);
|
TextField site = new TextField(siteParam);
|
||||||
|
site.setLabel(ImageGlobalizationUtil
|
||||||
|
.globalize("cms.contenttypes.ui.image.site"));
|
||||||
add(site);
|
add(site);
|
||||||
|
|
||||||
add(new Label(ImageGlobalizationUtil
|
|
||||||
.globalize("cms.contenttypes.ui.image.license")));
|
|
||||||
ParameterModel licenseParam = new StringParameter(Image.LICENSE);
|
ParameterModel licenseParam = new StringParameter(Image.LICENSE);
|
||||||
licenseParam.addParameterListener(new StringInRangeValidationListener(0, 300));
|
licenseParam.addParameterListener(new StringInRangeValidationListener(0, 300));
|
||||||
TextField license = new TextField(licenseParam);
|
TextField license = new TextField(licenseParam);
|
||||||
|
license.setLabel(ImageGlobalizationUtil
|
||||||
|
.globalize("cms.contenttypes.ui.image.license"));
|
||||||
add(license);
|
add(license);
|
||||||
|
|
||||||
add(new Label(ImageGlobalizationUtil
|
add(new Label(ImageGlobalizationUtil
|
||||||
|
|
@ -171,20 +179,22 @@ public class ImagePropertyForm
|
||||||
ParameterModel materialParam = new StringParameter(Image.MATERIAL);
|
ParameterModel materialParam = new StringParameter(Image.MATERIAL);
|
||||||
materialParam.addParameterListener(new StringInRangeValidationListener(0, 200));
|
materialParam.addParameterListener(new StringInRangeValidationListener(0, 200));
|
||||||
TextField material = new TextField(materialParam);
|
TextField material = new TextField(materialParam);
|
||||||
|
material.setLabel(ImageGlobalizationUtil
|
||||||
|
.globalize("cms.contenttypes.ui.image.material"));
|
||||||
add(material);
|
add(material);
|
||||||
|
|
||||||
add(new Label(ImageGlobalizationUtil
|
|
||||||
.globalize("cms.contenttypes.ui.image.technique")));
|
|
||||||
ParameterModel techniqueParam = new StringParameter(Image.TECHNIQUE);
|
ParameterModel techniqueParam = new StringParameter(Image.TECHNIQUE);
|
||||||
techniqueParam.addParameterListener(new StringInRangeValidationListener(0, 200));
|
techniqueParam.addParameterListener(new StringInRangeValidationListener(0, 200));
|
||||||
TextField technique = new TextField(techniqueParam);
|
TextField technique = new TextField(techniqueParam);
|
||||||
|
technique.setLabel(ImageGlobalizationUtil
|
||||||
|
.globalize("cms.contenttypes.ui.image.technique"));
|
||||||
add(technique);
|
add(technique);
|
||||||
|
|
||||||
add(new Label(ImageGlobalizationUtil
|
|
||||||
.globalize("cms.contenttypes.ui.image.origin")));
|
|
||||||
ParameterModel originParam = new StringParameter(Image.ORIGIN);
|
ParameterModel originParam = new StringParameter(Image.ORIGIN);
|
||||||
originParam.addParameterListener(new StringInRangeValidationListener(0, 200));
|
originParam.addParameterListener(new StringInRangeValidationListener(0, 200));
|
||||||
TextField origin = new TextField(originParam);
|
TextField origin = new TextField(originParam);
|
||||||
|
origin.setLabel(ImageGlobalizationUtil
|
||||||
|
.globalize("cms.contenttypes.ui.image.origin"));
|
||||||
add(origin);
|
add(origin);
|
||||||
|
|
||||||
add(new Label(ImageGlobalizationUtil
|
add(new Label(ImageGlobalizationUtil
|
||||||
|
|
@ -192,11 +202,15 @@ public class ImagePropertyForm
|
||||||
ParameterModel origSizeParam = new StringParameter(Image.ORIGSIZE);
|
ParameterModel origSizeParam = new StringParameter(Image.ORIGSIZE);
|
||||||
origSizeParam.addParameterListener(new StringInRangeValidationListener(0, 100));
|
origSizeParam.addParameterListener(new StringInRangeValidationListener(0, 100));
|
||||||
TextField origSize = new TextField(origSizeParam);
|
TextField origSize = new TextField(origSizeParam);
|
||||||
|
origSize.setLabel(ImageGlobalizationUtil
|
||||||
|
.globalize("cms.contenttypes.ui.image.origSize"));
|
||||||
add(origSize);
|
add(origSize);
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
/** Form initialisation hook. Fills widgets with data. */
|
/**
|
||||||
|
* @param fse Form initialisation hook. Fills widgets with data.
|
||||||
|
*/
|
||||||
@Override
|
@Override
|
||||||
public void init(FormSectionEvent fse) {
|
public void init(FormSectionEvent fse) {
|
||||||
// Do some initialization hook stuff
|
// Do some initialization hook stuff
|
||||||
|
|
@ -233,7 +247,10 @@ public class ImagePropertyForm
|
||||||
FormData d = e.getFormData();
|
FormData d = e.getFormData();
|
||||||
}
|
}
|
||||||
|
|
||||||
/** Cancels streamlined editing. */
|
/**
|
||||||
|
* Cancels streamlined editing.
|
||||||
|
* @param fse
|
||||||
|
*/
|
||||||
@Override
|
@Override
|
||||||
public void submitted(FormSectionEvent fse) {
|
public void submitted(FormSectionEvent fse) {
|
||||||
if (m_step != null
|
if (m_step != null
|
||||||
|
|
@ -242,7 +259,10 @@ public class ImagePropertyForm
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
/** Form processing hook. Saves Event object. */
|
/**
|
||||||
|
* Form processing hook. Saves Event object.
|
||||||
|
* @param fse
|
||||||
|
*/
|
||||||
@Override
|
@Override
|
||||||
public void process(FormSectionEvent fse) {
|
public void process(FormSectionEvent fse) {
|
||||||
FormData data = fse.getFormData();
|
FormData data = fse.getFormData();
|
||||||
|
|
|
||||||
|
|
@ -19,8 +19,6 @@
|
||||||
package com.arsdigita.cms.contenttypes.ui;
|
package com.arsdigita.cms.contenttypes.ui;
|
||||||
|
|
||||||
import com.arsdigita.cms.contenttypes.InlineSite;
|
import com.arsdigita.cms.contenttypes.InlineSite;
|
||||||
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;
|
||||||
|
|
@ -28,19 +26,18 @@ import com.arsdigita.bebop.form.TextArea;
|
||||||
import com.arsdigita.bebop.form.TextField;
|
import com.arsdigita.bebop.form.TextField;
|
||||||
import com.arsdigita.bebop.parameters.NotEmptyValidationListener;
|
import com.arsdigita.bebop.parameters.NotEmptyValidationListener;
|
||||||
import com.arsdigita.bebop.parameters.ParameterModel;
|
import com.arsdigita.bebop.parameters.ParameterModel;
|
||||||
import com.arsdigita.bebop.parameters.ParameterModel;
|
|
||||||
import com.arsdigita.bebop.parameters.StringInRangeValidationListener;
|
import com.arsdigita.bebop.parameters.StringInRangeValidationListener;
|
||||||
import com.arsdigita.bebop.parameters.StringParameter;
|
import com.arsdigita.bebop.parameters.StringParameter;
|
||||||
import com.arsdigita.cms.CMS;
|
|
||||||
import com.arsdigita.cms.ContentPage;
|
import com.arsdigita.cms.ContentPage;
|
||||||
import com.arsdigita.cms.ContentSection;
|
import com.arsdigita.cms.ContentSection;
|
||||||
import com.arsdigita.cms.ItemSelectionModel;
|
import com.arsdigita.cms.ItemSelectionModel;
|
||||||
|
import com.arsdigita.cms.contenttypes.util.InlineSiteGlobalizationUtil;
|
||||||
import com.arsdigita.cms.ui.authoring.BasicPageForm;
|
import com.arsdigita.cms.ui.authoring.BasicPageForm;
|
||||||
import com.arsdigita.cms.util.GlobalizationUtil;
|
import com.arsdigita.cms.util.GlobalizationUtil;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Form to edit the basic properties of an InlineSite. This form can be extended to create forms for InlineSite
|
* Form to edit the basic properties of an InlineSite. This form can be
|
||||||
* subclasses.
|
* extended to create forms for InlineSite subclasses.
|
||||||
*/
|
*/
|
||||||
public class InlineSitePropertyForm extends BasicPageForm
|
public class InlineSitePropertyForm extends BasicPageForm
|
||||||
implements FormProcessListener, FormInitListener {
|
implements FormProcessListener, FormInitListener {
|
||||||
|
|
@ -68,8 +65,9 @@ public class InlineSitePropertyForm extends BasicPageForm
|
||||||
*/
|
*/
|
||||||
protected void addWidgets() {
|
protected void addWidgets() {
|
||||||
super.addWidgets();
|
super.addWidgets();
|
||||||
add(new Label(GlobalizationUtil.globalize("cms.contenttypes.ui.description")));
|
|
||||||
m_description = new TextArea(ContentPage.DESCRIPTION);
|
m_description = new TextArea(ContentPage.DESCRIPTION);
|
||||||
|
m_description.setLabel(GlobalizationUtil.globalize(
|
||||||
|
"cms.contenttypes.ui.description"));
|
||||||
m_description.setCols(30);
|
m_description.setCols(30);
|
||||||
m_description.setRows(5);
|
m_description.setRows(5);
|
||||||
if (ContentSection.getConfig().mandatoryDescriptions()) {
|
if (ContentSection.getConfig().mandatoryDescriptions()) {
|
||||||
|
|
@ -83,9 +81,10 @@ public class InlineSitePropertyForm extends BasicPageForm
|
||||||
4000));
|
4000));
|
||||||
add(m_description);
|
add(m_description);
|
||||||
|
|
||||||
add(new Label("URL:"));
|
|
||||||
ParameterModel urlParam = new StringParameter("url");
|
ParameterModel urlParam = new StringParameter("url");
|
||||||
m_url = new TextField(urlParam);
|
m_url = new TextField(urlParam);
|
||||||
|
m_url.setLabel(InlineSiteGlobalizationUtil.globalize(
|
||||||
|
"cms.contenttypes.ui.inlinesite.url"));
|
||||||
m_url.setSize(40);
|
m_url.setSize(40);
|
||||||
add(m_url);
|
add(m_url);
|
||||||
}
|
}
|
||||||
|
|
@ -93,6 +92,7 @@ public class InlineSitePropertyForm extends BasicPageForm
|
||||||
/**
|
/**
|
||||||
* Form initialisation hook. Fills widgets with data.
|
* Form initialisation hook. Fills widgets with data.
|
||||||
*/
|
*/
|
||||||
|
@Override
|
||||||
public void init(FormSectionEvent fse) {
|
public void init(FormSectionEvent fse) {
|
||||||
InlineSite site = (InlineSite) super.initBasicWidgets(fse);
|
InlineSite site = (InlineSite) super.initBasicWidgets(fse);
|
||||||
|
|
||||||
|
|
@ -103,7 +103,9 @@ public class InlineSitePropertyForm extends BasicPageForm
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Form processing hook. Saves InlineSite object.
|
* Form processing hook. Saves InlineSite object.
|
||||||
|
* @param fse
|
||||||
*/
|
*/
|
||||||
|
@Override
|
||||||
public void process(FormSectionEvent fse) {
|
public void process(FormSectionEvent fse) {
|
||||||
InlineSite site = (InlineSite) super.processBasicWidgets(fse);
|
InlineSite site = (InlineSite) super.processBasicWidgets(fse);
|
||||||
|
|
||||||
|
|
|
||||||
|
|
@ -24,16 +24,14 @@ import com.arsdigita.cms.ContentPage;
|
||||||
import com.arsdigita.cms.ContentSection;
|
import com.arsdigita.cms.ContentSection;
|
||||||
import com.arsdigita.cms.ItemSelectionModel;
|
import com.arsdigita.cms.ItemSelectionModel;
|
||||||
import com.arsdigita.cms.contenttypes.GenericAddress;
|
import com.arsdigita.cms.contenttypes.GenericAddress;
|
||||||
import com.arsdigita.domain.DomainObject;
|
|
||||||
import com.arsdigita.toolbox.ui.DomainObjectPropertySheet;
|
|
||||||
import com.arsdigita.cms.ui.authoring.AuthoringKitWizard;
|
import com.arsdigita.cms.ui.authoring.AuthoringKitWizard;
|
||||||
import com.arsdigita.cms.ui.authoring.BasicPageForm;
|
import com.arsdigita.cms.ui.authoring.BasicPageForm;
|
||||||
import com.arsdigita.cms.ui.authoring.SimpleEditStep;
|
import com.arsdigita.cms.ui.authoring.SimpleEditStep;
|
||||||
import com.arsdigita.cms.ui.workflow.WorkflowLockedComponentAccess;
|
import com.arsdigita.cms.ui.workflow.WorkflowLockedComponentAccess;
|
||||||
import com.arsdigita.cms.contenttypes.util.ContenttypesGlobalizationUtil;
|
import com.arsdigita.cms.contenttypes.util.ContenttypesGlobalizationUtil;
|
||||||
import com.arsdigita.cms.util.GlobalizationUtil;
|
import com.arsdigita.cms.util.GlobalizationUtil;
|
||||||
|
import com.arsdigita.domain.DomainObject;
|
||||||
import java.text.DateFormat;
|
import com.arsdigita.toolbox.ui.DomainObjectPropertySheet;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
*
|
*
|
||||||
|
|
@ -58,6 +56,10 @@ public class GenericAddressPropertiesStep extends SimpleEditStep {
|
||||||
setDisplayComponent(getAddressPropertySheet(itemModel));
|
setDisplayComponent(getAddressPropertySheet(itemModel));
|
||||||
}
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
*
|
||||||
|
* @param itemModel
|
||||||
|
*/
|
||||||
protected void createEditSheet(ItemSelectionModel itemModel) {
|
protected void createEditSheet(ItemSelectionModel itemModel) {
|
||||||
BasicPageForm editSheet;
|
BasicPageForm editSheet;
|
||||||
editSheet = new GenericAddressPropertyForm(itemModel, this);
|
editSheet = new GenericAddressPropertyForm(itemModel, this);
|
||||||
|
|
@ -99,9 +101,10 @@ public class GenericAddressPropertiesStep extends SimpleEditStep {
|
||||||
GenericAddress.ISO_COUNTRY_CODE,
|
GenericAddress.ISO_COUNTRY_CODE,
|
||||||
new DomainObjectPropertySheet.AttributeFormatter() {
|
new DomainObjectPropertySheet.AttributeFormatter() {
|
||||||
|
|
||||||
|
@Override
|
||||||
public String format(DomainObject item,
|
public String format(DomainObject item,
|
||||||
String attribute,
|
String attribute,
|
||||||
PageState state) {
|
PageState state) {
|
||||||
GenericAddress address = (GenericAddress) item;
|
GenericAddress address = (GenericAddress) item;
|
||||||
if (address != null && address.getIsoCountryCode() != null) {
|
if (address != null && address.getIsoCountryCode() != null) {
|
||||||
return GenericAddress
|
return GenericAddress
|
||||||
|
|
|
||||||
|
|
@ -82,9 +82,12 @@ public class GenericAddressPropertyForm extends BasicPageForm
|
||||||
addSubmissionListener(this);
|
addSubmissionListener(this);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Add the widgets specific to GenericAddress
|
||||||
|
*/
|
||||||
@Override
|
@Override
|
||||||
protected void addWidgets() {
|
protected void addWidgets() {
|
||||||
super.addWidgets();
|
super.addWidgets(); // Add the standard widgets from super class
|
||||||
|
|
||||||
ParameterModel addressParam = new StringParameter(ADDRESS);
|
ParameterModel addressParam = new StringParameter(ADDRESS);
|
||||||
addressParam.addParameterListener(new NotNullValidationListener());
|
addressParam.addParameterListener(new NotNullValidationListener());
|
||||||
|
|
@ -149,15 +152,16 @@ public class GenericAddressPropertyForm extends BasicPageForm
|
||||||
|
|
||||||
country.addValidationListener(new ParameterListener() {
|
country.addValidationListener(new ParameterListener() {
|
||||||
|
|
||||||
|
@Override
|
||||||
public void validate(ParameterEvent e)
|
public void validate(ParameterEvent e)
|
||||||
throws FormProcessException {
|
throws FormProcessException {
|
||||||
ParameterData data = e.getParameterData();
|
ParameterData data = e.getParameterData();
|
||||||
String isoCode = (String) data.getValue();
|
String isoCode = (String) data.getValue();
|
||||||
s_log.debug("ISO code is : " + isoCode);
|
s_log.debug("ISO code is : " + isoCode);
|
||||||
if (isoCode == null || isoCode.length() == 0) {
|
if (isoCode == null || isoCode.length() == 0) {
|
||||||
data.addError((String) ContenttypesGlobalizationUtil
|
data.addError(ContenttypesGlobalizationUtil
|
||||||
.globalize("cms.contenttypes.ui.address.error_iso_country")
|
.globalize("cms.contenttypes.ui.address.error_iso_country")
|
||||||
.localize());
|
);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
@ -172,6 +176,7 @@ public class GenericAddressPropertyForm extends BasicPageForm
|
||||||
*
|
*
|
||||||
* @param fse
|
* @param fse
|
||||||
*/
|
*/
|
||||||
|
@Override
|
||||||
public void init(FormSectionEvent fse) {
|
public void init(FormSectionEvent fse) {
|
||||||
FormData data = fse.getFormData();
|
FormData data = fse.getFormData();
|
||||||
GenericAddress address = (GenericAddress) super.initBasicWidgets(fse);
|
GenericAddress address = (GenericAddress) super.initBasicWidgets(fse);
|
||||||
|
|
@ -200,6 +205,7 @@ public class GenericAddressPropertyForm extends BasicPageForm
|
||||||
*
|
*
|
||||||
* @param fse
|
* @param fse
|
||||||
*/
|
*/
|
||||||
|
@Override
|
||||||
public void process(FormSectionEvent fse) {
|
public void process(FormSectionEvent fse) {
|
||||||
FormData data = fse.getFormData();
|
FormData data = fse.getFormData();
|
||||||
|
|
||||||
|
|
|
||||||
|
|
@ -89,6 +89,7 @@ public class GenericArticlePropertiesStep extends SimpleEditStep {
|
||||||
ContentPage.LAUNCH_DATE,
|
ContentPage.LAUNCH_DATE,
|
||||||
new DomainObjectPropertySheet.AttributeFormatter() {
|
new DomainObjectPropertySheet.AttributeFormatter() {
|
||||||
|
|
||||||
|
@Override
|
||||||
public String format(DomainObject item,
|
public String format(DomainObject item,
|
||||||
String attribute,
|
String attribute,
|
||||||
PageState state) {
|
PageState state) {
|
||||||
|
|
|
||||||
|
|
@ -9,19 +9,12 @@
|
||||||
package com.arsdigita.cms.contenttypes.ui;
|
package com.arsdigita.cms.contenttypes.ui;
|
||||||
|
|
||||||
import com.arsdigita.bebop.Component;
|
import com.arsdigita.bebop.Component;
|
||||||
import com.arsdigita.bebop.Label;
|
|
||||||
import com.arsdigita.bebop.PageState;
|
|
||||||
import com.arsdigita.cms.contenttypes.GenericAddress;
|
|
||||||
import com.arsdigita.cms.contenttypes.GenericContact;
|
|
||||||
import com.arsdigita.cms.contenttypes.util.ContenttypesGlobalizationUtil;
|
|
||||||
import com.arsdigita.cms.ItemSelectionModel;
|
import com.arsdigita.cms.ItemSelectionModel;
|
||||||
|
import com.arsdigita.cms.contenttypes.util.ContenttypesGlobalizationUtil;
|
||||||
import com.arsdigita.cms.ui.authoring.AuthoringKitWizard;
|
import com.arsdigita.cms.ui.authoring.AuthoringKitWizard;
|
||||||
import com.arsdigita.cms.ui.authoring.BasicPageForm;
|
import com.arsdigita.cms.ui.authoring.BasicPageForm;
|
||||||
import com.arsdigita.cms.ui.authoring.SimpleEditStep;
|
import com.arsdigita.cms.ui.authoring.SimpleEditStep;
|
||||||
import com.arsdigita.cms.ui.workflow.WorkflowLockedComponentAccess;
|
import com.arsdigita.cms.ui.workflow.WorkflowLockedComponentAccess;
|
||||||
import com.arsdigita.cms.util.GlobalizationUtil;
|
|
||||||
import com.arsdigita.domain.DomainObject;
|
|
||||||
import com.arsdigita.toolbox.ui.DomainObjectPropertySheet;
|
|
||||||
|
|
||||||
/**
|
/**
|
||||||
*
|
*
|
||||||
|
|
@ -37,7 +30,10 @@ public class GenericContactAddressPropertiesStep extends SimpleEditStep {
|
||||||
private final WorkflowLockedComponentAccess addAddress;
|
private final WorkflowLockedComponentAccess addAddress;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Creates a new instance of GenericContactAddressPropertiesStep
|
* Creates a new instance of GenericContactAddressPropertiesStep.
|
||||||
|
*
|
||||||
|
* @param itemModel
|
||||||
|
* @param parent
|
||||||
*/
|
*/
|
||||||
public GenericContactAddressPropertiesStep(final ItemSelectionModel itemModel,
|
public GenericContactAddressPropertiesStep(final ItemSelectionModel itemModel,
|
||||||
final AuthoringKitWizard parent) {
|
final AuthoringKitWizard parent) {
|
||||||
|
|
@ -60,38 +56,6 @@ public class GenericContactAddressPropertiesStep extends SimpleEditStep {
|
||||||
|
|
||||||
setDisplayComponent(getAddressPropertySheet(itemModel));
|
setDisplayComponent(getAddressPropertySheet(itemModel));
|
||||||
|
|
||||||
// this.itemModel = itemModel;
|
|
||||||
//
|
|
||||||
// BasicPageForm attachAddressSheet = new GenericContactAttachAddressPropertyForm(itemModel,
|
|
||||||
// this);
|
|
||||||
// BasicPageForm reattachAddressSheet = new GenericContactAttachAddressPropertyForm(itemModel,
|
|
||||||
// this);
|
|
||||||
// BasicPageForm editAddressSheet = new GenericContactEditAddressPropertyForm(itemModel, this);
|
|
||||||
// BasicPageForm deleteAddressSheet = new GenericContactDeleteAddressForm(
|
|
||||||
// itemModel, this);
|
|
||||||
//
|
|
||||||
// add(ADD_ADDRESS_SHEET_NAME,
|
|
||||||
// ContenttypesGlobalizationUtil.globalize(
|
|
||||||
// "cms.contenttypes.ui.contact.attach_address"),
|
|
||||||
// new AttachAddressWorkflowLockedComponentAccess(attachAddressSheet,
|
|
||||||
// itemModel),
|
|
||||||
// attachAddressSheet.getSaveCancelSection().getCancelButton());
|
|
||||||
// add(CHANGE_ADDRESS_SHEET_NAME,
|
|
||||||
// ContenttypesGlobalizationUtil.globalize(
|
|
||||||
// "cms.contenttypes.ui.contact.reattach_address"),
|
|
||||||
// new EditAddressWorkflowLockedComponentAccess(reattachAddressSheet,
|
|
||||||
// itemModel),
|
|
||||||
// reattachAddressSheet.getSaveCancelSection().getCancelButton());
|
|
||||||
//
|
|
||||||
// add(DELETE_ADDRESS_SHEET_NAME,
|
|
||||||
// ContenttypesGlobalizationUtil.globalize(
|
|
||||||
// "cms.contenttypes.ui.contact.delete_address"),
|
|
||||||
// new EditAddressWorkflowLockedComponentAccess(deleteAddressSheet,
|
|
||||||
// itemModel),
|
|
||||||
// deleteAddressSheet.getSaveCancelSection().getCancelButton());
|
|
||||||
//
|
|
||||||
// /* Set the displayComponent for this step */
|
|
||||||
// setDisplayComponent(getAddressPropertySheet(itemModel));
|
|
||||||
}
|
}
|
||||||
|
|
||||||
public static Component getAddressPropertySheet(final ItemSelectionModel itemModel) {
|
public static Component getAddressPropertySheet(final ItemSelectionModel itemModel) {
|
||||||
|
|
@ -99,171 +63,4 @@ public class GenericContactAddressPropertiesStep extends SimpleEditStep {
|
||||||
return sheet;
|
return sheet;
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
|
||||||
*
|
|
||||||
* @param itemModel
|
|
||||||
*
|
|
||||||
* @return
|
|
||||||
*/
|
|
||||||
// public static Component getAddressPropertySheet(ItemSelectionModel itemModel) {
|
|
||||||
//
|
|
||||||
// DomainObjectPropertySheet sheet = new DomainObjectPropertySheet(
|
|
||||||
// itemModel);
|
|
||||||
//
|
|
||||||
// sheet.add(ContenttypesGlobalizationUtil.globalize(
|
|
||||||
// "cms.contenttypes.ui.address.address"),
|
|
||||||
// "address." + GenericAddress.ADDRESS,
|
|
||||||
// new DomainObjectPropertySheet.AttributeFormatter() {
|
|
||||||
//
|
|
||||||
// @Override
|
|
||||||
// public String format(final DomainObject obj,
|
|
||||||
// final String attribute,
|
|
||||||
// final PageState state) {
|
|
||||||
// final GenericAddress address = ((GenericContact) obj).getAddress();
|
|
||||||
// if ((address == null) || (address.getAddress() == null)) {
|
|
||||||
// return (String) GlobalizationUtil.globalize(
|
|
||||||
// "cms.ui.unknown").localize();
|
|
||||||
// } else {
|
|
||||||
// return address.getAddress();
|
|
||||||
//
|
|
||||||
// }
|
|
||||||
// }
|
|
||||||
//
|
|
||||||
// });
|
|
||||||
// if (!GenericContact.getConfig().getHideAddressPostalCode()) {
|
|
||||||
// sheet.add(ContenttypesGlobalizationUtil.globalize(
|
|
||||||
// "cms.contenttypes.ui.address.postal_code"),
|
|
||||||
// "address." + GenericAddress.POSTAL_CODE,
|
|
||||||
// new DomainObjectPropertySheet.AttributeFormatter() {
|
|
||||||
//
|
|
||||||
// @Override
|
|
||||||
// public String format(final DomainObject obj,
|
|
||||||
// final String attribute,
|
|
||||||
// final PageState state) {
|
|
||||||
// final GenericAddress address = ((GenericContact) obj).getAddress();
|
|
||||||
// if ((address == null) || (address.getPostalCode() == null)) {
|
|
||||||
// return (String) GlobalizationUtil.globalize(
|
|
||||||
// "cms.ui.unknown").localize();
|
|
||||||
// } else {
|
|
||||||
// return address.getPostalCode();
|
|
||||||
//
|
|
||||||
// }
|
|
||||||
//
|
|
||||||
// }
|
|
||||||
//
|
|
||||||
// });
|
|
||||||
// }
|
|
||||||
// sheet.add(ContenttypesGlobalizationUtil.globalize(
|
|
||||||
// "cms.contenttypes.ui.address.city"),
|
|
||||||
// "address." + GenericAddress.CITY,
|
|
||||||
// new DomainObjectPropertySheet.AttributeFormatter() {
|
|
||||||
//
|
|
||||||
// @Override
|
|
||||||
// public String format(final DomainObject obj,
|
|
||||||
// final String attribute,
|
|
||||||
// final PageState state) {
|
|
||||||
// final GenericAddress address = ((GenericContact) obj).getAddress();
|
|
||||||
// if ((address == null) || (address.getCity() == null)) {
|
|
||||||
// return (String) GlobalizationUtil.globalize(
|
|
||||||
// "cms.ui.unknown").localize();
|
|
||||||
// } else {
|
|
||||||
// return address.getCity();
|
|
||||||
//
|
|
||||||
// }
|
|
||||||
//
|
|
||||||
// }
|
|
||||||
//
|
|
||||||
// });
|
|
||||||
// if (!GenericContact.getConfig().getHideAddressState()) {
|
|
||||||
// sheet.add(ContenttypesGlobalizationUtil.globalize(
|
|
||||||
// "cms.contenttypes.ui.address.state"),
|
|
||||||
// "address." + GenericAddress.STATE,
|
|
||||||
// new DomainObjectPropertySheet.AttributeFormatter() {
|
|
||||||
//
|
|
||||||
// @Override
|
|
||||||
// public String format(final DomainObject obj,
|
|
||||||
// final String attribute,
|
|
||||||
// final PageState state) {
|
|
||||||
// final GenericAddress address = ((GenericContact) obj).getAddress();
|
|
||||||
// if ((address == null) || (address.getState() == null)) {
|
|
||||||
// return (String) GlobalizationUtil.globalize(
|
|
||||||
// "cms.ui.unknown").localize();
|
|
||||||
// } else {
|
|
||||||
// return address.getState();
|
|
||||||
//
|
|
||||||
// }
|
|
||||||
//
|
|
||||||
// }
|
|
||||||
//
|
|
||||||
// });
|
|
||||||
// }
|
|
||||||
//
|
|
||||||
// if (!GenericContact.getConfig().getHideAddressCountry()) {
|
|
||||||
// sheet.add(ContenttypesGlobalizationUtil.globalize(
|
|
||||||
// "cms.contenttypes.ui.address.iso_country_code"),
|
|
||||||
// "address." + GenericAddress.ISO_COUNTRY_CODE,
|
|
||||||
// new DomainObjectPropertySheet.AttributeFormatter() {
|
|
||||||
//
|
|
||||||
// @Override
|
|
||||||
// public String format(DomainObject item,
|
|
||||||
// String attribute,
|
|
||||||
// PageState state) {
|
|
||||||
// GenericAddress address = ((GenericContact) item).getAddress();
|
|
||||||
// if (address != null && address.getIsoCountryCode() != null) {
|
|
||||||
// return GenericAddress.getCountryNameFromIsoCode(address.
|
|
||||||
// getIsoCountryCode());
|
|
||||||
// } else {
|
|
||||||
// return (String) GlobalizationUtil.globalize(
|
|
||||||
// "cms.ui.unknown").localize();
|
|
||||||
// }
|
|
||||||
// }
|
|
||||||
//
|
|
||||||
// });
|
|
||||||
// }
|
|
||||||
//
|
|
||||||
// return sheet;
|
|
||||||
//
|
|
||||||
// }
|
|
||||||
//
|
|
||||||
// public static Component getEmptyBaseAddressPropertySheet(
|
|
||||||
// ItemSelectionModel itemModel) {
|
|
||||||
// return new Label(
|
|
||||||
// (ContenttypesGlobalizationUtil.globalize(
|
|
||||||
// "cms.contenttypes.ui.contact.emptyAddress")));
|
|
||||||
// }
|
|
||||||
//
|
|
||||||
// private class EditAddressWorkflowLockedComponentAccess
|
|
||||||
// extends WorkflowLockedComponentAccess {
|
|
||||||
//
|
|
||||||
// public EditAddressWorkflowLockedComponentAccess(Component c,
|
|
||||||
// ItemSelectionModel i) {
|
|
||||||
// super(c, i);
|
|
||||||
// }
|
|
||||||
//
|
|
||||||
// @Override
|
|
||||||
// public boolean isVisible(PageState state) {
|
|
||||||
// GenericContact contact = (GenericContact) itemModel.
|
|
||||||
// getSelectedObject(state);
|
|
||||||
//
|
|
||||||
// return contact.hasAddress();
|
|
||||||
// }
|
|
||||||
//
|
|
||||||
// }
|
|
||||||
//
|
|
||||||
// private class AttachAddressWorkflowLockedComponentAccess extends WorkflowLockedComponentAccess {
|
|
||||||
//
|
|
||||||
// public AttachAddressWorkflowLockedComponentAccess(Component c,
|
|
||||||
// ItemSelectionModel i) {
|
|
||||||
// super(c, i);
|
|
||||||
// }
|
|
||||||
//
|
|
||||||
// @Override
|
|
||||||
// public boolean isVisible(PageState state) {
|
|
||||||
// GenericContact contact = (GenericContact) itemModel.
|
|
||||||
// getSelectedObject(state);
|
|
||||||
//
|
|
||||||
// return !contact.hasAddress();
|
|
||||||
// }
|
|
||||||
//
|
|
||||||
// }
|
|
||||||
}
|
}
|
||||||
|
|
|
||||||
|
|
@ -47,12 +47,12 @@ public class GenericContactAddressSheet extends Table implements TableActionList
|
||||||
final TableColumnModel colModel = getColumnModel();
|
final TableColumnModel colModel = getColumnModel();
|
||||||
colModel.add(new TableColumn(
|
colModel.add(new TableColumn(
|
||||||
0,
|
0,
|
||||||
new Label(""),
|
new Label(),
|
||||||
TABLE_COL_EDIT));
|
TABLE_COL_EDIT));
|
||||||
|
|
||||||
colModel.add(new TableColumn(
|
colModel.add(new TableColumn(
|
||||||
1,
|
1,
|
||||||
new Label(""),
|
new Label(),
|
||||||
TABLE_COL_DEL));
|
TABLE_COL_DEL));
|
||||||
|
|
||||||
setModelBuilder(new GenericContactAddressTableModelBuilder(itemModel));
|
setModelBuilder(new GenericContactAddressTableModelBuilder(itemModel));
|
||||||
|
|
@ -63,11 +63,14 @@ public class GenericContactAddressSheet extends Table implements TableActionList
|
||||||
addTableActionListener(this);
|
addTableActionListener(this);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
*
|
||||||
|
*/
|
||||||
private class GenericContactAddressTableModelBuilder
|
private class GenericContactAddressTableModelBuilder
|
||||||
extends LockableImpl
|
extends LockableImpl
|
||||||
implements TableModelBuilder {
|
implements TableModelBuilder {
|
||||||
|
|
||||||
private ItemSelectionModel itemModel;
|
private final ItemSelectionModel itemModel;
|
||||||
|
|
||||||
public GenericContactAddressTableModelBuilder(final ItemSelectionModel itemModel) {
|
public GenericContactAddressTableModelBuilder(final ItemSelectionModel itemModel) {
|
||||||
this.itemModel = itemModel;
|
this.itemModel = itemModel;
|
||||||
|
|
|
||||||
|
|
@ -2,7 +2,7 @@ package com.arsdigita.cms.contenttypes.ui;
|
||||||
|
|
||||||
import com.arsdigita.bebop.FormData;
|
import com.arsdigita.bebop.FormData;
|
||||||
import com.arsdigita.bebop.FormProcessException;
|
import com.arsdigita.bebop.FormProcessException;
|
||||||
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;
|
||||||
|
|
@ -72,12 +72,14 @@ public class GenericContactAttachAddressPropertyForm extends BasicPageForm
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
public void addWidgets() {
|
public void addWidgets() {
|
||||||
add(new Label(ContenttypesGlobalizationUtil.globalize(
|
// add(new Label(ContenttypesGlobalizationUtil.globalize(
|
||||||
"cms.contenttypes.ui.contact.select_address")));
|
// "cms.contenttypes.ui.contact.select_address")));
|
||||||
this.m_itemSearch = new ItemSearchWidget(ITEM_SEARCH, ContentType.
|
this.m_itemSearch = new ItemSearchWidget(ITEM_SEARCH, ContentType.
|
||||||
findByAssociatedObjectType(
|
findByAssociatedObjectType(
|
||||||
"com.arsdigita.cms.contenttypes.GenericAddress"));
|
"com.arsdigita.cms.contenttypes.GenericAddress"));
|
||||||
m_itemSearch.setDisableCreatePane(true);
|
m_itemSearch.setDisableCreatePane(true);
|
||||||
|
m_itemSearch.setLabel(ContenttypesGlobalizationUtil.globalize(
|
||||||
|
"cms.contenttypes.ui.contact.select_address"));
|
||||||
add(this.m_itemSearch);
|
add(this.m_itemSearch);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
@ -145,6 +147,11 @@ public class GenericContactAttachAddressPropertyForm extends BasicPageForm
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
*
|
||||||
|
* @param e
|
||||||
|
* @throws FormProcessException
|
||||||
|
*/
|
||||||
@Override
|
@Override
|
||||||
public void validate(FormSectionEvent e) throws FormProcessException {
|
public void validate(FormSectionEvent e) throws FormProcessException {
|
||||||
//Calling super.validate(e) here causes an exception because the super method checks things which not available
|
//Calling super.validate(e) here causes an exception because the super method checks things which not available
|
||||||
|
|
@ -154,10 +161,10 @@ public class GenericContactAttachAddressPropertyForm extends BasicPageForm
|
||||||
final FormData data = e.getFormData();
|
final FormData data = e.getFormData();
|
||||||
|
|
||||||
if (data.get(ITEM_SEARCH) == null) {
|
if (data.get(ITEM_SEARCH) == null) {
|
||||||
throw new FormProcessException((String) ContenttypesGlobalizationUtil.
|
throw new FormProcessException(ContenttypesGlobalizationUtil.
|
||||||
globalize(
|
globalize(
|
||||||
"cms.contenttypes.ui.contact.select_address.wrong_type").
|
"cms.contenttypes.ui.contact.select_address.wrong_type")
|
||||||
localize());
|
);
|
||||||
}
|
}
|
||||||
|
|
||||||
GenericContact contact = (GenericContact) getItemSelectionModel().
|
GenericContact contact = (GenericContact) getItemSelectionModel().
|
||||||
|
|
@ -173,14 +180,19 @@ public class GenericContactAttachAddressPropertyForm extends BasicPageForm
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
*
|
||||||
|
* @param e
|
||||||
|
* @throws FormProcessException
|
||||||
|
*/
|
||||||
@Override
|
@Override
|
||||||
public void submitted(FormSectionEvent e) throws FormProcessException {
|
public void submitted(FormSectionEvent e) throws FormProcessException {
|
||||||
if (getSaveCancelSection().getCancelButton().isSelected(e.getPageState())) {
|
if (getSaveCancelSection().getCancelButton().isSelected(e.getPageState())) {
|
||||||
init(e);
|
init(e);
|
||||||
throw new FormProcessException((String) ContenttypesGlobalizationUtil.
|
throw new FormProcessException(ContenttypesGlobalizationUtil.
|
||||||
globalize(
|
globalize(
|
||||||
"cms.contenttypes.ui.contact.select_address.cancelled").
|
"cms.contenttypes.ui.contact.select_address.cancelled")
|
||||||
localize());
|
);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
@ -1,3 +1,21 @@
|
||||||
|
/*
|
||||||
|
* Copyright (C) 2013 University of Bremen. All Rights Reserved.
|
||||||
|
*
|
||||||
|
* This library is free software; you can redistribute it and/or
|
||||||
|
* modify it under the terms of the GNU Lesser General Public License
|
||||||
|
* as published by the Free Software Foundation; either version 2.1 of
|
||||||
|
* the License, or (at your option) any later version.
|
||||||
|
*
|
||||||
|
* This library is distributed in the hope that it will be useful,
|
||||||
|
* but WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||||
|
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
|
||||||
|
* Lesser General Public License for more details.
|
||||||
|
*
|
||||||
|
* You should have received a copy of the GNU Lesser General Public
|
||||||
|
* License along with this library; if not, write to the Free Software
|
||||||
|
* Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
|
||||||
|
*
|
||||||
|
*/
|
||||||
package com.arsdigita.cms.contenttypes.ui;
|
package com.arsdigita.cms.contenttypes.ui;
|
||||||
|
|
||||||
import com.arsdigita.bebop.FormData;
|
import com.arsdigita.bebop.FormData;
|
||||||
|
|
@ -84,11 +102,13 @@ public class GenericContactAttachPersonPropertyForm extends BasicPageForm
|
||||||
@Override
|
@Override
|
||||||
public void addWidgets() {
|
public void addWidgets() {
|
||||||
|
|
||||||
add(new Label(ContenttypesGlobalizationUtil.globalize(
|
//add(new Label(ContenttypesGlobalizationUtil.globalize(
|
||||||
"cms.contenttypes.ui.contact.select_person")));
|
// "cms.contenttypes.ui.contact.select_person")));
|
||||||
this.m_itemSearch = new ItemSearchWidget(ITEM_SEARCH, ContentType.
|
this.m_itemSearch = new ItemSearchWidget(ITEM_SEARCH, ContentType.
|
||||||
findByAssociatedObjectType(
|
findByAssociatedObjectType(
|
||||||
"com.arsdigita.cms.contenttypes.GenericPerson"));
|
"com.arsdigita.cms.contenttypes.GenericPerson"));
|
||||||
|
m_itemSearch.setLabel(ContenttypesGlobalizationUtil.globalize(
|
||||||
|
"cms.contenttypes.ui.contact.select_person"));
|
||||||
m_itemSearch.setDisableCreatePane(true);
|
m_itemSearch.setDisableCreatePane(true);
|
||||||
add(this.m_itemSearch);
|
add(this.m_itemSearch);
|
||||||
|
|
||||||
|
|
@ -128,6 +148,7 @@ public class GenericContactAttachPersonPropertyForm extends BasicPageForm
|
||||||
add(contactType);
|
add(contactType);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
public void init(FormSectionEvent fse) {
|
public void init(FormSectionEvent fse) {
|
||||||
FormData data = fse.getFormData();
|
FormData data = fse.getFormData();
|
||||||
PageState state = fse.getPageState();
|
PageState state = fse.getPageState();
|
||||||
|
|
@ -142,6 +163,7 @@ public class GenericContactAttachPersonPropertyForm extends BasicPageForm
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
public void process(FormSectionEvent fse) {
|
public void process(FormSectionEvent fse) {
|
||||||
FormData data = fse.getFormData();
|
FormData data = fse.getFormData();
|
||||||
PageState state = fse.getPageState();
|
PageState state = fse.getPageState();
|
||||||
|
|
@ -167,6 +189,7 @@ public class GenericContactAttachPersonPropertyForm extends BasicPageForm
|
||||||
try {
|
try {
|
||||||
getSaveCancelSection().getSaveButton().addPrintListener(new PrintListener() {
|
getSaveCancelSection().getSaveButton().addPrintListener(new PrintListener() {
|
||||||
|
|
||||||
|
@Override
|
||||||
public void prepare(PrintEvent e) {
|
public void prepare(PrintEvent e) {
|
||||||
GenericContact contact = (GenericContact) getItemSelectionModel().
|
GenericContact contact = (GenericContact) getItemSelectionModel().
|
||||||
getSelectedObject(e.getPageState());
|
getSelectedObject(e.getPageState());
|
||||||
|
|
@ -191,17 +214,16 @@ public class GenericContactAttachPersonPropertyForm extends BasicPageForm
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
public void validate(FormSectionEvent e) throws FormProcessException {
|
public void validate(FormSectionEvent e) throws FormProcessException {
|
||||||
//Calling super.validate(e) here causes an exception because the super method checks things which not available
|
//Calling super.validate(e) here causes an exception because the
|
||||||
//here.
|
//super method checks things which not available here.
|
||||||
|
|
||||||
final PageState state = e.getPageState();
|
final PageState state = e.getPageState();
|
||||||
final FormData data = e.getFormData();
|
final FormData data = e.getFormData();
|
||||||
|
|
||||||
if (data.get(ITEM_SEARCH) == null) {
|
if (data.get(ITEM_SEARCH) == null) {
|
||||||
throw new FormProcessException((String) ContenttypesGlobalizationUtil.
|
throw new FormProcessException(ContenttypesGlobalizationUtil.
|
||||||
globalize(
|
globalize(
|
||||||
"cms.contenttypes.ui.contact.select_person.wrong_type").
|
"cms.contenttypes.ui.contact.select_person.wrong_type"));
|
||||||
localize());
|
|
||||||
}
|
}
|
||||||
|
|
||||||
GenericContact contact = (GenericContact) getItemSelectionModel().
|
GenericContact contact = (GenericContact) getItemSelectionModel().
|
||||||
|
|
@ -211,19 +233,20 @@ public class GenericContactAttachPersonPropertyForm extends BasicPageForm
|
||||||
if (!(person.getContentBundle().hasInstance(contact.getLanguage(),
|
if (!(person.getContentBundle().hasInstance(contact.getLanguage(),
|
||||||
Kernel.getConfig().
|
Kernel.getConfig().
|
||||||
languageIndependentItems()))) {
|
languageIndependentItems()))) {
|
||||||
data.addError(
|
data.addError(ContenttypesGlobalizationUtil.
|
||||||
"cms.contenttypes.ui.contact.select_person.no_suitable_language_variant");
|
globalize(
|
||||||
|
"cms.contenttypes.ui.contact.select_person.no_suitable_language_variant"));
|
||||||
}
|
}
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
public void submitted(FormSectionEvent e) throws FormProcessException {
|
public void submitted(FormSectionEvent e) throws FormProcessException {
|
||||||
if (getSaveCancelSection().getCancelButton().isSelected(e.getPageState())) {
|
if (getSaveCancelSection().getCancelButton().isSelected(e.getPageState())) {
|
||||||
init(e);
|
init(e);
|
||||||
throw new FormProcessException((String) ContenttypesGlobalizationUtil.
|
throw new FormProcessException(ContenttypesGlobalizationUtil.
|
||||||
globalize(
|
globalize(
|
||||||
"cms.contenttypes.ui.contact.select_person.cancelled").
|
"cms.contenttypes.ui.contact.select_person.cancelled"));
|
||||||
localize());
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
||||||
|
|
@ -56,6 +56,7 @@ public class GenericContactDeleteAddressForm extends BasicPageForm implements Fo
|
||||||
try {
|
try {
|
||||||
getSaveCancelSection().getSaveButton().addPrintListener(new PrintListener() {
|
getSaveCancelSection().getSaveButton().addPrintListener(new PrintListener() {
|
||||||
|
|
||||||
|
@Override
|
||||||
public void prepare(PrintEvent e) {
|
public void prepare(PrintEvent e) {
|
||||||
GenericContact contact = (GenericContact)
|
GenericContact contact = (GenericContact)
|
||||||
getItemSelectionModel()
|
getItemSelectionModel()
|
||||||
|
|
@ -71,6 +72,7 @@ public class GenericContactDeleteAddressForm extends BasicPageForm implements Fo
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
public final void process(final FormSectionEvent fse) throws FormProcessException {
|
public final void process(final FormSectionEvent fse) throws FormProcessException {
|
||||||
|
|
||||||
final PageState state = fse.getPageState();
|
final PageState state = fse.getPageState();
|
||||||
|
|
|
||||||
|
|
@ -41,6 +41,7 @@ public class GenericContactDeletePersonForm extends BasicPageForm
|
||||||
addSaveCancelSection();
|
addSaveCancelSection();
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
public void init(FormSectionEvent fse) {
|
public void init(FormSectionEvent fse) {
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
@ -74,6 +75,7 @@ public class GenericContactDeletePersonForm extends BasicPageForm
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
public final void process(final FormSectionEvent fse) throws FormProcessException {
|
public final void process(final FormSectionEvent fse) throws FormProcessException {
|
||||||
|
|
||||||
final PageState state = fse.getPageState();
|
final PageState state = fse.getPageState();
|
||||||
|
|
|
||||||
|
|
@ -55,7 +55,9 @@ public class GenericContactEntriesTable extends Table implements TableActionList
|
||||||
private ItemSelectionModel m_itemModel;
|
private ItemSelectionModel m_itemModel;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Creates a new instance of GenericContactEntriesTable
|
* Creates a new instance of GenericContactEntriesTable.
|
||||||
|
*
|
||||||
|
* @param itemModel
|
||||||
*/
|
*/
|
||||||
public GenericContactEntriesTable(final ItemSelectionModel itemModel) {
|
public GenericContactEntriesTable(final ItemSelectionModel itemModel) {
|
||||||
|
|
||||||
|
|
@ -109,6 +111,7 @@ public class GenericContactEntriesTable extends Table implements TableActionList
|
||||||
m_itemModel = itemModel;
|
m_itemModel = itemModel;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
public TableModel makeModel(Table table, PageState state) {
|
public TableModel makeModel(Table table, PageState state) {
|
||||||
|
|
||||||
table.getRowSelectionModel().clearSelection(state);
|
table.getRowSelectionModel().clearSelection(state);
|
||||||
|
|
@ -162,6 +165,7 @@ public class GenericContactEntriesTable extends Table implements TableActionList
|
||||||
* Return the
|
* Return the
|
||||||
* @see com.arsdigita.bebop.table.TableModel#getElementAt(int)
|
* @see com.arsdigita.bebop.table.TableModel#getElementAt(int)
|
||||||
*/
|
*/
|
||||||
|
@Override
|
||||||
public Object getElementAt(int columnIndex) {
|
public Object getElementAt(int columnIndex) {
|
||||||
switch (columnIndex) {
|
switch (columnIndex) {
|
||||||
case 0:
|
case 0:
|
||||||
|
|
@ -295,6 +299,7 @@ public class GenericContactEntriesTable extends Table implements TableActionList
|
||||||
* provide Implementation to TableActionListener method.
|
* provide Implementation to TableActionListener method.
|
||||||
* Does nothing in our case.
|
* Does nothing in our case.
|
||||||
*/
|
*/
|
||||||
|
@Override
|
||||||
public void headSelected(TableActionEvent e) {
|
public void headSelected(TableActionEvent e) {
|
||||||
throw new UnsupportedOperationException("Not Implemented");
|
throw new UnsupportedOperationException("Not Implemented");
|
||||||
}
|
}
|
||||||
|
|
|
||||||
|
|
@ -54,7 +54,9 @@ public class GenericContactEntryAddForm extends BasicItemForm {
|
||||||
private ItemSelectionModel m_itemModel;
|
private ItemSelectionModel m_itemModel;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Creates a new instance of CategoryLocalizationAddForm
|
* Creates a new instance of CategoryLocalizationAddForm.
|
||||||
|
*
|
||||||
|
* @param itemModel
|
||||||
*/
|
*/
|
||||||
public GenericContactEntryAddForm(ItemSelectionModel itemModel) {
|
public GenericContactEntryAddForm(ItemSelectionModel itemModel) {
|
||||||
|
|
||||||
|
|
@ -121,6 +123,7 @@ public class GenericContactEntryAddForm extends BasicItemForm {
|
||||||
*
|
*
|
||||||
* @param fse
|
* @param fse
|
||||||
*/
|
*/
|
||||||
|
@Override
|
||||||
public void init(FormSectionEvent fse) {
|
public void init(FormSectionEvent fse) {
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
@ -129,6 +132,7 @@ public class GenericContactEntryAddForm extends BasicItemForm {
|
||||||
*
|
*
|
||||||
* @param fse
|
* @param fse
|
||||||
*/
|
*/
|
||||||
|
@Override
|
||||||
public void process(FormSectionEvent fse) {
|
public void process(FormSectionEvent fse) {
|
||||||
FormData data = fse.getFormData();
|
FormData data = fse.getFormData();
|
||||||
GenericContact contact = (GenericContact) m_itemModel.getSelectedObject(fse.getPageState());
|
GenericContact contact = (GenericContact) m_itemModel.getSelectedObject(fse.getPageState());
|
||||||
|
|
|
||||||
|
|
@ -50,7 +50,10 @@ public class GenericContactPersonPropertiesStep extends SimpleEditStep {
|
||||||
// private WorkflowLockedComponentAccess delPerson;
|
// private WorkflowLockedComponentAccess delPerson;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Creates a new instance of GenericContactPersonPropertiesStep
|
* Creates a new instance of GenericContactPersonPropertiesStep.
|
||||||
|
*
|
||||||
|
* @param itemModel
|
||||||
|
* @param parent
|
||||||
*/
|
*/
|
||||||
public GenericContactPersonPropertiesStep(ItemSelectionModel itemModel,
|
public GenericContactPersonPropertiesStep(ItemSelectionModel itemModel,
|
||||||
AuthoringKitWizard parent) {
|
AuthoringKitWizard parent) {
|
||||||
|
|
|
||||||
|
|
@ -72,7 +72,6 @@ public class GenericContactPersonSheet extends Table implements TableActionListe
|
||||||
colModel.add(new TableColumn(
|
colModel.add(new TableColumn(
|
||||||
0,
|
0,
|
||||||
new Label(ContenttypesGlobalizationUtil.globalize(
|
new Label(ContenttypesGlobalizationUtil.globalize(
|
||||||
// "cms.contenttypes.ui.contact.person").localize(),
|
|
||||||
"cms.contenttypes.ui.genericcontact.person")),
|
"cms.contenttypes.ui.genericcontact.person")),
|
||||||
TABLE_COL_EDIT));
|
TABLE_COL_EDIT));
|
||||||
colModel.add(new TableColumn(
|
colModel.add(new TableColumn(
|
||||||
|
|
|
||||||
|
|
@ -1,3 +1,22 @@
|
||||||
|
/*
|
||||||
|
* Copyright (C) 2011-2013 Universitaet Bremen. All Rights Reserved.
|
||||||
|
*
|
||||||
|
* This library is free software; you can redistribute it and/or
|
||||||
|
* modify it under the terms of the GNU Lesser General Public License
|
||||||
|
* as published by the Free Software Foundation; either version 2.1 of
|
||||||
|
* the License, or (at your option) any later version.
|
||||||
|
*
|
||||||
|
* This library is distributed in the hope that it will be useful,
|
||||||
|
* but WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||||
|
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
|
||||||
|
* Lesser General Public License for more details.
|
||||||
|
*
|
||||||
|
* You should have received a copy of the GNU Lesser General Public
|
||||||
|
* License along with this library; if not, write to the Free Software
|
||||||
|
* Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
|
||||||
|
*
|
||||||
|
*/
|
||||||
|
|
||||||
package com.arsdigita.cms.contenttypes.ui;
|
package com.arsdigita.cms.contenttypes.ui;
|
||||||
|
|
||||||
import com.arsdigita.bebop.PageState;
|
import com.arsdigita.bebop.PageState;
|
||||||
|
|
|
||||||
|
|
@ -36,7 +36,6 @@ import com.arsdigita.cms.ContentType;
|
||||||
import com.arsdigita.cms.ItemSelectionModel;
|
import com.arsdigita.cms.ItemSelectionModel;
|
||||||
import com.arsdigita.cms.RelationAttribute;
|
import com.arsdigita.cms.RelationAttribute;
|
||||||
import com.arsdigita.cms.contenttypes.GenericContact;
|
import com.arsdigita.cms.contenttypes.GenericContact;
|
||||||
import com.arsdigita.cms.contenttypes.GenericContactTypeCollection;
|
|
||||||
import com.arsdigita.cms.contenttypes.GenericOrganizationContactTypeCollection;
|
import com.arsdigita.cms.contenttypes.GenericOrganizationContactTypeCollection;
|
||||||
import com.arsdigita.cms.contenttypes.GenericOrganizationalUnit;
|
import com.arsdigita.cms.contenttypes.GenericOrganizationalUnit;
|
||||||
import com.arsdigita.cms.contenttypes.GenericOrganizationalUnitContactCollection;
|
import com.arsdigita.cms.contenttypes.GenericOrganizationalUnitContactCollection;
|
||||||
|
|
@ -46,8 +45,9 @@ import com.arsdigita.cms.ui.authoring.BasicItemForm;
|
||||||
import com.arsdigita.globalization.GlobalizationHelper;
|
import com.arsdigita.globalization.GlobalizationHelper;
|
||||||
import com.arsdigita.kernel.Kernel;
|
import com.arsdigita.kernel.Kernel;
|
||||||
import com.arsdigita.util.UncheckedWrapperException;
|
import com.arsdigita.util.UncheckedWrapperException;
|
||||||
|
|
||||||
import java.util.TooManyListenersException;
|
import java.util.TooManyListenersException;
|
||||||
import java.util.logging.Level;
|
|
||||||
import org.apache.log4j.Logger;
|
import org.apache.log4j.Logger;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
|
|
@ -79,15 +79,17 @@ public class GenericOrganizationalUnitContactAddForm
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
protected void addWidgets() {
|
protected void addWidgets() {
|
||||||
add(new Label(ContenttypesGlobalizationUtil.globalize(
|
// add(new Label(ContenttypesGlobalizationUtil.globalize(
|
||||||
"cms.contenttypes.ui.genericorgaunit.select_contact")));
|
// "cms.contenttypes.ui.genericorgaunit.select_contact")));
|
||||||
m_itemSearch = new ItemSearchWidget(ITEM_SEARCH, ContentType.
|
m_itemSearch = new ItemSearchWidget(ITEM_SEARCH, ContentType.
|
||||||
findByAssociatedObjectType(GenericContact.class
|
findByAssociatedObjectType(GenericContact.class
|
||||||
.getName()));
|
.getName()));
|
||||||
|
m_itemSearch.setLabel(ContenttypesGlobalizationUtil.globalize(
|
||||||
|
"cms.contenttypes.ui.genericorgaunit.select_contact"));
|
||||||
m_itemSearch.setDisableCreatePane(false);
|
m_itemSearch.setDisableCreatePane(false);
|
||||||
add(m_itemSearch);
|
add(m_itemSearch);
|
||||||
|
|
||||||
selectedContactLabel = new Label("");
|
selectedContactLabel = new Label();
|
||||||
add(selectedContactLabel);
|
add(selectedContactLabel);
|
||||||
|
|
||||||
ParameterModel contactTypeParam = new StringParameter(
|
ParameterModel contactTypeParam = new StringParameter(
|
||||||
|
|
@ -213,8 +215,8 @@ public class GenericOrganizationalUnitContactAddForm
|
||||||
|
|
||||||
if ((editStep.getSelectedContact() == null)
|
if ((editStep.getSelectedContact() == null)
|
||||||
&& (data.get(ITEM_SEARCH) == null)) {
|
&& (data.get(ITEM_SEARCH) == null)) {
|
||||||
data.addError(
|
data.addError((ContenttypesGlobalizationUtil.globalize(
|
||||||
"cms.contenttypes.ui.genericorgaunit.select_contact.no_contact_selected");
|
"cms.contenttypes.ui.genericorgaunit.select_contact.no_contact_selected")));
|
||||||
|
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
|
|
||||||
|
|
@ -35,7 +35,6 @@ import com.arsdigita.cms.ContentSection;
|
||||||
import com.arsdigita.cms.ItemSelectionModel;
|
import com.arsdigita.cms.ItemSelectionModel;
|
||||||
import com.arsdigita.cms.SecurityManager;
|
import com.arsdigita.cms.SecurityManager;
|
||||||
import com.arsdigita.cms.contenttypes.GenericContact;
|
import com.arsdigita.cms.contenttypes.GenericContact;
|
||||||
import com.arsdigita.cms.contenttypes.GenericContactTypeCollection;
|
|
||||||
import com.arsdigita.cms.contenttypes.GenericOrganizationContactTypeCollection;
|
import com.arsdigita.cms.contenttypes.GenericOrganizationContactTypeCollection;
|
||||||
import com.arsdigita.cms.contenttypes.GenericOrganizationalUnit;
|
import com.arsdigita.cms.contenttypes.GenericOrganizationalUnit;
|
||||||
import com.arsdigita.cms.contenttypes.GenericOrganizationalUnitContactCollection;
|
import com.arsdigita.cms.contenttypes.GenericOrganizationalUnitContactCollection;
|
||||||
|
|
@ -92,22 +91,22 @@ public class GenericOrganizationalUnitContactTable extends Table implements
|
||||||
tabModel.add(new TableColumn(
|
tabModel.add(new TableColumn(
|
||||||
2,
|
2,
|
||||||
ContenttypesGlobalizationUtil.globalize(
|
ContenttypesGlobalizationUtil.globalize(
|
||||||
"cms.contenttypes.ui.genericorgaunit.contact.edit").localize(),
|
"cms.contenttypes.ui.genericorgaunit.contact.edit"),
|
||||||
TABLE_COL_EDIT_ASSOC));
|
TABLE_COL_EDIT_ASSOC));
|
||||||
tabModel.add(new TableColumn(
|
tabModel.add(new TableColumn(
|
||||||
3,
|
3,
|
||||||
ContenttypesGlobalizationUtil.globalize(
|
ContenttypesGlobalizationUtil.globalize(
|
||||||
"cms.contenttypes.ui.genericorgaunit.contact.action").localize(),
|
"cms.contenttypes.ui.genericorgaunit.contact.action"),
|
||||||
TABLE_COL_DEL));
|
TABLE_COL_DEL));
|
||||||
tabModel.add(new TableColumn(
|
tabModel.add(new TableColumn(
|
||||||
4,
|
4,
|
||||||
ContenttypesGlobalizationUtil.globalize(
|
ContenttypesGlobalizationUtil.globalize(
|
||||||
"cms.contenttypes.ui.genericorgaunit.contact.up").localize(),
|
"cms.contenttypes.ui.genericorgaunit.contact.up"),
|
||||||
TABLE_COL_UP));
|
TABLE_COL_UP));
|
||||||
tabModel.add(new TableColumn(
|
tabModel.add(new TableColumn(
|
||||||
5,
|
5,
|
||||||
ContenttypesGlobalizationUtil.globalize(
|
ContenttypesGlobalizationUtil.globalize(
|
||||||
"cms.contenttypes.ui.genericorgaunit.contact.down").localize(),
|
"cms.contenttypes.ui.genericorgaunit.contact.down"),
|
||||||
TABLE_COL_DOWN));
|
TABLE_COL_DOWN));
|
||||||
|
|
||||||
setModelBuilder(
|
setModelBuilder(
|
||||||
|
|
@ -230,6 +229,7 @@ public class GenericOrganizationalUnitContactTable extends Table implements
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
public Object getKeyAt(int columnIndex) {
|
public Object getKeyAt(int columnIndex) {
|
||||||
return m_contact.getID();
|
return m_contact.getID();
|
||||||
}
|
}
|
||||||
|
|
@ -239,6 +239,7 @@ public class GenericOrganizationalUnitContactTable extends Table implements
|
||||||
extends LockableImpl
|
extends LockableImpl
|
||||||
implements TableCellRenderer {
|
implements TableCellRenderer {
|
||||||
|
|
||||||
|
@Override
|
||||||
public Component getComponent(
|
public Component getComponent(
|
||||||
Table table,
|
Table table,
|
||||||
PageState state,
|
PageState state,
|
||||||
|
|
@ -293,6 +294,7 @@ public class GenericOrganizationalUnitContactTable extends Table implements
|
||||||
extends LockableImpl
|
extends LockableImpl
|
||||||
implements TableCellRenderer {
|
implements TableCellRenderer {
|
||||||
|
|
||||||
|
@Override
|
||||||
public Component getComponent(
|
public Component getComponent(
|
||||||
Table table,
|
Table table,
|
||||||
PageState state,
|
PageState state,
|
||||||
|
|
@ -343,10 +345,10 @@ public class GenericOrganizationalUnitContactTable extends Table implements
|
||||||
orgaunit);
|
orgaunit);
|
||||||
if (canDelete) {
|
if (canDelete) {
|
||||||
ControlLink link = new ControlLink(value.toString());
|
ControlLink link = new ControlLink(value.toString());
|
||||||
link.setConfirmation((String) ContenttypesGlobalizationUtil.
|
link.setConfirmation(ContenttypesGlobalizationUtil.
|
||||||
globalize(
|
globalize(
|
||||||
"cms.contenttypes.ui.genericorgaunit.confirm_delete").
|
"cms.contenttypes.ui.genericorgaunit.confirm_delete")
|
||||||
localize());
|
);
|
||||||
return link;
|
return link;
|
||||||
} else {
|
} else {
|
||||||
return new Label(value.toString());
|
return new Label(value.toString());
|
||||||
|
|
@ -369,7 +371,7 @@ public class GenericOrganizationalUnitContactTable extends Table implements
|
||||||
|
|
||||||
if (0 == row) {
|
if (0 == row) {
|
||||||
s_log.debug("Row is first row in table, don't show up-link");
|
s_log.debug("Row is first row in table, don't show up-link");
|
||||||
return new Label("");
|
return new Label();
|
||||||
} else {
|
} else {
|
||||||
ControlLink link = new ControlLink("up");
|
ControlLink link = new ControlLink("up");
|
||||||
return link;
|
return link;
|
||||||
|
|
@ -399,7 +401,7 @@ public class GenericOrganizationalUnitContactTable extends Table implements
|
||||||
|
|
||||||
if ((contacts.size() - 1) == row) {
|
if ((contacts.size() - 1) == row) {
|
||||||
s_log.debug("Row is last row in table, don't show down-link");
|
s_log.debug("Row is last row in table, don't show down-link");
|
||||||
return new Label("");
|
return new Label();
|
||||||
} else {
|
} else {
|
||||||
ControlLink link = new ControlLink("down");
|
ControlLink link = new ControlLink("down");
|
||||||
return link;
|
return link;
|
||||||
|
|
|
||||||
|
|
@ -78,16 +78,18 @@ public class GenericOrganizationalUnitPersonAddForm
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
protected void addWidgets() {
|
protected void addWidgets() {
|
||||||
add(new Label(ContenttypesGlobalizationUtil.globalize(
|
// add(new Label(ContenttypesGlobalizationUtil.globalize(
|
||||||
"cms.contenttypes.ui.genericorgaunit.select_person")));
|
// "cms.contenttypes.ui.genericorgaunit.select_person")));
|
||||||
m_itemSearch = new ItemSearchWidget(ITEM_SEARCH, ContentType.
|
m_itemSearch = new ItemSearchWidget(ITEM_SEARCH, ContentType.
|
||||||
findByAssociatedObjectType(getPersonType()));
|
findByAssociatedObjectType(getPersonType()));
|
||||||
/*m_itemSearch.getItemField().addValidationListener(
|
/*m_itemSearch.getItemField().addValidationListener(
|
||||||
new NotNullValidationListener());*/
|
new NotNullValidationListener());*/
|
||||||
|
m_itemSearch.setLabel(ContenttypesGlobalizationUtil.globalize(
|
||||||
|
"cms.contenttypes.ui.genericorgaunit.select_person"));
|
||||||
m_itemSearch.setDisableCreatePane(false);
|
m_itemSearch.setDisableCreatePane(false);
|
||||||
add(this.m_itemSearch);
|
add(this.m_itemSearch);
|
||||||
|
|
||||||
selectedPersonNameLabel = new Label("");
|
selectedPersonNameLabel = new Label();
|
||||||
add(selectedPersonNameLabel);
|
add(selectedPersonNameLabel);
|
||||||
|
|
||||||
ParameterModel roleParam = new StringParameter(
|
ParameterModel roleParam = new StringParameter(
|
||||||
|
|
|
||||||
|
|
@ -149,10 +149,12 @@ public class GenericOrganizationalUnitPersonsTable extends Table implements
|
||||||
size()));
|
size()));
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
public int getColumnCount() {
|
public int getColumnCount() {
|
||||||
return m_table.getColumnModel().size();
|
return m_table.getColumnModel().size();
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
public boolean nextRow() {
|
public boolean nextRow() {
|
||||||
boolean ret;
|
boolean ret;
|
||||||
|
|
||||||
|
|
@ -167,6 +169,7 @@ public class GenericOrganizationalUnitPersonsTable extends Table implements
|
||||||
return ret;
|
return ret;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
public Object getElementAt(int columnIndex) {
|
public Object getElementAt(int columnIndex) {
|
||||||
switch (columnIndex) {
|
switch (columnIndex) {
|
||||||
case 0:
|
case 0:
|
||||||
|
|
@ -208,6 +211,7 @@ public class GenericOrganizationalUnitPersonsTable extends Table implements
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
public Object getKeyAt(int columnIndex) {
|
public Object getKeyAt(int columnIndex) {
|
||||||
return m_person.getID();
|
return m_person.getID();
|
||||||
}
|
}
|
||||||
|
|
@ -217,6 +221,7 @@ public class GenericOrganizationalUnitPersonsTable extends Table implements
|
||||||
private class EditCellRenderer extends LockableImpl implements
|
private class EditCellRenderer extends LockableImpl implements
|
||||||
TableCellRenderer {
|
TableCellRenderer {
|
||||||
|
|
||||||
|
@Override
|
||||||
public Component getComponent(
|
public Component getComponent(
|
||||||
Table table,
|
Table table,
|
||||||
PageState state,
|
PageState state,
|
||||||
|
|
@ -307,6 +312,7 @@ public class GenericOrganizationalUnitPersonsTable extends Table implements
|
||||||
private class DeleteCellRenderer extends LockableImpl implements
|
private class DeleteCellRenderer extends LockableImpl implements
|
||||||
TableCellRenderer {
|
TableCellRenderer {
|
||||||
|
|
||||||
|
@Override
|
||||||
public Component getComponent(
|
public Component getComponent(
|
||||||
Table table,
|
Table table,
|
||||||
PageState state,
|
PageState state,
|
||||||
|
|
@ -325,10 +331,9 @@ public class GenericOrganizationalUnitPersonsTable extends Table implements
|
||||||
orgaunit);
|
orgaunit);
|
||||||
if (canEdit) {
|
if (canEdit) {
|
||||||
ControlLink link = new ControlLink(value.toString());
|
ControlLink link = new ControlLink(value.toString());
|
||||||
link.setConfirmation((String) ContenttypesGlobalizationUtil.
|
link.setConfirmation(ContenttypesGlobalizationUtil.
|
||||||
globalize(
|
globalize(
|
||||||
"cms.contenttypes.ui.genericorgaunit.persons.confirm_delete").
|
"cms.contenttypes.ui.genericorgaunit.persons.confirm_delete"));
|
||||||
localize());
|
|
||||||
return link;
|
return link;
|
||||||
} else {
|
} else {
|
||||||
return new Label(value.toString());
|
return new Label(value.toString());
|
||||||
|
|
|
||||||
|
|
@ -45,7 +45,7 @@ public class GenericOrganizationalUnitSubordinateOrgaUnitAddForm
|
||||||
implements FormProcessListener,
|
implements FormProcessListener,
|
||||||
FormInitListener {
|
FormInitListener {
|
||||||
|
|
||||||
private ItemSearchWidget itemSearch;
|
private final ItemSearchWidget itemSearch;
|
||||||
private final String ITEM_SEARCH = "subordinateOrgaUnits";
|
private final String ITEM_SEARCH = "subordinateOrgaUnits";
|
||||||
private final GenericOrgaUnitSubordinateOrgaUnitAddFormCustomizer customizer;
|
private final GenericOrgaUnitSubordinateOrgaUnitAddFormCustomizer customizer;
|
||||||
|
|
||||||
|
|
@ -60,6 +60,8 @@ public class GenericOrganizationalUnitSubordinateOrgaUnitAddForm
|
||||||
ITEM_SEARCH,
|
ITEM_SEARCH,
|
||||||
ContentType.findByAssociatedObjectType(
|
ContentType.findByAssociatedObjectType(
|
||||||
customizer.getSubordinateOrgaUnitType()));
|
customizer.getSubordinateOrgaUnitType()));
|
||||||
|
// Customizer methods have to be refactored, avoiding Strings
|
||||||
|
// itemSearch.setLabel(null);
|
||||||
itemSearch.setDisableCreatePane(true);
|
itemSearch.setDisableCreatePane(true);
|
||||||
add(itemSearch);
|
add(itemSearch);
|
||||||
}
|
}
|
||||||
|
|
|
||||||
|
|
@ -69,9 +69,6 @@ public class GenericPersonAliasPropertiesStep extends SimpleEditStep {
|
||||||
final BasicPageForm setAliasSheet = new GenericPersonAliasSetForm(
|
final BasicPageForm setAliasSheet = new GenericPersonAliasSetForm(
|
||||||
itemModel,
|
itemModel,
|
||||||
this);
|
this);
|
||||||
/*final BasicPageForm changeAliasSheet =
|
|
||||||
new GenericPersonAliasSetForm(itemModel,
|
|
||||||
this);*/
|
|
||||||
final BasicPageForm deleteAliasSheet = new GenericPersonAliasDeleteForm(
|
final BasicPageForm deleteAliasSheet = new GenericPersonAliasDeleteForm(
|
||||||
itemModel,
|
itemModel,
|
||||||
this);
|
this);
|
||||||
|
|
@ -82,13 +79,6 @@ public class GenericPersonAliasPropertiesStep extends SimpleEditStep {
|
||||||
new GenericPersonAliasSetWorkflowLockedComponentAccess(setAliasSheet,
|
new GenericPersonAliasSetWorkflowLockedComponentAccess(setAliasSheet,
|
||||||
itemModel),
|
itemModel),
|
||||||
setAliasSheet.getSaveCancelSection().getCancelButton());
|
setAliasSheet.getSaveCancelSection().getCancelButton());
|
||||||
/*add(CHANGE_ALIAS_SHEET_NAME,
|
|
||||||
(String) ContenttypesGlobalizationUtil.globalize(
|
|
||||||
"cms.contenttypes.ui.person.change_alias").localize(),
|
|
||||||
new GenericPersonAliasEditWorkflowLockedComponentAccess(
|
|
||||||
changeAliasSheet,
|
|
||||||
itemModel),
|
|
||||||
changeAliasSheet.getSaveCancelSection().getCancelButton());*/
|
|
||||||
add(DELETE_ALIAS_SHEET_NAME,
|
add(DELETE_ALIAS_SHEET_NAME,
|
||||||
ContenttypesGlobalizationUtil.globalize(
|
ContenttypesGlobalizationUtil.globalize(
|
||||||
"cms.contenttypes.ui.person.delete_alias"),
|
"cms.contenttypes.ui.person.delete_alias"),
|
||||||
|
|
|
||||||
|
|
@ -358,7 +358,9 @@ public class LinkPropertyForm extends FormSection
|
||||||
* data
|
* data
|
||||||
*
|
*
|
||||||
* @param event the FormSectionEvent
|
* @param event the FormSectionEvent
|
||||||
|
* @throws com.arsdigita.bebop.FormProcessException
|
||||||
*/
|
*/
|
||||||
|
@Override
|
||||||
public void validate(FormSectionEvent event)
|
public void validate(FormSectionEvent event)
|
||||||
throws FormProcessException {
|
throws FormProcessException {
|
||||||
PageState state = event.getPageState();
|
PageState state = event.getPageState();
|
||||||
|
|
@ -472,7 +474,9 @@ public class LinkPropertyForm extends FormSection
|
||||||
* Init listener. For edit actions, fills the form with current data
|
* Init listener. For edit actions, fills the form with current data
|
||||||
*
|
*
|
||||||
* @param fse the FormSectionEvent
|
* @param fse the FormSectionEvent
|
||||||
|
* @throws com.arsdigita.bebop.FormProcessException
|
||||||
*/
|
*/
|
||||||
|
@Override
|
||||||
public void init(FormSectionEvent fse) throws FormProcessException {
|
public void init(FormSectionEvent fse) throws FormProcessException {
|
||||||
FormData data = fse.getFormData();
|
FormData data = fse.getFormData();
|
||||||
PageState state = fse.getPageState();
|
PageState state = fse.getPageState();
|
||||||
|
|
|
||||||
|
|
@ -256,7 +256,7 @@ public class LinkTable extends Table {
|
||||||
downLabel.setClassAttr("linkSort");
|
downLabel.setClassAttr("linkSort");
|
||||||
return new ControlLink(downLabel);
|
return new ControlLink(downLabel);
|
||||||
} else {
|
} else {
|
||||||
return new Label("");
|
return new Label();
|
||||||
}
|
}
|
||||||
} else {
|
} else {
|
||||||
throw new UncheckedWrapperException("column out of bounds");
|
throw new UncheckedWrapperException("column out of bounds");
|
||||||
|
|
@ -325,6 +325,7 @@ public class LinkTable extends Table {
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
public void headSelected(TableActionEvent e) {
|
public void headSelected(TableActionEvent e) {
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
|
||||||
|
|
@ -48,6 +48,7 @@ public abstract class LinkTableModelBuilder
|
||||||
* @param t The <code>Table</code> for the current page.
|
* @param t The <code>Table</code> for the current page.
|
||||||
* @param s The <code>PageState</code> for the current request
|
* @param s The <code>PageState</code> for the current request
|
||||||
*/
|
*/
|
||||||
|
@Override
|
||||||
public TableModel makeModel(Table t,
|
public TableModel makeModel(Table t,
|
||||||
PageState s) {
|
PageState s) {
|
||||||
s_log.debug("LinkTableModelBuilder.makemodel");
|
s_log.debug("LinkTableModelBuilder.makemodel");
|
||||||
|
|
@ -83,6 +84,7 @@ public abstract class LinkTableModelBuilder
|
||||||
m_link = null;
|
m_link = null;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
public boolean nextRow() {
|
public boolean nextRow() {
|
||||||
s_log.debug(String.format("m_links.size() = %d", m_links.size()));
|
s_log.debug(String.format("m_links.size() = %d", m_links.size()));
|
||||||
|
|
||||||
|
|
@ -99,15 +101,18 @@ public abstract class LinkTableModelBuilder
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
public int getColumnCount() {
|
public int getColumnCount() {
|
||||||
return (int) m_links.size();
|
return (int) m_links.size();
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
public Object getElementAt(int columnIndex) {
|
public Object getElementAt(int columnIndex) {
|
||||||
return m_link;
|
return m_link;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
public Object getKeyAt(int columnIndex) {
|
public Object getKeyAt(int columnIndex) {
|
||||||
return m_link.getID();
|
return m_link.getID();
|
||||||
}
|
}
|
||||||
|
|
|
||||||
|
|
@ -79,6 +79,7 @@ public class ResettableContainer extends SimpleContainer implements Resettable {
|
||||||
* @pre (pc != null)
|
* @pre (pc != null)
|
||||||
* @post (m_components.contains(pc))
|
* @post (m_components.contains(pc))
|
||||||
**/
|
**/
|
||||||
|
@Override
|
||||||
public void add(Component pc) {
|
public void add(Component pc) {
|
||||||
add(pc, true);
|
add(pc, true);
|
||||||
}
|
}
|
||||||
|
|
@ -91,6 +92,7 @@ public class ResettableContainer extends SimpleContainer implements Resettable {
|
||||||
* should override the add method if they wish to provide special
|
* should override the add method if they wish to provide special
|
||||||
* handling of constraints.
|
* handling of constraints.
|
||||||
**/
|
**/
|
||||||
|
@Override
|
||||||
public void add(Component pc, int constraints) {
|
public void add(Component pc, int constraints) {
|
||||||
add(pc);
|
add(pc);
|
||||||
}
|
}
|
||||||
|
|
@ -99,6 +101,7 @@ public class ResettableContainer extends SimpleContainer implements Resettable {
|
||||||
* Adds the component to this pane with the specified default
|
* Adds the component to this pane with the specified default
|
||||||
* visibility.
|
* visibility.
|
||||||
*
|
*
|
||||||
|
* @param pc
|
||||||
* @param defaultVisibility The default visibility of this component
|
* @param defaultVisibility The default visibility of this component
|
||||||
* @pre (pc != null)
|
* @pre (pc != null)
|
||||||
**/
|
**/
|
||||||
|
|
@ -155,6 +158,7 @@ public class ResettableContainer extends SimpleContainer implements Resettable {
|
||||||
*
|
*
|
||||||
* @param state The state of the current request.
|
* @param state The state of the current request.
|
||||||
**/
|
**/
|
||||||
|
@Override
|
||||||
public void reset(PageState state) {
|
public void reset(PageState state) {
|
||||||
// Reset all resettable components automatically
|
// Reset all resettable components automatically
|
||||||
Iterator iter = m_resettableComponents.iterator();
|
Iterator iter = m_resettableComponents.iterator();
|
||||||
|
|
@ -169,6 +173,7 @@ public class ResettableContainer extends SimpleContainer implements Resettable {
|
||||||
*
|
*
|
||||||
* @param p The page this container belongs to.
|
* @param p The page this container belongs to.
|
||||||
**/
|
**/
|
||||||
|
@Override
|
||||||
public void register(Page p) {
|
public void register(Page p) {
|
||||||
Iterator iter = m_componentsNotVisibleByDefault.iterator();
|
Iterator iter = m_componentsNotVisibleByDefault.iterator();
|
||||||
while (iter.hasNext()) {
|
while (iter.hasNext()) {
|
||||||
|
|
|
||||||
|
|
@ -75,6 +75,7 @@ public class SelectFilter implements Filter {
|
||||||
this.queryProperty = queryProperty;
|
this.queryProperty = queryProperty;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
public String getFilter() {
|
public String getFilter() {
|
||||||
if ((value == null) || value.isEmpty()) {
|
if ((value == null) || value.isEmpty()) {
|
||||||
if (allOptionIsDefault) {
|
if (allOptionIsDefault) {
|
||||||
|
|
|
||||||
|
|
@ -244,6 +244,7 @@ public class ItemSearchWidget extends FormSection
|
||||||
+ " cms.ui.item_search.selected"));
|
+ " cms.ui.item_search.selected"));
|
||||||
selectedItemLabel.addPrintListener(new PrintListener() {
|
selectedItemLabel.addPrintListener(new PrintListener() {
|
||||||
|
|
||||||
|
@Override
|
||||||
public void prepare(final PrintEvent event) {
|
public void prepare(final PrintEvent event) {
|
||||||
final Label target = (Label) event.getTarget();
|
final Label target = (Label) event.getTarget();
|
||||||
target.setLabel(GlobalizationUtil.globalize(
|
target.setLabel(GlobalizationUtil.globalize(
|
||||||
|
|
@ -254,6 +255,7 @@ public class ItemSearchWidget extends FormSection
|
||||||
final Label searchLabel = new Label(searchLabelText);
|
final Label searchLabel = new Label(searchLabelText);
|
||||||
searchLabel.addPrintListener(new PrintListener() {
|
searchLabel.addPrintListener(new PrintListener() {
|
||||||
|
|
||||||
|
@Override
|
||||||
public void prepare(final PrintEvent event) {
|
public void prepare(final PrintEvent event) {
|
||||||
final Label target = (Label) event.getTarget();
|
final Label target = (Label) event.getTarget();
|
||||||
target.setLabel(searchLabelText);
|
target.setLabel(searchLabelText);
|
||||||
|
|
@ -403,6 +405,7 @@ public class ItemSearchWidget extends FormSection
|
||||||
return m_item;
|
return m_item;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
public void init(FormSectionEvent e) throws FormProcessException {
|
public void init(FormSectionEvent e) throws FormProcessException {
|
||||||
PageState s = e.getPageState();
|
PageState s = e.getPageState();
|
||||||
try {
|
try {
|
||||||
|
|
|
||||||
|
|
@ -62,7 +62,7 @@ import org.apache.log4j.Logger;
|
||||||
*
|
*
|
||||||
* @version $Id: FormSection.java 287 2005-02-22 00:29:02Z sskracic $
|
* @version $Id: FormSection.java 287 2005-02-22 00:29:02Z sskracic $
|
||||||
*/
|
*/
|
||||||
public class FormSection extends SimpleComponent implements Container {
|
public class FormSection extends DescriptiveComponent implements Container {
|
||||||
|
|
||||||
/** Internal logger instance to faciliate debugging. Enable logging output
|
/** Internal logger instance to faciliate debugging. Enable logging output
|
||||||
* by editing /WEB-INF/conf/log4j.properties int the runtime environment
|
* by editing /WEB-INF/conf/log4j.properties int the runtime environment
|
||||||
|
|
|
||||||
|
|
@ -60,18 +60,30 @@ public class Date extends Widget implements BebopConstants {
|
||||||
private int m_year_end;
|
private int m_year_end;
|
||||||
private Locale m_locale;
|
private Locale m_locale;
|
||||||
|
|
||||||
// Inner classes for the fragment widgets
|
/**
|
||||||
|
* Inner class for the year fragment
|
||||||
|
*/
|
||||||
protected class YearFragment extends SingleSelect {
|
protected class YearFragment extends SingleSelect {
|
||||||
|
|
||||||
protected Date parent;
|
protected Date parent;
|
||||||
private boolean autoCurrentYear; //Decide wether to set the current year if year is null
|
private boolean autoCurrentYear; //Decide wether to set the current year if year is null
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Constructor.
|
||||||
|
* @param name
|
||||||
|
* @param parent
|
||||||
|
*/
|
||||||
public YearFragment(String name, Date parent) {
|
public YearFragment(String name, Date parent) {
|
||||||
super(name);
|
super(name);
|
||||||
this.parent = parent;
|
this.parent = parent;
|
||||||
setHint(GlobalizationUtil.globalize("bebop.date.year.hint"));
|
setHint(GlobalizationUtil.globalize("bebop.date.year.hint"));
|
||||||
}
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
*
|
||||||
|
* @param ps
|
||||||
|
* @return
|
||||||
|
*/
|
||||||
@Override
|
@Override
|
||||||
protected ParameterData getParameterData(PageState ps) {
|
protected ParameterData getParameterData(PageState ps) {
|
||||||
Object value = getValue(ps);
|
Object value = getValue(ps);
|
||||||
|
|
@ -81,10 +93,19 @@ public class Date extends Widget implements BebopConstants {
|
||||||
return new ParameterData(getParameterModel(), value);
|
return new ParameterData(getParameterModel(), value);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
*
|
||||||
|
* @param autoCurrentYear
|
||||||
|
*/
|
||||||
public void setAutoCurrentYear(final boolean autoCurrentYear) {
|
public void setAutoCurrentYear(final boolean autoCurrentYear) {
|
||||||
this.autoCurrentYear = autoCurrentYear;
|
this.autoCurrentYear = autoCurrentYear;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
*
|
||||||
|
* @param ps
|
||||||
|
* @return
|
||||||
|
*/
|
||||||
@Override
|
@Override
|
||||||
public Object getValue(PageState ps) {
|
public Object getValue(PageState ps) {
|
||||||
ParameterModel model = parent.getParameterModel();
|
ParameterModel model = parent.getParameterModel();
|
||||||
|
|
@ -104,6 +125,9 @@ public class Date extends Widget implements BebopConstants {
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
*
|
||||||
|
*/
|
||||||
protected class MonthFragment extends SingleSelect {
|
protected class MonthFragment extends SingleSelect {
|
||||||
|
|
||||||
protected Date parent;
|
protected Date parent;
|
||||||
|
|
@ -135,6 +159,9 @@ public class Date extends Widget implements BebopConstants {
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
*
|
||||||
|
*/
|
||||||
protected class DayFragment extends TextField {
|
protected class DayFragment extends TextField {
|
||||||
|
|
||||||
protected Date parent;
|
protected Date parent;
|
||||||
|
|
@ -199,6 +226,10 @@ public class Date extends Widget implements BebopConstants {
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Constructor.
|
||||||
|
* @param name
|
||||||
|
*/
|
||||||
public Date(String name) {
|
public Date(String name) {
|
||||||
this(new DateParameter(name));
|
this(new DateParameter(name));
|
||||||
}
|
}
|
||||||
|
|
@ -245,7 +276,9 @@ public class Date extends Widget implements BebopConstants {
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Returns a string naming the type of this widget.
|
* Returns a string naming the type of this widget.
|
||||||
|
* @return
|
||||||
*/
|
*/
|
||||||
|
@Override
|
||||||
public String getType() {
|
public String getType() {
|
||||||
return "date";
|
return "date";
|
||||||
}
|
}
|
||||||
|
|
@ -253,23 +286,31 @@ public class Date extends Widget implements BebopConstants {
|
||||||
/**
|
/**
|
||||||
* Sets the <tt>MAXLENGTH</tt> attribute for the <tt>INPUT</tt> tag used to render this form
|
* Sets the <tt>MAXLENGTH</tt> attribute for the <tt>INPUT</tt> tag used to render this form
|
||||||
* element.
|
* element.
|
||||||
|
* @param length
|
||||||
*/
|
*/
|
||||||
public void setMaxLength(int length) {
|
public void setMaxLength(int length) {
|
||||||
setAttribute("MAXLENGTH", String.valueOf(length));
|
setAttribute("MAXLENGTH", String.valueOf(length));
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
public boolean isCompound() {
|
public boolean isCompound() {
|
||||||
return true;
|
return true;
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* The XML tag for this derived class of Widget.
|
* The XML tag for this derived class of Widget.
|
||||||
|
* @return
|
||||||
*/
|
*/
|
||||||
@Override
|
@Override
|
||||||
protected String getElementTag() {
|
protected String getElementTag() {
|
||||||
return BEBOP_DATE;
|
return BEBOP_DATE;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
*
|
||||||
|
* @param ps
|
||||||
|
* @param parent
|
||||||
|
*/
|
||||||
@Override
|
@Override
|
||||||
public void generateWidget(PageState ps, Element parent) {
|
public void generateWidget(PageState ps, Element parent) {
|
||||||
|
|
||||||
|
|
@ -357,7 +398,7 @@ public class Date extends Widget implements BebopConstants {
|
||||||
* pointer is already set. To explicity change the _form pointer the developer must first call
|
* pointer is already set. To explicity change the _form pointer the developer must first call
|
||||||
* setForm(null)
|
* setForm(null)
|
||||||
*
|
*
|
||||||
* @param the <code>Form</code> Object for this Widget.
|
* @param f the <code>Form</code> Object for this Widget.
|
||||||
*
|
*
|
||||||
* @exception IllegalStateException if form already set.
|
* @exception IllegalStateException if form already set.
|
||||||
*/
|
*/
|
||||||
|
|
|
||||||
|
|
@ -40,6 +40,7 @@ public class DateTime extends Widget implements BebopConstants {
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Construct a new DateTime. The model must be a DateTimeParameter
|
* Construct a new DateTime. The model must be a DateTimeParameter
|
||||||
|
* @param model
|
||||||
*/
|
*/
|
||||||
public DateTime(ParameterModel model) {
|
public DateTime(ParameterModel model) {
|
||||||
this(model, false);
|
this(model, false);
|
||||||
|
|
@ -47,6 +48,8 @@ public class DateTime extends Widget implements BebopConstants {
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Construct a new DateTime. The model must be a DateTimeParameter
|
* Construct a new DateTime. The model must be a DateTimeParameter
|
||||||
|
* @param model
|
||||||
|
* @param showSeconds
|
||||||
*/
|
*/
|
||||||
public DateTime(ParameterModel model, boolean showSeconds) {
|
public DateTime(ParameterModel model, boolean showSeconds) {
|
||||||
super(model);
|
super(model);
|
||||||
|
|
@ -71,7 +74,9 @@ public class DateTime extends Widget implements BebopConstants {
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Returns a string naming the type of this widget.
|
* Returns a string naming the type of this widget.
|
||||||
|
* @return
|
||||||
*/
|
*/
|
||||||
|
@Override
|
||||||
public String getType() {
|
public String getType() {
|
||||||
return "dateTime";
|
return "dateTime";
|
||||||
}
|
}
|
||||||
|
|
|
||||||
Loading…
Reference in New Issue