Weitere Ergänzungen Lokalisierung.
git-svn-id: https://svn.libreccm.org/ccm/trunk@2190 8810af33-2d31-482b-a856-94f89814c4dfmaster
parent
93fc75c28d
commit
259f4dbc59
|
|
@ -72,7 +72,8 @@ public abstract class ContentGroupPropertiesStep extends SimpleEditStep {
|
|||
*/
|
||||
public Component getPropertySheet(ItemSelectionModel itemModel) {
|
||||
GridPanel panel = new GridPanel(2);
|
||||
panel.add(new Label(GlobalizationUtil.globalize("cms.contenttypes.ui.content_group_name")));
|
||||
panel.add(new Label(GlobalizationUtil
|
||||
.globalize("cms.contenttypes.ui.content_group_name")));
|
||||
panel.add(new Label(new PrintListener() {
|
||||
public void prepare(PrintEvent e) {
|
||||
Label label = (Label)e.getTarget();
|
||||
|
|
@ -82,7 +83,9 @@ public abstract class ContentGroupPropertiesStep extends SimpleEditStep {
|
|||
ContentGroup group =
|
||||
item.getContentGroup(getMainAttributeName());
|
||||
if (group == null) {
|
||||
label.setLabel("None", e.getPageState());
|
||||
label.setLabel(GlobalizationUtil.globalize(
|
||||
"cms.contenttypes.ui.content_group_name"),
|
||||
e.getPageState());
|
||||
label.setFontWeight(Label.ITALIC);
|
||||
} else {
|
||||
label.setLabel(group.getName(), e.getPageState());
|
||||
|
|
|
|||
|
|
@ -78,13 +78,15 @@ public class ContentGroupPropertyForm extends BasicItemForm {
|
|||
* Adds widgets to the form.
|
||||
*/
|
||||
protected void addWidgets() {
|
||||
add(new Label(GlobalizationUtil.globalize("cms.contenttypes.ui.content_group_name")));
|
||||
add(new Label(GlobalizationUtil
|
||||
.globalize("cms.contenttypes.ui.content_group_name")));
|
||||
TextField nameWidget =
|
||||
new TextField(new TrimmedStringParameter(ContentGroup.NAME));
|
||||
nameWidget.addValidationListener(new NotNullValidationListener());
|
||||
add(nameWidget);
|
||||
|
||||
add(new Label(GlobalizationUtil.globalize("cms.contenttypes.ui.content_group_current_items")) {
|
||||
add(new Label(GlobalizationUtil
|
||||
.globalize("cms.contenttypes.ui.content_group_current_items")) {
|
||||
public boolean isVisible(PageState state) {
|
||||
ContentGroupContainer item =
|
||||
(ContentGroupContainer) getItemSelectionModel()
|
||||
|
|
@ -106,7 +108,8 @@ public class ContentGroupPropertyForm extends BasicItemForm {
|
|||
};
|
||||
add(m_checkboxGroup);
|
||||
|
||||
add(new Label(GlobalizationUtil.globalize("cms.contenttypes.ui.content_group_new_item")));
|
||||
add(new Label(GlobalizationUtil
|
||||
.globalize("cms.contenttypes.ui.content_group_new_item")));
|
||||
try {
|
||||
add(new ItemSearchWidget(RELATED_ITEM, getSearchContentType()));
|
||||
} catch (DataObjectNotFoundException de) {
|
||||
|
|
|
|||
|
|
@ -56,7 +56,8 @@ public class GenericArticlePropertyForm extends BasicPageForm
|
|||
* GenericArticle to work on
|
||||
* @param step The GenericArticlePropertiesStep which controls this form.
|
||||
*/
|
||||
public GenericArticlePropertyForm(ItemSelectionModel itemModel, GenericArticlePropertiesStep step) {
|
||||
public GenericArticlePropertyForm(ItemSelectionModel itemModel,
|
||||
GenericArticlePropertiesStep step) {
|
||||
super(ID, itemModel);
|
||||
m_step = step;
|
||||
addSubmissionListener(this);
|
||||
|
|
|
|||
|
|
@ -91,26 +91,26 @@ public class GenericContactAddressPropertiesStep extends SimpleEditStep {
|
|||
DomainObjectPropertySheet sheet = new DomainObjectPropertySheet(
|
||||
itemModel);
|
||||
|
||||
sheet.add((String) ContenttypesGlobalizationUtil.globalize(
|
||||
"cms.contenttypes.ui.address.address").localize(),
|
||||
sheet.add(ContenttypesGlobalizationUtil.globalize(
|
||||
"cms.contenttypes.ui.address.address"),
|
||||
"address." + GenericAddress.ADDRESS);
|
||||
if (!GenericContact.getConfig().getHideAddressPostalCode()) {
|
||||
sheet.add((String) ContenttypesGlobalizationUtil.globalize(
|
||||
"cms.contenttypes.ui.address.postal_code").localize(),
|
||||
sheet.add(ContenttypesGlobalizationUtil.globalize(
|
||||
"cms.contenttypes.ui.address.postal_code"),
|
||||
"address." + GenericAddress.POSTAL_CODE);
|
||||
}
|
||||
sheet.add((String) ContenttypesGlobalizationUtil.globalize(
|
||||
"cms.contenttypes.ui.address.city").localize(),
|
||||
sheet.add(ContenttypesGlobalizationUtil.globalize(
|
||||
"cms.contenttypes.ui.address.city"),
|
||||
"address." + GenericAddress.CITY);
|
||||
if (!GenericContact.getConfig().getHideAddressState()) {
|
||||
sheet.add((String) ContenttypesGlobalizationUtil.globalize(
|
||||
"cms.contenttypes.ui.address.state").localize(),
|
||||
sheet.add(ContenttypesGlobalizationUtil.globalize(
|
||||
"cms.contenttypes.ui.address.state"),
|
||||
"address." + GenericAddress.STATE);
|
||||
}
|
||||
|
||||
if (!GenericContact.getConfig().getHideAddressCountry()) {
|
||||
sheet.add((String) ContenttypesGlobalizationUtil.globalize(
|
||||
"cms.contenttypes.ui.address.iso_country_code").localize(),
|
||||
sheet.add(ContenttypesGlobalizationUtil.globalize(
|
||||
"cms.contenttypes.ui.address.iso_country_code"),
|
||||
"address." + GenericAddress.ISO_COUNTRY_CODE,
|
||||
new DomainObjectPropertySheet.AttributeFormatter() {
|
||||
|
||||
|
|
@ -138,11 +138,12 @@ public class GenericContactAddressPropertiesStep extends SimpleEditStep {
|
|||
public static Component getEmptyBaseAddressPropertySheet(
|
||||
ItemSelectionModel itemModel) {
|
||||
return new Label(
|
||||
((String) ContenttypesGlobalizationUtil.globalize(
|
||||
"cms.contenttypes.ui.contact.emptyAddress").localize()));
|
||||
(ContenttypesGlobalizationUtil.globalize(
|
||||
"cms.contenttypes.ui.contact.emptyAddress")));
|
||||
}
|
||||
|
||||
private class EditAddressWorkflowLockedComponentAccess extends WorkflowLockedComponentAccess {
|
||||
private class EditAddressWorkflowLockedComponentAccess
|
||||
extends WorkflowLockedComponentAccess {
|
||||
|
||||
public EditAddressWorkflowLockedComponentAccess(Component c,
|
||||
ItemSelectionModel i) {
|
||||
|
|
|
|||
|
|
@ -72,8 +72,8 @@ public class GenericContactAttachAddressPropertyForm extends BasicPageForm
|
|||
|
||||
@Override
|
||||
public void addWidgets() {
|
||||
add(new Label((String) ContenttypesGlobalizationUtil.globalize(
|
||||
"cms.contenttypes.ui.contact.select_address").localize()));
|
||||
add(new Label(ContenttypesGlobalizationUtil.globalize(
|
||||
"cms.contenttypes.ui.contact.select_address")));
|
||||
this.m_itemSearch = new ItemSearchWidget(ITEM_SEARCH, ContentType.
|
||||
findByAssociatedObjectType(
|
||||
"com.arsdigita.cms.contenttypes.GenericAddress"));
|
||||
|
|
@ -130,15 +130,13 @@ public class GenericContactAttachAddressPropertyForm extends BasicPageForm
|
|||
Submit target = (Submit) e.getTarget();
|
||||
|
||||
if (contact.getAddress() != null) {
|
||||
target.setButtonLabel((String) ContenttypesGlobalizationUtil.
|
||||
target.setButtonLabel(ContenttypesGlobalizationUtil.
|
||||
globalize(
|
||||
"cms.contenttypes.ui.contact.select_address.change").
|
||||
localize());
|
||||
"cms.contenttypes.ui.contact.select_address.change"));
|
||||
} else {
|
||||
target.setButtonLabel((String) ContenttypesGlobalizationUtil.
|
||||
target.setButtonLabel(ContenttypesGlobalizationUtil.
|
||||
globalize(
|
||||
"cms.contenttypes.ui.contact.select_address.add").
|
||||
localize());
|
||||
"cms.contenttypes.ui.contact.select_address.add"));
|
||||
}
|
||||
}
|
||||
});
|
||||
|
|
|
|||
|
|
@ -82,8 +82,8 @@ public class GenericContactAttachPersonPropertyForm extends BasicPageForm
|
|||
|
||||
@Override
|
||||
public void addWidgets() {
|
||||
add(new Label((String) ContenttypesGlobalizationUtil.globalize(
|
||||
"cms.contenttypes.ui.contact.select_person").localize()));
|
||||
add(new Label(ContenttypesGlobalizationUtil.globalize(
|
||||
"cms.contenttypes.ui.contact.select_person")));
|
||||
this.m_itemSearch = new ItemSearchWidget(ITEM_SEARCH, ContentType.
|
||||
findByAssociatedObjectType(
|
||||
"com.arsdigita.cms.contenttypes.GenericPerson"));
|
||||
|
|
@ -97,8 +97,8 @@ public class GenericContactAttachPersonPropertyForm extends BasicPageForm
|
|||
SingleSelect contactType = new SingleSelect(contactTypeParam);
|
||||
contactType.addValidationListener(new NotNullValidationListener());
|
||||
contactType.addOption(new Option("",
|
||||
new Label((String) ContenttypesGlobalizationUtil.
|
||||
globalize("cms.ui.select_one").localize())));
|
||||
new Label(ContenttypesGlobalizationUtil
|
||||
.globalize("cms.ui.select_one"))));
|
||||
|
||||
// Add the Options to the SingleSelect widget
|
||||
GenericContactTypeCollection contacttypes =
|
||||
|
|
@ -160,15 +160,13 @@ public class GenericContactAttachPersonPropertyForm extends BasicPageForm
|
|||
Submit target = (Submit) e.getTarget();
|
||||
|
||||
if (contact.getPerson() != null) {
|
||||
target.setButtonLabel((String) ContenttypesGlobalizationUtil.
|
||||
target.setButtonLabel(ContenttypesGlobalizationUtil.
|
||||
globalize(
|
||||
"cms.contenttypes.ui.contact.select_person.change").
|
||||
localize());
|
||||
"cms.contenttypes.ui.contact.select_person.change"));
|
||||
} else {
|
||||
target.setButtonLabel((String) ContenttypesGlobalizationUtil.
|
||||
target.setButtonLabel(ContenttypesGlobalizationUtil.
|
||||
globalize(
|
||||
"cms.contenttypes.ui.contact.select_person.add").
|
||||
localize());
|
||||
"cms.contenttypes.ui.contact.select_person.add"));
|
||||
}
|
||||
}
|
||||
});
|
||||
|
|
|
|||
|
|
@ -43,7 +43,8 @@ public class GenericContactDeleteAddressForm extends BasicPageForm implements Fo
|
|||
|
||||
@Override
|
||||
public void addWidgets() {
|
||||
add(new Label((String) ContenttypesGlobalizationUtil.globalize("cms.contenttypes.ui.contact.delete_address.label").localize()));
|
||||
add(new Label(ContenttypesGlobalizationUtil
|
||||
.globalize("cms.contenttypes.ui.contact.delete_address.label")));
|
||||
}
|
||||
|
||||
/**
|
||||
|
|
@ -55,9 +56,13 @@ public class GenericContactDeleteAddressForm extends BasicPageForm implements Fo
|
|||
getSaveCancelSection().getSaveButton().addPrintListener(new PrintListener() {
|
||||
|
||||
public void prepare(PrintEvent e) {
|
||||
GenericContact contact = (GenericContact) getItemSelectionModel().getSelectedObject(e.getPageState());
|
||||
GenericContact contact = (GenericContact)
|
||||
getItemSelectionModel()
|
||||
.getSelectedObject(e.getPageState());
|
||||
Submit target = (Submit) e.getTarget();
|
||||
target.setButtonLabel((String) ContenttypesGlobalizationUtil.globalize("cms.contenttypes.ui.contact.delete_address.button_label").localize());
|
||||
target.setButtonLabel(ContenttypesGlobalizationUtil
|
||||
.globalize(
|
||||
"cms.contenttypes.ui.contact.delete_address.button_label"));
|
||||
}
|
||||
});
|
||||
} catch (Exception ex) {
|
||||
|
|
@ -68,7 +73,8 @@ public class GenericContactDeleteAddressForm extends BasicPageForm implements Fo
|
|||
public final void process(final FormSectionEvent fse) throws FormProcessException {
|
||||
|
||||
final PageState state = fse.getPageState();
|
||||
final GenericContact contact = (GenericContact) getItemSelectionModel().getSelectedObject(state);
|
||||
final GenericContact contact = (GenericContact) getItemSelectionModel()
|
||||
.getSelectedObject(state);
|
||||
|
||||
if (contact != null && contact.getAddress() != null) {
|
||||
contact.unsetAddress();
|
||||
|
|
|
|||
|
|
@ -27,14 +27,16 @@ import com.arsdigita.util.UncheckedWrapperException;
|
|||
*
|
||||
* @author quasi
|
||||
*/
|
||||
public class GenericContactDeletePersonForm extends BasicPageForm implements FormProcessListener {
|
||||
public class GenericContactDeletePersonForm extends BasicPageForm
|
||||
implements FormProcessListener {
|
||||
|
||||
/**
|
||||
* ID of the form
|
||||
*/
|
||||
public static final String ID = "ContactDeletePerson";
|
||||
|
||||
GenericContactDeletePersonForm(ItemSelectionModel itemModel, GenericContactPersonPropertiesStep step) {
|
||||
GenericContactDeletePersonForm(ItemSelectionModel itemModel,
|
||||
GenericContactPersonPropertiesStep step) {
|
||||
super(ID, itemModel);
|
||||
addSaveCancelSection();
|
||||
}
|
||||
|
|
@ -45,7 +47,8 @@ public class GenericContactDeletePersonForm extends BasicPageForm implements For
|
|||
|
||||
@Override
|
||||
public void addWidgets() {
|
||||
add(new Label((String)ContenttypesGlobalizationUtil.globalize("cms.contenttypes.ui.contact.delete_person.label").localize()));
|
||||
add(new Label(ContenttypesGlobalizationUtil
|
||||
.globalize("cms.contenttypes.ui.contact.delete_person.label")));
|
||||
}
|
||||
|
||||
/**
|
||||
|
|
@ -54,12 +57,16 @@ public class GenericContactDeletePersonForm extends BasicPageForm implements For
|
|||
@Override
|
||||
public void addSaveCancelSection() {
|
||||
try {
|
||||
getSaveCancelSection().getSaveButton().addPrintListener(new PrintListener() {
|
||||
getSaveCancelSection().getSaveButton()
|
||||
.addPrintListener(new PrintListener() {
|
||||
|
||||
public void prepare(PrintEvent e) {
|
||||
GenericContact contact = (GenericContact)getItemSelectionModel().getSelectedObject(e.getPageState());
|
||||
GenericContact contact = (GenericContact)
|
||||
getItemSelectionModel()
|
||||
.getSelectedObject(e.getPageState());
|
||||
Submit target = (Submit) e.getTarget();
|
||||
target.setButtonLabel((String)ContenttypesGlobalizationUtil.globalize("cms.contenttypes.ui.contact.delete_person").localize());
|
||||
target.setButtonLabel(ContenttypesGlobalizationUtil
|
||||
.globalize("cms.contenttypes.ui.contact.delete_person"));
|
||||
}
|
||||
});
|
||||
} catch (Exception ex) {
|
||||
|
|
@ -70,7 +77,8 @@ public class GenericContactDeletePersonForm extends BasicPageForm implements For
|
|||
public final void process(final FormSectionEvent fse) throws FormProcessException {
|
||||
|
||||
final PageState state = fse.getPageState();
|
||||
final GenericContact contact = (GenericContact)getItemSelectionModel().getSelectedObject(state);
|
||||
final GenericContact contact = (GenericContact)getItemSelectionModel()
|
||||
.getSelectedObject(state);
|
||||
|
||||
if (contact != null && contact.getPerson() != null) {
|
||||
contact.unsetPerson();
|
||||
|
|
|
|||
|
|
@ -78,7 +78,8 @@ public class GenericContactEditAddressPropertyForm extends BasicPageForm impleme
|
|||
|
||||
@Override
|
||||
public void addWidgets() {
|
||||
add(new Label((String) ContenttypesGlobalizationUtil.globalize("cms.contenttypes.ui.address.address").localize()));
|
||||
add(new Label(ContenttypesGlobalizationUtil
|
||||
.globalize("cms.contenttypes.ui.address.address")));
|
||||
ParameterModel addressParam = new StringParameter(ADDRESS);
|
||||
addressParam.addParameterListener(new NotNullValidationListener());
|
||||
addressParam.addParameterListener(new StringInRangeValidationListener(0, 1000));
|
||||
|
|
@ -88,33 +89,40 @@ public class GenericContactEditAddressPropertyForm extends BasicPageForm impleme
|
|||
add(address);
|
||||
|
||||
if (!GenericContact.getConfig().getHideAddressPostalCode()) {
|
||||
add(new Label((String) ContenttypesGlobalizationUtil.globalize("cms.contenttypes.ui.address.postal_code").localize()));
|
||||
add(new Label(ContenttypesGlobalizationUtil
|
||||
.globalize("cms.contenttypes.ui.address.postal_code")));
|
||||
ParameterModel postalCodeParam = new StringParameter(POSTAL_CODE);
|
||||
TextField postalCode = new TextField(postalCodeParam);
|
||||
/* XXX NumberListener ?*/
|
||||
add(postalCode);
|
||||
}
|
||||
|
||||
add(new Label((String) ContenttypesGlobalizationUtil.globalize("cms.contenttypes.ui.address.city").localize()));
|
||||
add(new Label(ContenttypesGlobalizationUtil
|
||||
.globalize("cms.contenttypes.ui.address.city")));
|
||||
ParameterModel cityParam = new StringParameter(CITY);
|
||||
TextField city = new TextField(cityParam);
|
||||
add(city);
|
||||
|
||||
if (!GenericContact.getConfig().getHideAddressState()) {
|
||||
add(new Label((String) ContenttypesGlobalizationUtil.globalize("cms.contenttypes.ui.address.state").localize()));
|
||||
add(new Label(ContenttypesGlobalizationUtil
|
||||
.globalize("cms.contenttypes.ui.address.state")));
|
||||
ParameterModel stateParam = new StringParameter(STATE);
|
||||
TextField state = new TextField(stateParam);
|
||||
add(state);
|
||||
}
|
||||
|
||||
if (!GenericContact.getConfig().getHideAddressCountry()) {
|
||||
add(new Label((String) ContenttypesGlobalizationUtil.globalize("cms.contenttypes.ui.address.iso_country_code").localize()));
|
||||
add(new Label(ContenttypesGlobalizationUtil
|
||||
.globalize("cms.contenttypes.ui.address.iso_country_code")));
|
||||
ParameterModel countryParam = new StringParameter(ISO_COUNTRY_CODE);
|
||||
countryParam.addParameterListener(new StringInRangeValidationListener(0, 2));
|
||||
|
||||
SingleSelect country = new SingleSelect(countryParam);
|
||||
|
||||
country.addOption(new Option("", new Label((String) ContenttypesGlobalizationUtil.globalize("cms.ui.select_one").localize())));
|
||||
country.addOption(new
|
||||
Option("",
|
||||
new Label(ContenttypesGlobalizationUtil
|
||||
.globalize("cms.ui.select_one"))));
|
||||
|
||||
Iterator countries = GenericAddress.getSortedListOfCountries(null).entrySet().iterator();
|
||||
while (countries.hasNext()) {
|
||||
|
|
@ -126,14 +134,16 @@ public class GenericContactEditAddressPropertyForm extends BasicPageForm impleme
|
|||
new ParameterListener() {
|
||||
|
||||
@Override
|
||||
public void validate(ParameterEvent e) throws FormProcessException {
|
||||
ParameterData data = e.getParameterData();
|
||||
String isoCode = (String) data.getValue();
|
||||
if (isoCode == null || isoCode.length() == 0) {
|
||||
data.addError((String) ContenttypesGlobalizationUtil.globalize("cms.contenttypes.ui.address.error_iso_country").localize());
|
||||
}
|
||||
}
|
||||
});
|
||||
public void validate(ParameterEvent e) throws FormProcessException {
|
||||
ParameterData data = e.getParameterData();
|
||||
String isoCode = (String) data.getValue();
|
||||
if (isoCode == null || isoCode.length() == 0) {
|
||||
data.addError((String) ContenttypesGlobalizationUtil
|
||||
.globalize("cms.contenttypes.ui.address.error_iso_country")
|
||||
.localize());
|
||||
}
|
||||
}
|
||||
});
|
||||
|
||||
add(country);
|
||||
}
|
||||
|
|
|
|||
|
|
@ -65,12 +65,14 @@ public class GenericContactEditPersonPropertyForm extends BasicPageForm implemen
|
|||
}
|
||||
|
||||
/**
|
||||
* Constrctor taking an ItemSelectionModel and an instance of ContactPropertiesStep.
|
||||
* Constructor taking an ItemSelectionModel and an instance of
|
||||
* ContactPropertiesStep.
|
||||
*
|
||||
* @param itemModel
|
||||
* @param step
|
||||
*/
|
||||
public GenericContactEditPersonPropertyForm(ItemSelectionModel itemModel, GenericContactPersonPropertiesStep step) {
|
||||
public GenericContactEditPersonPropertyForm(ItemSelectionModel itemModel,
|
||||
GenericContactPersonPropertiesStep step) {
|
||||
super(ID, itemModel);
|
||||
m_step = step;
|
||||
addSubmissionListener(this);
|
||||
|
|
@ -78,42 +80,51 @@ public class GenericContactEditPersonPropertyForm extends BasicPageForm implemen
|
|||
|
||||
@Override
|
||||
public void addWidgets() {
|
||||
add(new Label((String) ContenttypesGlobalizationUtil.globalize("cms.contenttypes.ui.person.surname").localize()));
|
||||
add(new Label(ContenttypesGlobalizationUtil
|
||||
.globalize("cms.contenttypes.ui.person.surname")));
|
||||
ParameterModel surnameParam = new StringParameter(SURNAME);
|
||||
surnameParam.addParameterListener(new NotNullValidationListener());
|
||||
surnameParam.addParameterListener(new StringInRangeValidationListener(0, 1000));
|
||||
TextField surname = new TextField(surnameParam);
|
||||
add(surname);
|
||||
|
||||
add(new Label((String) ContenttypesGlobalizationUtil.globalize("cms.contenttypes.ui.person.givenname").localize()));
|
||||
add(new Label(ContenttypesGlobalizationUtil
|
||||
.globalize("cms.contenttypes.ui.person.givenname")));
|
||||
ParameterModel givennameParam = new StringParameter(GIVENNAME);
|
||||
givennameParam.addParameterListener(new NotNullValidationListener());
|
||||
givennameParam.addParameterListener(new StringInRangeValidationListener(0, 1000));
|
||||
TextField givenname = new TextField(givennameParam);
|
||||
add(givenname);
|
||||
|
||||
add(new Label((String) ContenttypesGlobalizationUtil.globalize("cms.contenttypes.ui.person.titlepre").localize()));
|
||||
add(new Label(ContenttypesGlobalizationUtil
|
||||
.globalize("cms.contenttypes.ui.person.titlepre")));
|
||||
ParameterModel titlepreParam = new StringParameter(TITLEPRE);
|
||||
titlepreParam.addParameterListener(new StringInRangeValidationListener(0, 1000));
|
||||
TextField titlepre = new TextField(titlepreParam);
|
||||
add(titlepre);
|
||||
|
||||
add(new Label((String) ContenttypesGlobalizationUtil.globalize("cms.contenttypes.ui.person.titlepost").localize()));
|
||||
add(new Label(ContenttypesGlobalizationUtil
|
||||
.globalize("cms.contenttypes.ui.person.titlepost")));
|
||||
ParameterModel titlepostParam = new StringParameter(TITLEPOST);
|
||||
titlepostParam.addParameterListener(new StringInRangeValidationListener(0, 1000));
|
||||
TextField titlepost = new TextField(titlepostParam);
|
||||
add(titlepost);
|
||||
|
||||
// GenericContact type field
|
||||
add(new Label(ContenttypesGlobalizationUtil.globalize("cms.contenttypes.ui.person.contact.type")));
|
||||
add(new Label(ContenttypesGlobalizationUtil
|
||||
.globalize("cms.contenttypes.ui.person.contact.type")));
|
||||
ParameterModel contactTypeParam = new StringParameter(CONTACTS_KEY);
|
||||
SingleSelect contactType = new SingleSelect(contactTypeParam);
|
||||
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
|
||||
GenericContactTypeCollection contacttypes = new GenericContactTypeCollection();
|
||||
contacttypes.addLanguageFilter(GlobalizationHelper.getNegotiatedLocale().getLanguage());
|
||||
contacttypes.addLanguageFilter(GlobalizationHelper
|
||||
.getNegotiatedLocale().getLanguage());
|
||||
|
||||
while (contacttypes.next()) {
|
||||
RelationAttribute ct = contacttypes.getRelationAttribute();
|
||||
|
|
@ -126,7 +137,8 @@ public class GenericContactEditPersonPropertyForm extends BasicPageForm implemen
|
|||
public void init(FormSectionEvent fse) {
|
||||
FormData data = fse.getFormData();
|
||||
PageState state = fse.getPageState();
|
||||
GenericContact contact = (GenericContact) getItemSelectionModel().getSelectedObject(state);
|
||||
GenericContact contact = (GenericContact) getItemSelectionModel()
|
||||
.getSelectedObject(state);
|
||||
|
||||
if (contact.getPerson() != null) {
|
||||
data.put(SURNAME, contact.getPerson().getSurname());
|
||||
|
|
@ -147,7 +159,8 @@ public class GenericContactEditPersonPropertyForm extends BasicPageForm implemen
|
|||
public void process(FormSectionEvent fse) {
|
||||
FormData data = fse.getFormData();
|
||||
PageState state = fse.getPageState();
|
||||
GenericContact contact = (GenericContact) getItemSelectionModel().getSelectedObject(state);
|
||||
GenericContact contact = (GenericContact) getItemSelectionModel()
|
||||
.getSelectedObject(state);
|
||||
|
||||
if (getSaveCancelSection().getSaveButton().isSelected(fse.getPageState())) {
|
||||
|
||||
|
|
|
|||
|
|
@ -38,15 +38,35 @@ public class GenericContactEntriesPropertiesStep extends SimpleEditStep {
|
|||
/** The name of the editing sheet added to this step */
|
||||
private static String ADD_CONTACT_ENTRY_SHEET_NAME = "addContactEntry";
|
||||
|
||||
public GenericContactEntriesPropertiesStep(ItemSelectionModel itemModel, AuthoringKitWizard parent) {
|
||||
/**
|
||||
*
|
||||
* @param itemModel
|
||||
* @param parent
|
||||
*/
|
||||
public GenericContactEntriesPropertiesStep(ItemSelectionModel itemModel,
|
||||
AuthoringKitWizard parent) {
|
||||
this(itemModel, parent, null);
|
||||
}
|
||||
|
||||
public GenericContactEntriesPropertiesStep(ItemSelectionModel itemModel, AuthoringKitWizard parent, String prefix) {
|
||||
/**
|
||||
*
|
||||
* @param itemModel
|
||||
* @param parent
|
||||
* @param prefix
|
||||
*/
|
||||
public GenericContactEntriesPropertiesStep(ItemSelectionModel itemModel,
|
||||
AuthoringKitWizard parent,
|
||||
String prefix) {
|
||||
super(itemModel, parent, prefix);
|
||||
|
||||
BasicItemForm addContactEntrySheet = new GenericContactEntryAddForm(itemModel);
|
||||
add(ADD_CONTACT_ENTRY_SHEET_NAME, (String)ContenttypesGlobalizationUtil.globalize("cms.contenttypes.ui.contact.add_contactEntry").localize(), new WorkflowLockedComponentAccess(addContactEntrySheet, itemModel), addContactEntrySheet.getSaveCancelSection().getCancelButton());
|
||||
add(ADD_CONTACT_ENTRY_SHEET_NAME,
|
||||
(String)ContenttypesGlobalizationUtil
|
||||
.globalize("cms.contenttypes.ui.contact.add_contactEntry")
|
||||
.localize(),
|
||||
new WorkflowLockedComponentAccess(addContactEntrySheet,
|
||||
itemModel),
|
||||
addContactEntrySheet.getSaveCancelSection().getCancelButton());
|
||||
|
||||
GenericContactEntriesTable contactEntriesTable = new GenericContactEntriesTable(itemModel);
|
||||
setDisplayComponent(contactEntriesTable);
|
||||
|
|
|
|||
|
|
@ -63,14 +63,34 @@ public class GenericContactEntriesTable extends Table implements TableActionList
|
|||
this.m_itemModel = itemModel;
|
||||
|
||||
// if table is empty:
|
||||
setEmptyView(new Label(ContenttypesGlobalizationUtil.globalize("cms.contenttypes.ui.contact.contactEntry.none")));
|
||||
setEmptyView(new Label(ContenttypesGlobalizationUtil
|
||||
.globalize("cms.contenttypes.ui.contact.contactEntry.none")));
|
||||
TableColumnModel tab_model = getColumnModel();
|
||||
|
||||
// define columns
|
||||
tab_model.add(new TableColumn(0, ContenttypesGlobalizationUtil.globalize("cms.contenttypes.ui.contact.contactEntry.key").localize(), TABLE_COL_EDIT));
|
||||
tab_model.add(new TableColumn(1, ContenttypesGlobalizationUtil.globalize("cms.contenttypes.ui.contact.contactEntry.value").localize()));
|
||||
tab_model.add(new TableColumn(2, ContenttypesGlobalizationUtil.globalize("cms.contenttypes.ui.contact.contactEntry.description").localize()));
|
||||
tab_model.add(new TableColumn(3, ContenttypesGlobalizationUtil.globalize("cms.contenttypes.ui.contact.contactEntry.action").localize(), TABLE_COL_DEL));
|
||||
tab_model.add(new TableColumn(
|
||||
0,
|
||||
ContenttypesGlobalizationUtil.globalize(
|
||||
"cms.contenttypes.ui.contact.contactEntry.key")
|
||||
,
|
||||
TABLE_COL_EDIT));
|
||||
tab_model.add(new TableColumn(
|
||||
1,
|
||||
ContenttypesGlobalizationUtil.globalize(
|
||||
"cms.contenttypes.ui.contact.contactEntry.value")
|
||||
|
||||
));
|
||||
tab_model.add(new TableColumn(
|
||||
2,
|
||||
ContenttypesGlobalizationUtil.globalize(
|
||||
"cms.contenttypes.ui.contact.contactEntry.description")
|
||||
.localize()));
|
||||
tab_model.add(new TableColumn(
|
||||
3,
|
||||
ContenttypesGlobalizationUtil.globalize(
|
||||
"cms.contenttypes.ui.contact.contactEntry.action")
|
||||
.localize(),
|
||||
TABLE_COL_DEL));
|
||||
|
||||
setModelBuilder(new ContactTableModelBuilder(itemModel));
|
||||
|
||||
|
|
@ -85,7 +105,8 @@ public class GenericContactEntriesTable extends Table implements TableActionList
|
|||
* XXXX
|
||||
*
|
||||
*/
|
||||
private class ContactTableModelBuilder extends LockableImpl implements TableModelBuilder {
|
||||
private class ContactTableModelBuilder extends LockableImpl
|
||||
implements TableModelBuilder {
|
||||
|
||||
private ItemSelectionModel m_itemModel;
|
||||
|
||||
|
|
@ -97,7 +118,8 @@ public class GenericContactEntriesTable extends Table implements TableActionList
|
|||
|
||||
table.getRowSelectionModel().clearSelection(state);
|
||||
|
||||
GenericContact contact = (GenericContact) m_itemModel.getSelectedObject(state);
|
||||
GenericContact contact = (GenericContact)
|
||||
m_itemModel.getSelectedObject(state);
|
||||
return new ContactTableModel(table, state, contact);
|
||||
}
|
||||
}
|
||||
|
|
@ -148,8 +170,11 @@ public class GenericContactEntriesTable extends Table implements TableActionList
|
|||
public Object getElementAt(int columnIndex) {
|
||||
switch (columnIndex) {
|
||||
case 0:
|
||||
GenericContactEntryKeys keys = new GenericContactEntryKeys(m_contactEntry.getKey());
|
||||
keys.addLanguageFilter(GlobalizationHelper.getNegotiatedLocale().getLanguage());
|
||||
GenericContactEntryKeys keys = new
|
||||
GenericContactEntryKeys(m_contactEntry.getKey());
|
||||
keys.addLanguageFilter(
|
||||
GlobalizationHelper.getNegotiatedLocale()
|
||||
.getLanguage());
|
||||
if (keys.next()) {
|
||||
Object key = keys.getName();
|
||||
|
||||
|
|
@ -162,11 +187,15 @@ public class GenericContactEntriesTable extends Table implements TableActionList
|
|||
case 1:
|
||||
return m_contactEntry.getValue();
|
||||
case 2:
|
||||
return (m_contactEntry.getDescription() != null && m_contactEntry.getDescription().length() > MAX_DESC_LENGTH)
|
||||
? m_contactEntry.getDescription().substring(0, MAX_DESC_LENGTH)
|
||||
return (m_contactEntry.getDescription() != null
|
||||
&& m_contactEntry.getDescription().length() >
|
||||
MAX_DESC_LENGTH)
|
||||
? m_contactEntry.getDescription().substring(
|
||||
0, MAX_DESC_LENGTH)
|
||||
: m_contactEntry.getDescription();
|
||||
case 3:
|
||||
return GlobalizationUtil.globalize("cms.ui.delete").localize();
|
||||
// return GlobalizationUtil.globalize("cms.ui.delete").localize();
|
||||
return GlobalizationUtil.globalize("cms.ui.delete");
|
||||
default:
|
||||
return null;
|
||||
}
|
||||
|
|
@ -210,21 +239,25 @@ public class GenericContactEntriesTable extends Table implements TableActionList
|
|||
* Check for the permissions to delete item and put either a Label or
|
||||
* a ControlLink accordingly.
|
||||
*/
|
||||
private class DeleteCellRenderer extends LockableImpl implements TableCellRenderer {
|
||||
private class DeleteCellRenderer extends LockableImpl
|
||||
implements TableCellRenderer {
|
||||
|
||||
public Component getComponent(Table table, PageState state, Object value,
|
||||
boolean isSelected, Object key,
|
||||
int row, int column) {
|
||||
|
||||
SecurityManager sm = Utilities.getSecurityManager(state);
|
||||
GenericContact contact = (GenericContact) m_itemModel.getSelectedObject(state);
|
||||
GenericContact contact = (GenericContact)
|
||||
m_itemModel.getSelectedObject(state);
|
||||
|
||||
boolean canDelete = sm.canAccess(state.getRequest(),
|
||||
SecurityManager.DELETE_ITEM,
|
||||
contact);
|
||||
if (canDelete) {
|
||||
ControlLink link = new ControlLink(value.toString());
|
||||
link.setConfirmation((String) ContenttypesGlobalizationUtil.globalize("cms.contenttypes.ui.contact.confirm_delete").localize());
|
||||
link.setConfirmation(
|
||||
ContenttypesGlobalizationUtil
|
||||
.globalize("cms.contenttypes.ui.contact.confirm_delete"));
|
||||
return link;
|
||||
} else {
|
||||
return new Label(value.toString());
|
||||
|
|
|
|||
|
|
@ -58,7 +58,8 @@ public class GenericContactEntryAddForm extends BasicItemForm {
|
|||
protected void addWidgets() {
|
||||
|
||||
// Key field
|
||||
add(new Label(ContenttypesGlobalizationUtil.globalize("cms.contenttypes.ui.contact.contactEntry.key")));
|
||||
add(new Label(ContenttypesGlobalizationUtil
|
||||
.globalize("cms.contenttypes.ui.contact.contactEntry.key")));
|
||||
ParameterModel contactEntryKeyParam = new StringParameter(GenericContactEntry.KEY);
|
||||
SingleSelect contactEntryKey = new SingleSelect(contactEntryKeyParam);
|
||||
contactEntryKey.addValidationListener(new NotNullValidationListener());
|
||||
|
|
@ -75,14 +76,16 @@ public class GenericContactEntryAddForm extends BasicItemForm {
|
|||
add(contactEntryKey);
|
||||
|
||||
// Value field
|
||||
add(new Label(ContenttypesGlobalizationUtil.globalize("cms.contenttypes.ui.contact.contactEntry.value")));
|
||||
add(new Label(ContenttypesGlobalizationUtil
|
||||
.globalize("cms.contenttypes.ui.contact.contactEntry.value")));
|
||||
ParameterModel contactEntryValueParam = new StringParameter(GenericContactEntry.VALUE);
|
||||
TextField contactEntryValue = new TextField(contactEntryValueParam);
|
||||
contactEntryValue.addValidationListener(new NotNullValidationListener());
|
||||
add(contactEntryValue);
|
||||
|
||||
// Description field, only for internal usage
|
||||
add(new Label(ContenttypesGlobalizationUtil.globalize("cms.contenttypes.ui.contact.contactEntry.description")));
|
||||
add(new Label(ContenttypesGlobalizationUtil
|
||||
.globalize("cms.contenttypes.ui.contact.contactEntry.description")));
|
||||
ParameterModel contactEntryDescriptionParam = new StringParameter(GenericContactEntry.DESCRIPTION);
|
||||
TextField contactEntryDescription = new TextField(contactEntryDescriptionParam);
|
||||
add(contactEntryDescription);
|
||||
|
|
|
|||
|
|
@ -34,16 +34,25 @@ public class GenericContactPersonPropertiesStep extends SimpleEditStep {
|
|||
/**
|
||||
* Creates a new instance of GenericContactPersonPropertiesStep
|
||||
*/
|
||||
public GenericContactPersonPropertiesStep(ItemSelectionModel itemModel, AuthoringKitWizard parent) {
|
||||
public GenericContactPersonPropertiesStep(ItemSelectionModel itemModel,
|
||||
AuthoringKitWizard parent) {
|
||||
this(itemModel, parent, "");
|
||||
}
|
||||
|
||||
public GenericContactPersonPropertiesStep(ItemSelectionModel itemModel, AuthoringKitWizard parent, String prefix) {
|
||||
public GenericContactPersonPropertiesStep(ItemSelectionModel itemModel,
|
||||
AuthoringKitWizard parent,
|
||||
String prefix) {
|
||||
super(itemModel, parent, prefix);
|
||||
|
||||
BasicPageForm addPersonSheet = new GenericContactAttachPersonPropertyForm(itemModel, this);
|
||||
BasicPageForm addPersonSheet = new
|
||||
GenericContactAttachPersonPropertyForm(itemModel, this);
|
||||
addPerson = new WorkflowLockedComponentAccess(addPersonSheet, itemModel);
|
||||
add(ADD_PERSON_SHEET_NAME, (String) ContenttypesGlobalizationUtil.globalize("cms.contenttypes.ui.contact.attach_person").localize(), addPerson, addPersonSheet.getSaveCancelSection().getCancelButton());
|
||||
add(ADD_PERSON_SHEET_NAME,
|
||||
(String) ContenttypesGlobalizationUtil
|
||||
.globalize("cms.contenttypes.ui.contact.attach_person")
|
||||
.localize(),
|
||||
addPerson,
|
||||
addPersonSheet.getSaveCancelSection().getCancelButton());
|
||||
|
||||
/* Set the displayComponent for this step */
|
||||
setDisplayComponent(getPersonPropertySheet(itemModel));
|
||||
|
|
|
|||
|
|
@ -67,7 +67,8 @@ public class GenericContactPersonSheet
|
|||
colModel.add(new TableColumn(
|
||||
0,
|
||||
ContenttypesGlobalizationUtil.globalize(
|
||||
"cms.contenttypes.ui.contact.person").localize(),
|
||||
// "cms.contenttypes.ui.contact.person").localize(),
|
||||
"cms.contenttypes.ui.contact.person"),
|
||||
TABLE_COL_EDIT));
|
||||
colModel.add(new TableColumn(
|
||||
1,
|
||||
|
|
@ -97,7 +98,8 @@ public class GenericContactPersonSheet
|
|||
@Override
|
||||
public TableModel makeModel(Table table, PageState state) {
|
||||
table.getRowSelectionModel().clearSelection(state);
|
||||
GenericContact contact = (GenericContact) m_itemModel.getSelectedObject(state);
|
||||
GenericContact contact = (GenericContact)
|
||||
m_itemModel.getSelectedObject(state);
|
||||
return new GenericContactPersonSheetModel(table,
|
||||
state,
|
||||
contact);
|
||||
|
|
@ -145,8 +147,9 @@ public class GenericContactPersonSheet
|
|||
return m_person.getFullName();
|
||||
case 1:
|
||||
return ContenttypesGlobalizationUtil.globalize(
|
||||
"cms.contenttypes.ui.contact.delete_person").
|
||||
localize();
|
||||
"cms.contenttypes.ui.contact.delete_person")
|
||||
// .localize();
|
||||
;
|
||||
default:
|
||||
return null;
|
||||
}
|
||||
|
|
@ -170,8 +173,10 @@ public class GenericContactPersonSheet
|
|||
int row,
|
||||
int column) {
|
||||
|
||||
com.arsdigita.cms.SecurityManager securityManager = Utilities.getSecurityManager(state);
|
||||
GenericContact contact = (GenericContact) m_itemModel.getSelectedObject(state);
|
||||
com.arsdigita.cms.SecurityManager securityManager =
|
||||
Utilities.getSecurityManager(state);
|
||||
GenericContact contact = (GenericContact)
|
||||
m_itemModel.getSelectedObject(state);
|
||||
|
||||
boolean canEdit = securityManager.canAccess(
|
||||
state.getRequest(),
|
||||
|
|
@ -190,7 +195,11 @@ public class GenericContactPersonSheet
|
|||
ContentSection section = person.getContentSection();//CMS.getContext().getContentSection();
|
||||
ItemResolver resolver = section.getItemResolver();
|
||||
|
||||
return new Link(value.toString(), resolver.generateItemURL(state, person, section, person.getVersion()));
|
||||
return new Link(value.toString(),
|
||||
resolver.generateItemURL(state,
|
||||
person,
|
||||
section,
|
||||
person.getVersion()));
|
||||
|
||||
} else {
|
||||
|
||||
|
|
@ -224,10 +233,10 @@ public class GenericContactPersonSheet
|
|||
|
||||
if (canEdit) {
|
||||
ControlLink link = new ControlLink(value.toString());
|
||||
link.setConfirmation((String) ContenttypesGlobalizationUtil.globalize(
|
||||
link.setConfirmation(ContenttypesGlobalizationUtil.globalize(
|
||||
"cms.contenttypes.ui.contact.person"
|
||||
+ ".confirm_remove").
|
||||
localize());
|
||||
+ ".confirm_remove")
|
||||
);
|
||||
return link;
|
||||
} else {
|
||||
Label label = new Label(value.toString());
|
||||
|
|
|
|||
|
|
@ -25,7 +25,8 @@ import org.apache.log4j.Logger;
|
|||
*/
|
||||
public class GenericContactPropertiesStep extends SimpleEditStep {
|
||||
|
||||
private static final Logger logger = Logger.getLogger(GenericContactPropertiesStep.class);
|
||||
private static final Logger logger = Logger.getLogger(
|
||||
GenericContactPropertiesStep.class);
|
||||
/**
|
||||
* Name of the this edit sheet (Don't know if this this really needed.
|
||||
* It has the same value in almost all PropertiesStep classes)
|
||||
|
|
@ -38,7 +39,8 @@ public class GenericContactPropertiesStep extends SimpleEditStep {
|
|||
* @param itemModel
|
||||
* @param parent
|
||||
*/
|
||||
public GenericContactPropertiesStep(ItemSelectionModel itemModel, AuthoringKitWizard parent) {
|
||||
public GenericContactPropertiesStep(ItemSelectionModel itemModel,
|
||||
AuthoringKitWizard parent) {
|
||||
super(itemModel, parent);
|
||||
|
||||
setDefaultEditKey(EDIT_BASIC_SHEET_NAME);
|
||||
|
|
@ -48,42 +50,75 @@ public class GenericContactPropertiesStep extends SimpleEditStep {
|
|||
setDisplayComponent(segmentedPanel);
|
||||
}
|
||||
|
||||
protected SegmentedPanel createEditSheet(ItemSelectionModel itemModel, AuthoringKitWizard parent) {
|
||||
/**
|
||||
*
|
||||
* @param itemModel
|
||||
* @param parent
|
||||
* @return
|
||||
*/
|
||||
protected SegmentedPanel createEditSheet(ItemSelectionModel itemModel,
|
||||
AuthoringKitWizard parent) {
|
||||
/* Use a Segmented Panel for the multiple parts of data */
|
||||
SegmentedPanel segmentedPanel = new SegmentedPanel();
|
||||
|
||||
/* The different parts of information are displayed in seperated segments each containing a SimpleEditStep */
|
||||
/* The different parts of information are displayed in seperated
|
||||
* segments each containing a SimpleEditStep */
|
||||
/* Well, not so simple anymore... */
|
||||
/* A new SimpleEditStep */
|
||||
SimpleEditStep basicProperties = new SimpleEditStep(itemModel, parent, EDIT_BASIC_SHEET_NAME);
|
||||
SimpleEditStep basicProperties = new SimpleEditStep(itemModel,
|
||||
parent,
|
||||
EDIT_BASIC_SHEET_NAME);
|
||||
|
||||
/* Create the edit component for this SimpleEditStep and the corresponding link */
|
||||
BasicPageForm editBasicSheet = new GenericContactPropertyForm(itemModel, this);
|
||||
basicProperties.add(EDIT_BASIC_SHEET_NAME, (String) ContenttypesGlobalizationUtil.globalize("cms.contenttypes.ui.contact.edit_basic_properties").localize(), new WorkflowLockedComponentAccess(editBasicSheet, itemModel), editBasicSheet.getSaveCancelSection().getCancelButton());
|
||||
basicProperties.add(
|
||||
EDIT_BASIC_SHEET_NAME,
|
||||
(String) ContenttypesGlobalizationUtil
|
||||
.globalize("cms.contenttypes.ui.contact.edit_basic_properties")
|
||||
.localize(),
|
||||
new WorkflowLockedComponentAccess(
|
||||
editBasicSheet,
|
||||
itemModel),
|
||||
editBasicSheet.getSaveCancelSection().getCancelButton());
|
||||
|
||||
/* Set the displayComponent for this step */
|
||||
basicProperties.setDisplayComponent(getContactPropertySheet(itemModel));
|
||||
|
||||
/* Add the SimpleEditStep to the segmented panel */
|
||||
segmentedPanel.addSegment(new Label((String) ContenttypesGlobalizationUtil.globalize("cms.contenttypes.ui.contact.basic_properties").localize()), basicProperties);
|
||||
segmentedPanel
|
||||
.addSegment(new Label(ContenttypesGlobalizationUtil
|
||||
.globalize("cms.contenttypes.ui.contact.basic_properties")),
|
||||
basicProperties);
|
||||
|
||||
// If not disabled via registry, add the ui for attaching a person
|
||||
if (!GenericContact.getConfig().getHidePerson()) {
|
||||
|
||||
GenericContactPersonPropertiesStep personProperties = new GenericContactPersonPropertiesStep(itemModel, parent);
|
||||
segmentedPanel.addSegment(new Label((String) ContenttypesGlobalizationUtil.globalize("cms.contenttypes.ui.contact.person").localize()), personProperties);
|
||||
GenericContactPersonPropertiesStep personProperties = new
|
||||
GenericContactPersonPropertiesStep(itemModel, parent);
|
||||
segmentedPanel
|
||||
.addSegment(new Label(ContenttypesGlobalizationUtil
|
||||
.globalize("cms.contenttypes.ui.contact.person")),
|
||||
personProperties);
|
||||
|
||||
}
|
||||
|
||||
if (!GenericContact.getConfig().getHideAddress()) {
|
||||
|
||||
GenericContactAddressPropertiesStep addressProperties = new GenericContactAddressPropertiesStep(itemModel, parent);
|
||||
segmentedPanel.addSegment(new Label((String) ContenttypesGlobalizationUtil.globalize("cms.contenttypes.ui.contact.address").localize()), addressProperties);
|
||||
GenericContactAddressPropertiesStep addressProperties = new
|
||||
GenericContactAddressPropertiesStep(itemModel, parent);
|
||||
segmentedPanel
|
||||
.addSegment(new Label(ContenttypesGlobalizationUtil
|
||||
.globalize("cms.contenttypes.ui.contact.address")),
|
||||
addressProperties);
|
||||
|
||||
}
|
||||
|
||||
GenericContactEntriesPropertiesStep contactEntries = new GenericContactEntriesPropertiesStep(itemModel, parent);
|
||||
segmentedPanel.addSegment(new Label((String) ContenttypesGlobalizationUtil.globalize("cms.contenttypes.ui.contact.contactEntry").localize()), contactEntries);
|
||||
GenericContactEntriesPropertiesStep contactEntries = new
|
||||
GenericContactEntriesPropertiesStep(itemModel, parent);
|
||||
segmentedPanel
|
||||
.addSegment(new Label(ContenttypesGlobalizationUtil
|
||||
.globalize("cms.contenttypes.ui.contact.contactEntry")),
|
||||
contactEntries);
|
||||
|
||||
return segmentedPanel;
|
||||
}
|
||||
|
|
@ -105,7 +140,10 @@ public class GenericContactPropertiesStep extends SimpleEditStep {
|
|||
sheet.add(GlobalizationUtil.globalize("cms.contenttypes.ui.title"), "title");
|
||||
|
||||
if (!ContentSection.getConfig().getHideLaunchDate()) {
|
||||
sheet.add(GlobalizationUtil.globalize("cms.ui.authoring.page_launch_date"), ContentPage.LAUNCH_DATE, new DomainObjectPropertySheet.AttributeFormatter() {
|
||||
|
||||
sheet.add(GlobalizationUtil.globalize("cms.ui.authoring.page_launch_date"),
|
||||
ContentPage.LAUNCH_DATE,
|
||||
new DomainObjectPropertySheet.AttributeFormatter() {
|
||||
|
||||
public String format(DomainObject obj, String attribute, PageState state) {
|
||||
ContentPage page = (ContentPage) obj;
|
||||
|
|
|
|||
|
|
@ -15,9 +15,13 @@ import org.apache.log4j.Logger;
|
|||
/**
|
||||
* Form for editing the basic properties of a basic contact.
|
||||
*/
|
||||
public class GenericContactPropertyForm extends BasicPageForm implements FormProcessListener, FormInitListener, FormSubmissionListener {
|
||||
public class GenericContactPropertyForm extends BasicPageForm
|
||||
implements FormProcessListener,
|
||||
FormInitListener,
|
||||
FormSubmissionListener {
|
||||
|
||||
private static final Logger logger = Logger.getLogger(GenericContactPropertyForm.class);
|
||||
private static final Logger logger = Logger.getLogger(
|
||||
GenericContactPropertyForm.class);
|
||||
|
||||
private GenericContactPropertiesStep m_step;
|
||||
|
||||
|
|
@ -40,23 +44,30 @@ public class GenericContactPropertyForm extends BasicPageForm implements FormPro
|
|||
}
|
||||
|
||||
/**
|
||||
* Constrctor taking an ItemSelectionModel and an instance of BaseContactPropertiesStep.
|
||||
* Constructor taking an ItemSelectionModel and an instance of
|
||||
* BaseContactPropertiesStep.
|
||||
*
|
||||
* @param itemModel
|
||||
* @param step
|
||||
*/
|
||||
public GenericContactPropertyForm(ItemSelectionModel itemModel, GenericContactPropertiesStep step) {
|
||||
public GenericContactPropertyForm(ItemSelectionModel itemModel,
|
||||
GenericContactPropertiesStep step) {
|
||||
super(ID, itemModel);
|
||||
m_step = step;
|
||||
addSubmissionListener(this);
|
||||
}
|
||||
|
||||
/**
|
||||
*
|
||||
*/
|
||||
@Override
|
||||
public void addWidgets() {
|
||||
super.addWidgets();
|
||||
|
||||
/*
|
||||
add(new Label((String)BaseContactGlobalizationUtil.globalize("cms.contenttypes.ui.contact.basic_properties.description").localize())));
|
||||
add(new Label(BaseContactGlobalizationUtil.globalize(
|
||||
"cms.contenttypes.ui.contact.basic_properties.description")
|
||||
)));
|
||||
TextArea description = new TextArea(DESCRIPTION);
|
||||
description.setRows(5);
|
||||
description.setCols(30);
|
||||
|
|
@ -78,9 +89,9 @@ public class GenericContactPropertyForm extends BasicPageForm implements FormPro
|
|||
|
||||
GenericContact contact = (GenericContact)super.processBasicWidgets(e);
|
||||
|
||||
if((contact != null) && (getSaveCancelSection().getSaveButton().isSelected(e.getPageState()))) {
|
||||
if((contact != null)
|
||||
&& (getSaveCancelSection().getSaveButton().isSelected(e.getPageState()))) {
|
||||
// contact.setDescription((String)data.get(DESCRIPTION));
|
||||
|
||||
contact.save();
|
||||
}
|
||||
|
||||
|
|
@ -90,7 +101,8 @@ public class GenericContactPropertyForm extends BasicPageForm implements FormPro
|
|||
}
|
||||
|
||||
public void submitted(FormSectionEvent e) throws FormProcessException {
|
||||
if((m_step != null) && (getSaveCancelSection().getCancelButton().isSelected(e.getPageState()))) {
|
||||
if((m_step != null)
|
||||
&& (getSaveCancelSection().getCancelButton().isSelected(e.getPageState()))) {
|
||||
m_step.cancelStreamlinedCreation(e.getPageState());
|
||||
}
|
||||
}
|
||||
|
|
|
|||
|
|
@ -52,10 +52,12 @@ import org.apache.log4j.Logger;
|
|||
*/
|
||||
public class GenericContactTypeAddForm extends BasicItemForm {
|
||||
|
||||
private static final Logger s_log = Logger.getLogger(
|
||||
GenericContactTypeAddForm.class);
|
||||
|
||||
public final static String KEY = RelationAttribute.KEY;
|
||||
public final static String LANGUAGE = RelationAttribute.LANGUAGE;
|
||||
public final static String NAME = RelationAttribute.NAME;
|
||||
private static final Logger s_log = Logger.getLogger(GenericContactTypeAddForm.class);
|
||||
private GenericPersonPropertiesStep m_step;
|
||||
private SaveCancelSection m_saveCancelSection;
|
||||
private ItemSelectionModel m_itemModel;
|
||||
|
|
@ -72,7 +74,8 @@ public class GenericContactTypeAddForm extends BasicItemForm {
|
|||
@Override
|
||||
protected void addWidgets() {
|
||||
// Key
|
||||
add(new Label((String) ContenttypesGlobalizationUtil.globalize("cms.contenttypes.ui.contacttypes.key").localize()));
|
||||
add(new Label(ContenttypesGlobalizationUtil
|
||||
.globalize("cms.contenttypes.ui.contacttypes.key")));
|
||||
ParameterModel keyParam = new StringParameter(KEY);
|
||||
keyParam.addParameterListener(new NotNullValidationListener());
|
||||
keyParam.addParameterListener(new StringInRangeValidationListener(0, 1000));
|
||||
|
|
@ -80,14 +83,16 @@ public class GenericContactTypeAddForm extends BasicItemForm {
|
|||
add(key);
|
||||
|
||||
// Language
|
||||
add(new Label((String) ContenttypesGlobalizationUtil.globalize("cms.contenttypes.ui.contacttypes.language").localize()));
|
||||
add(new Label(ContenttypesGlobalizationUtil
|
||||
.globalize("cms.contenttypes.ui.contacttypes.language")));
|
||||
ParameterModel languageParam = new StringParameter(LANGUAGE);
|
||||
language = new SingleSelect(languageParam);
|
||||
language.addValidationListener(new NotNullValidationListener());
|
||||
language.addOption(new Option("", new Label((String) ContenttypesGlobalizationUtil.globalize("cms.ui.select_one").localize())));
|
||||
|
||||
// Name
|
||||
add(new Label((String) ContenttypesGlobalizationUtil.globalize("cms.contenttypes.ui.contacttypes.name").localize()));
|
||||
add(new Label(ContenttypesGlobalizationUtil
|
||||
.globalize("cms.contenttypes.ui.contacttypes.name")));
|
||||
ParameterModel nameParam = new StringParameter(NAME);
|
||||
nameParam.addParameterListener(new NotNullValidationListener());
|
||||
nameParam.addParameterListener(new StringInRangeValidationListener(0, 1000));
|
||||
|
|
@ -100,8 +105,11 @@ public class GenericContactTypeAddForm extends BasicItemForm {
|
|||
public void init(FormSectionEvent fse) {
|
||||
FormData data = fse.getFormData();
|
||||
PageState state = fse.getPageState();
|
||||
RelationAttribute contacttype = (RelationAttribute) getItemSelectionModel().getSelectedObject(state);
|
||||
GenericContactTypeCollection contacttypeCollection = new GenericContactTypeCollection(contacttype.getKey());
|
||||
RelationAttribute contacttype = (RelationAttribute)
|
||||
getItemSelectionModel()
|
||||
.getSelectedObject(state);
|
||||
GenericContactTypeCollection contacttypeCollection = new
|
||||
GenericContactTypeCollection(contacttype.getKey());
|
||||
|
||||
// all supported languages (by registry entry)
|
||||
KernelConfig kernelConfig = Kernel.getConfig();
|
||||
|
|
@ -113,7 +121,10 @@ public class GenericContactTypeAddForm extends BasicItemForm {
|
|||
|
||||
// If lanuage exists, remove it from the selection list
|
||||
if (!contacttypeCollection.hasLanguage(code)) {
|
||||
language.addOption(new Option(code, new Locale(code).getDisplayLanguage()), state);
|
||||
language.addOption(new
|
||||
Option(code,
|
||||
new Locale(code).getDisplayLanguage()),
|
||||
state);
|
||||
}
|
||||
}
|
||||
|
||||
|
|
@ -127,7 +138,9 @@ public class GenericContactTypeAddForm extends BasicItemForm {
|
|||
public void process(FormSectionEvent fse) {
|
||||
FormData data = fse.getFormData();
|
||||
PageState state = fse.getPageState();
|
||||
RelationAttribute contacttype = (RelationAttribute) getItemSelectionModel().getSelectedObject(state);
|
||||
RelationAttribute contacttype = (RelationAttribute)
|
||||
getItemSelectionModel()
|
||||
.getSelectedObject(state);
|
||||
|
||||
//
|
||||
if (!this.getSaveCancelSection().getCancelButton().isSelected(state)) {
|
||||
|
|
|
|||
|
|
@ -33,20 +33,25 @@ public class GenericContactTypePropertiesStep extends SimpleEditStep {
|
|||
/** The name of the editing sheet added to this step */
|
||||
private static String ADD_CONTACT_SHEET_NAME = "addContactType";
|
||||
|
||||
public GenericContactTypePropertiesStep(ItemSelectionModel itemModel, AuthoringKitWizard parent) {
|
||||
public GenericContactTypePropertiesStep(ItemSelectionModel itemModel,
|
||||
AuthoringKitWizard parent) {
|
||||
this(itemModel, parent, null);
|
||||
}
|
||||
|
||||
public GenericContactTypePropertiesStep(ItemSelectionModel itemModel, AuthoringKitWizard parent, String prefix) {
|
||||
public GenericContactTypePropertiesStep(ItemSelectionModel itemModel,
|
||||
AuthoringKitWizard parent,
|
||||
String prefix) {
|
||||
super(itemModel, parent, prefix);
|
||||
|
||||
BasicItemForm addContactTypeSheet = new GenericContactTypeAddForm(itemModel);
|
||||
add(ADD_CONTACT_SHEET_NAME,
|
||||
(String) ContenttypesGlobalizationUtil.globalize("cms.contenttypes.ui.person.add_contacttype").localize(),
|
||||
(String) ContenttypesGlobalizationUtil.globalize(
|
||||
"cms.contenttypes.ui.person.add_contacttype").localize(),
|
||||
new WorkflowLockedComponentAccess(addContactTypeSheet, itemModel),
|
||||
addContactTypeSheet.getSaveCancelSection().getCancelButton());
|
||||
|
||||
GenericContactTypeTable contacttypesTable = new GenericContactTypeTable(itemModel);
|
||||
GenericContactTypeTable contacttypesTable = new
|
||||
GenericContactTypeTable(itemModel);
|
||||
setDisplayComponent(contacttypesTable);
|
||||
|
||||
}
|
||||
|
|
|
|||
|
|
@ -64,9 +64,26 @@ public class GenericContactTypeTable extends Table implements TableActionListene
|
|||
TableColumnModel tab_model = getColumnModel();
|
||||
|
||||
// define columns
|
||||
tab_model.add(new TableColumn(0, ContenttypesGlobalizationUtil.globalize("cms.contenttypes.ui.contacttypes.key").localize(), TABLE_COL_EDIT));
|
||||
tab_model.add(new TableColumn(1, ContenttypesGlobalizationUtil.globalize("cms.contenttypes.ui.contacttypes.title").localize()));
|
||||
tab_model.add(new TableColumn(2, ContenttypesGlobalizationUtil.globalize("cms.contenttypes.ui.contacttypes.action").localize(), TABLE_COL_DEL));
|
||||
tab_model.add(new TableColumn(
|
||||
0,
|
||||
ContenttypesGlobalizationUtil
|
||||
.globalize("cms.contenttypes.ui.contacttypes.key")
|
||||
// .localize()
|
||||
,
|
||||
TABLE_COL_EDIT));
|
||||
tab_model.add(new TableColumn(
|
||||
1,
|
||||
ContenttypesGlobalizationUtil
|
||||
.globalize("cms.contenttypes.ui.contacttypes.title")
|
||||
//.localize()
|
||||
));
|
||||
tab_model.add(new TableColumn(
|
||||
2,
|
||||
ContenttypesGlobalizationUtil
|
||||
.globalize("cms.contenttypes.ui.contacttypes.action")
|
||||
.localize()
|
||||
,
|
||||
TABLE_COL_DEL));
|
||||
|
||||
setModelBuilder(new GenericContactTypeTableModelBuilder(itemModel));
|
||||
|
||||
|
|
@ -81,7 +98,8 @@ public class GenericContactTypeTable extends Table implements TableActionListene
|
|||
* XXXX
|
||||
*
|
||||
*/
|
||||
private class GenericContactTypeTableModelBuilder extends LockableImpl implements TableModelBuilder {
|
||||
private class GenericContactTypeTableModelBuilder extends LockableImpl
|
||||
implements TableModelBuilder {
|
||||
|
||||
private ItemSelectionModel m_itemModel;
|
||||
|
||||
|
|
@ -105,12 +123,16 @@ public class GenericContactTypeTable extends Table implements TableActionListene
|
|||
final private int MAX_DESC_LENGTH = 25;
|
||||
private Table m_table;
|
||||
private RelationAttribute m_contacttype;
|
||||
private GenericContactTypeCollection m_contacttypeCollection = new GenericContactTypeCollection();
|
||||
private GenericContactTypeCollection m_contacttypeCollection = new
|
||||
GenericContactTypeCollection();
|
||||
|
||||
private GenericContactTypeTableModel(Table t, PageState ps, RelationAttribute contacttype) {
|
||||
private GenericContactTypeTableModel(Table t,
|
||||
PageState ps,
|
||||
RelationAttribute contacttype) {
|
||||
m_table = t;
|
||||
m_contacttype = contacttype;
|
||||
// m_contacttypeCollection.addLanguageFilter(DispatcherHelper.getNegotiatedLocale().getLanguage());
|
||||
// m_contacttypeCollection.addLanguageFilter(
|
||||
// DispatcherHelper.getNegotiatedLocale().getLanguage());
|
||||
}
|
||||
|
||||
public int getColumnCount() {
|
||||
|
|
@ -147,7 +169,9 @@ public class GenericContactTypeTable extends Table implements TableActionListene
|
|||
case 1:
|
||||
return m_contacttypeCollection.getName();
|
||||
case 2:
|
||||
return GlobalizationUtil.globalize("cms.ui.delete").localize();
|
||||
return GlobalizationUtil.globalize("cms.ui.delete")
|
||||
//.localize()
|
||||
;
|
||||
default:
|
||||
return null;
|
||||
}
|
||||
|
|
@ -173,7 +197,8 @@ public class GenericContactTypeTable extends Table implements TableActionListene
|
|||
int row, int column) {
|
||||
|
||||
SecurityManager sm = Utilities.getSecurityManager(state);
|
||||
RelationAttribute contacttype = (RelationAttribute) m_itemModel.getSelectedObject(state);
|
||||
RelationAttribute contacttype = (RelationAttribute)
|
||||
m_itemModel.getSelectedObject(state);
|
||||
|
||||
// boolean canEdit = sm.canAccess(state.getRequest(),
|
||||
// SecurityManager.EDIT_ITEM,
|
||||
|
|
@ -198,14 +223,18 @@ public class GenericContactTypeTable extends Table implements TableActionListene
|
|||
int row, int column) {
|
||||
|
||||
SecurityManager sm = Utilities.getSecurityManager(state);
|
||||
RelationAttribute contacttype = (RelationAttribute) m_itemModel.getSelectedObject(state);
|
||||
RelationAttribute contacttype = (RelationAttribute)
|
||||
m_itemModel.getSelectedObject(state);
|
||||
|
||||
// boolean canDelete = sm.canAccess(state.getRequest(),
|
||||
// SecurityManager.DELETE_ITEM,
|
||||
// contacttype);
|
||||
// if (canDelete) {
|
||||
ControlLink link = new ControlLink(value.toString());
|
||||
link.setConfirmation((String) ContenttypesGlobalizationUtil.globalize("cms.contenttypes.ui.contacttype.confirm_delete").localize());
|
||||
link.setConfirmation(ContenttypesGlobalizationUtil
|
||||
.globalize(
|
||||
"cms.contenttypes.ui.contacttype.confirm_delete")
|
||||
);
|
||||
return link;
|
||||
// } else {
|
||||
// return new Label(value.toString());
|
||||
|
|
@ -223,7 +252,8 @@ public class GenericContactTypeTable extends Table implements TableActionListene
|
|||
PageState state = evt.getPageState();
|
||||
|
||||
// Get selected GenericContactType
|
||||
RelationAttribute contacttype = new RelationAttribute(new BigDecimal(evt.getRowKey().toString()));
|
||||
RelationAttribute contacttype = new RelationAttribute(new
|
||||
BigDecimal(evt.getRowKey().toString()));
|
||||
|
||||
// Get selected column
|
||||
TableColumn col = getColumnModel().get(evt.getColumn().intValue());
|
||||
|
|
|
|||
|
|
@ -33,7 +33,7 @@ import org.apache.log4j.Logger;
|
|||
* jensp $
|
||||
*/
|
||||
public abstract class GenericOrgaUnitExtraXmlGenerator
|
||||
implements ExtraXMLGenerator {
|
||||
implements ExtraXMLGenerator {
|
||||
|
||||
private final static Logger logger =
|
||||
Logger.getLogger(
|
||||
|
|
|
|||
|
|
@ -151,7 +151,7 @@ public abstract class GenericOrgaUnitMembersTab implements GenericOrgaUnitTab {
|
|||
final List<GenericPerson> persons,
|
||||
final PageState state) {
|
||||
final GenericOrganizationalUnitSubordinateCollection subOrgaUnits =
|
||||
orgaunit.getSubordinateOrgaUnits();
|
||||
orgaunit.getSubordinateOrgaUnits();
|
||||
final StringBuffer assocTypeFilter = new StringBuffer();
|
||||
for (String assocType : getAssocTypesToMerge()) {
|
||||
if (assocTypeFilter.length() > 0) {
|
||||
|
|
|
|||
|
|
@ -73,8 +73,8 @@ public class GenericOrganizationalUnitContactAddForm
|
|||
|
||||
@Override
|
||||
protected void addWidgets() {
|
||||
add(new Label((String) ContenttypesGlobalizationUtil.globalize(
|
||||
"cms.contenttypes.ui.genericorgaunit.select_contact").localize()));
|
||||
add(new Label(ContenttypesGlobalizationUtil.globalize(
|
||||
"cms.contenttypes.ui.genericorgaunit.select_contact")));
|
||||
m_itemSearch = new ItemSearchWidget(ITEM_SEARCH, ContentType.
|
||||
findByAssociatedObjectType(GenericContact.class.getName()));
|
||||
m_itemSearch.setDisableCreatePane(false);
|
||||
|
|
@ -90,8 +90,8 @@ public class GenericOrganizationalUnitContactAddForm
|
|||
SingleSelect contactType = new SingleSelect(contactTypeParam);
|
||||
contactType.addValidationListener(new NotNullValidationListener());
|
||||
contactType.addOption(new Option("",
|
||||
new Label((String) ContenttypesGlobalizationUtil.
|
||||
globalize("cms.ui.select_one").localize())));
|
||||
new Label(ContenttypesGlobalizationUtil.
|
||||
globalize("cms.ui.select_one"))));
|
||||
|
||||
GenericContactTypeCollection contacttypes =
|
||||
new GenericContactTypeCollection();
|
||||
|
|
@ -197,7 +197,7 @@ public class GenericOrganizationalUnitContactAddForm
|
|||
if ((editStep.getSelectedContact() == null)
|
||||
&& (data.get(ITEM_SEARCH) == null)) {
|
||||
data.addError(
|
||||
"cms.contenttypes.ui.genericorgaunit.select_contact.no_contact_selected");
|
||||
"cms.contenttypes.ui.genericorgaunit.select_contact.no_contact_selected");
|
||||
|
||||
return;
|
||||
}
|
||||
|
|
|
|||
|
|
@ -83,11 +83,11 @@ public class GenericOrganizationalUnitContactTable extends Table implements
|
|||
tabModel.add(new TableColumn(
|
||||
0,
|
||||
ContenttypesGlobalizationUtil.globalize(
|
||||
"cms.contenttypes.ui.genericorgaunit.contact.type").localize()));
|
||||
"cms.contenttypes.ui.genericorgaunit.contact.type")));
|
||||
tabModel.add(new TableColumn(
|
||||
1,
|
||||
ContenttypesGlobalizationUtil.globalize(
|
||||
"cms.contenttypes.ui.genericorgaunit.contact.title").localize(),
|
||||
"cms.contenttypes.ui.genericorgaunit.contact.title"),
|
||||
TABLE_COL_EDIT));
|
||||
tabModel.add(new TableColumn(
|
||||
2,
|
||||
|
|
|
|||
|
|
@ -74,8 +74,8 @@ public class GenericOrganizationalUnitPersonAddForm
|
|||
|
||||
@Override
|
||||
protected void addWidgets() {
|
||||
add(new Label((String) ContenttypesGlobalizationUtil.globalize(
|
||||
"cms.contenttypes.ui.genericorgaunit.select_person").localize()));
|
||||
add(new Label(ContenttypesGlobalizationUtil.globalize(
|
||||
"cms.contenttypes.ui.genericorgaunit.select_person")));
|
||||
m_itemSearch = new ItemSearchWidget(ITEM_SEARCH, ContentType.
|
||||
findByAssociatedObjectType(getPersonType()));
|
||||
/*m_itemSearch.getItemField().addValidationListener(
|
||||
|
|
@ -95,8 +95,8 @@ public class GenericOrganizationalUnitPersonAddForm
|
|||
roleSelect.addValidationListener(new NotNullValidationListener());
|
||||
roleSelect.addOption(
|
||||
new Option("",
|
||||
new Label((String) ContenttypesGlobalizationUtil.
|
||||
globalize("cms.ui.select_one").localize())));
|
||||
new Label(ContenttypesGlobalizationUtil
|
||||
.globalize("cms.ui.select_one"))));
|
||||
RelationAttributeCollection roles = new RelationAttributeCollection(
|
||||
getRoleAttributeName());
|
||||
roles.addLanguageFilter(GlobalizationHelper.getNegotiatedLocale().
|
||||
|
|
@ -116,8 +116,8 @@ public class GenericOrganizationalUnitPersonAddForm
|
|||
SingleSelect statusSelect = new SingleSelect(statusModel);
|
||||
statusSelect.addValidationListener(new NotNullValidationListener());
|
||||
statusSelect.addOption(new Option("",
|
||||
new Label((String) ContenttypesGlobalizationUtil.
|
||||
globalize("cms.ui.select_one").localize())));
|
||||
new Label(ContenttypesGlobalizationUtil.
|
||||
globalize("cms.ui.select_one"))));
|
||||
RelationAttributeCollection statusColl =
|
||||
new RelationAttributeCollection(
|
||||
getStatusAttributeName());
|
||||
|
|
|
|||
|
|
@ -70,18 +70,18 @@ public class GenericOrganizationalUnitPersonsTable extends Table implements
|
|||
this.personSelector = personSelector;
|
||||
|
||||
setEmptyView(new Label(ContenttypesGlobalizationUtil.globalize(
|
||||
"cms.contenttypes.ui.genericorgaunit.persons.none")));
|
||||
"cms.contenttypes.ui.genericorgaunit.persons.none")));
|
||||
TableColumnModel tabModel = getColumnModel();
|
||||
|
||||
tabModel.add(new TableColumn(
|
||||
0,
|
||||
ContenttypesGlobalizationUtil.globalize(
|
||||
"cms.contenttypes.ui.genericorgaunit.persons.name").localize(),
|
||||
"cms.contenttypes.ui.genericorgaunit.persons.name"),
|
||||
TABLE_COL_EDIT));
|
||||
tabModel.add(new TableColumn(
|
||||
1,
|
||||
ContenttypesGlobalizationUtil.globalize(
|
||||
"cms.contenttypes.ui.genericorgaunit.persons.role").localize()));
|
||||
"cms.contenttypes.ui.genericorgaunit.persons.role")));
|
||||
tabModel.add(
|
||||
new TableColumn(
|
||||
2,
|
||||
|
|
|
|||
|
|
@ -123,9 +123,8 @@ public class GenericOrganizationalUnitPropertiesStep extends SimpleEditStep {
|
|||
itemModel));
|
||||
|
||||
segmentedPanel.addSegment(
|
||||
new Label((String) ContenttypesGlobalizationUtil.globalize(
|
||||
"cms.contenttypes.ui.genericorganunit.basic_properties").
|
||||
localize()),
|
||||
new Label(ContenttypesGlobalizationUtil.globalize(
|
||||
"cms.contenttypes.ui.genericorganunit.basic_properties")),
|
||||
basicProperties);
|
||||
}
|
||||
|
||||
|
|
|
|||
|
|
@ -76,8 +76,8 @@ public class GenericOrganizationalUnitPropertyForm
|
|||
add(name);*/
|
||||
|
||||
add(new Label(
|
||||
(String) ContenttypesGlobalizationUtil.globalize(
|
||||
"cms.contenttypes.ui.genericorgaunit.addendum").localize()));
|
||||
ContenttypesGlobalizationUtil.globalize(
|
||||
"cms.contenttypes.ui.genericorgaunit.addendum")));
|
||||
ParameterModel addendumParam = new StringParameter(ADDENDUM);
|
||||
TextField addendum = new TextField(addendumParam);
|
||||
add(addendum);
|
||||
|
|
|
|||
|
|
@ -35,13 +35,10 @@ import com.arsdigita.cms.CMS;
|
|||
import com.arsdigita.cms.ContentSection;
|
||||
import com.arsdigita.cms.ItemSelectionModel;
|
||||
import com.arsdigita.cms.contenttypes.GenericOrganizationalUnit;
|
||||
import com.arsdigita.cms.contenttypes.GenericOrganizationalUnitBundle;
|
||||
import com.arsdigita.cms.contenttypes.GenericOrganizationalUnitSuperiorCollection;
|
||||
import com.arsdigita.cms.dispatcher.ItemResolver;
|
||||
import com.arsdigita.cms.dispatcher.Utilities;
|
||||
import com.arsdigita.domain.DomainObjectFactory;
|
||||
import com.arsdigita.globalization.GlobalizationHelper;
|
||||
import com.arsdigita.persistence.OID;
|
||||
import com.arsdigita.util.LockableImpl;
|
||||
import java.math.BigDecimal;
|
||||
|
||||
|
|
|
|||
|
|
@ -53,8 +53,8 @@ public class GenericPersonAliasDeleteForm
|
|||
|
||||
@Override
|
||||
public void addWidgets() {
|
||||
add(new Label((String) ContenttypesGlobalizationUtil.globalize(
|
||||
"cms.contenttypes.ui.person.alias.delete.confirm").localize()));
|
||||
add(new Label(ContenttypesGlobalizationUtil.globalize(
|
||||
"cms.contenttypes.ui.person.alias.delete.confirm")));
|
||||
}
|
||||
|
||||
@Override
|
||||
|
|
@ -65,7 +65,8 @@ public class GenericPersonAliasDeleteForm
|
|||
@Override
|
||||
public void process(final FormSectionEvent fse) throws FormProcessException {
|
||||
final PageState state = fse.getPageState();
|
||||
final GenericPerson person = (GenericPerson) getItemSelectionModel().getSelectedObject(state);
|
||||
final GenericPerson person = (GenericPerson) getItemSelectionModel()
|
||||
.getSelectedObject(state);
|
||||
|
||||
if ((person != null) && (person.getAlias() != null)) {
|
||||
person.unsetAlias();
|
||||
|
|
@ -87,10 +88,9 @@ public class GenericPersonAliasDeleteForm
|
|||
(GenericPerson) getItemSelectionModel().
|
||||
getSelectedObject(event.getPageState());
|
||||
Submit target = (Submit) event.getTarget();
|
||||
target.setButtonLabel((String) ContenttypesGlobalizationUtil.
|
||||
target.setButtonLabel(ContenttypesGlobalizationUtil.
|
||||
globalize(
|
||||
"cms.contenttypes.ui.person.alias.delete.label").
|
||||
localize());
|
||||
"cms.contenttypes.ui.person.alias.delete.label"));
|
||||
}
|
||||
});
|
||||
} catch (Exception ex) {
|
||||
|
|
|
|||
|
|
@ -69,8 +69,8 @@ public class GenericPersonAliasSetForm
|
|||
|
||||
@Override
|
||||
public void addWidgets() {
|
||||
add(new Label((String) ContenttypesGlobalizationUtil.globalize(
|
||||
"cms.contenttypes.ui.person.alias.select").localize()));
|
||||
add(new Label(ContenttypesGlobalizationUtil.globalize(
|
||||
"cms.contenttypes.ui.person.alias.select")));
|
||||
itemSearch = new ItemSearchWidget(ITEM_SEARCH, ContentType.
|
||||
findByAssociatedObjectType(
|
||||
"com.arsdigita.cms.contenttypes.GenericPerson"));
|
||||
|
|
@ -125,15 +125,13 @@ public class GenericPersonAliasSetForm
|
|||
Submit target = (Submit) event.getTarget();
|
||||
|
||||
if (person.getAlias() != null) {
|
||||
target.setButtonLabel((String) ContenttypesGlobalizationUtil.
|
||||
target.setButtonLabel(ContenttypesGlobalizationUtil.
|
||||
globalize(
|
||||
"cms.contenttypes.ui.contact.alias.select.change").
|
||||
localize());
|
||||
"cms.contenttypes.ui.contact.alias.select.change"));
|
||||
} else {
|
||||
target.setButtonLabel((String) ContenttypesGlobalizationUtil.
|
||||
target.setButtonLabel(ContenttypesGlobalizationUtil.
|
||||
globalize(
|
||||
"cms.contenttypes.ui.contact.alias.select.add").
|
||||
localize());
|
||||
"cms.contenttypes.ui.contact.alias.select.add"));
|
||||
}
|
||||
}
|
||||
});
|
||||
|
|
|
|||
|
|
@ -76,8 +76,8 @@ public class GenericPersonContactAddForm extends BasicItemForm {
|
|||
protected void addWidgets() {
|
||||
|
||||
// Attach a GenericContact object
|
||||
add(new Label((String) ContenttypesGlobalizationUtil.globalize(
|
||||
"cms.contenttypes.ui.person.select_contact").localize()));
|
||||
add(new Label(ContenttypesGlobalizationUtil.globalize(
|
||||
"cms.contenttypes.ui.person.select_contact")));
|
||||
this.m_itemSearch = new ItemSearchWidget(ITEM_SEARCH, ContentType.
|
||||
findByAssociatedObjectType(
|
||||
"com.arsdigita.cms.contenttypes.GenericContact"));
|
||||
|
|
@ -92,8 +92,8 @@ public class GenericPersonContactAddForm extends BasicItemForm {
|
|||
SingleSelect contactType = new SingleSelect(contactTypeParam);
|
||||
contactType.addValidationListener(new NotNullValidationListener());
|
||||
contactType.addOption(new Option("",
|
||||
new Label((String) ContenttypesGlobalizationUtil.
|
||||
globalize("cms.ui.select_one").localize())));
|
||||
new Label(ContenttypesGlobalizationUtil.
|
||||
globalize("cms.ui.select_one"))));
|
||||
|
||||
// Add the Options to the SingleSelect widget
|
||||
GenericContactTypeCollection contacttypes =
|
||||
|
|
|
|||
|
|
@ -305,9 +305,8 @@ public class GenericPersonContactTable extends Table implements
|
|||
person);
|
||||
if (canDelete) {
|
||||
ControlLink link = new ControlLink(value.toString());
|
||||
link.setConfirmation((String) ContenttypesGlobalizationUtil.
|
||||
globalize("cms.contenttypes.ui.person.confirm_delete").
|
||||
localize());
|
||||
link.setConfirmation(ContenttypesGlobalizationUtil.
|
||||
globalize("cms.contenttypes.ui.person.confirm_delete"));
|
||||
return link;
|
||||
} else {
|
||||
return new Label(value.toString());
|
||||
|
|
|
|||
|
|
@ -28,7 +28,6 @@ import com.arsdigita.bebop.table.TableColumn;
|
|||
import com.arsdigita.bebop.table.TableColumnModel;
|
||||
import com.arsdigita.bebop.table.TableModel;
|
||||
import com.arsdigita.bebop.table.TableModelBuilder;
|
||||
import com.arsdigita.cms.CMS;
|
||||
import com.arsdigita.cms.ContentSection;
|
||||
import com.arsdigita.cms.ItemSelectionModel;
|
||||
import com.arsdigita.cms.contenttypes.GenericOrganizationalUnit;
|
||||
|
|
@ -36,7 +35,6 @@ import com.arsdigita.cms.contenttypes.GenericOrganizationalUnitBundleCollection;
|
|||
import com.arsdigita.cms.contenttypes.GenericPerson;
|
||||
import com.arsdigita.cms.contenttypes.util.ContenttypesGlobalizationUtil;
|
||||
import com.arsdigita.cms.dispatcher.ItemResolver;
|
||||
import com.arsdigita.domain.DomainObjectFactory;
|
||||
import com.arsdigita.persistence.DataCollection;
|
||||
import com.arsdigita.persistence.DataObject;
|
||||
import com.arsdigita.util.LockableImpl;
|
||||
|
|
@ -59,16 +57,19 @@ public class GenericPersonOrgaUnitsTable extends Table {
|
|||
|
||||
this.itemModel = itemModel;
|
||||
|
||||
setEmptyView(new Label(ContenttypesGlobalizationUtil.globalize("person.ui.orgaunits.none")));
|
||||
setEmptyView(new Label(ContenttypesGlobalizationUtil
|
||||
.globalize("person.ui.orgaunits.none")));
|
||||
|
||||
final TableColumnModel columnModel = getColumnModel();
|
||||
columnModel.add(new TableColumn(
|
||||
0,
|
||||
ContenttypesGlobalizationUtil.globalize("person.ui.orgaunits.columns.name").localize(),
|
||||
ContenttypesGlobalizationUtil
|
||||
.globalize("person.ui.orgaunits.columns.name").localize(),
|
||||
TABLE_COL_EDIT));
|
||||
columnModel.add(new TableColumn(
|
||||
2,
|
||||
ContenttypesGlobalizationUtil.globalize("person.ui.orgaunits.columns.type").localize(),
|
||||
ContenttypesGlobalizationUtil
|
||||
.globalize("person.ui.orgaunits.columns.type").localize(),
|
||||
TABLE_COL_TYPE));
|
||||
|
||||
setModelBuilder(new ModelBuilder(itemModel));
|
||||
|
|
|
|||
|
|
@ -69,9 +69,10 @@ public class GenericPersonPropertiesStep extends SimpleEditStep {
|
|||
itemModel));
|
||||
|
||||
/* Add the SimpleEditStep to the segmented panel */
|
||||
segmentedPanel.addSegment(new Label((String) ContenttypesGlobalizationUtil.
|
||||
globalize("cms.contenttypes.ui.person.basic_properties").
|
||||
localize()), basicProperties);
|
||||
segmentedPanel.addSegment(new
|
||||
Label(ContenttypesGlobalizationUtil
|
||||
.globalize("cms.contenttypes.ui.person.basic_properties")),
|
||||
basicProperties);
|
||||
|
||||
|
||||
// GenericPersonContactPropertiesStep contactProperties = new GenericPersonContactPropertiesStep(itemModel, parent);
|
||||
|
|
@ -80,8 +81,8 @@ public class GenericPersonPropertiesStep extends SimpleEditStep {
|
|||
GenericPersonAliasPropertiesStep aliasStep =
|
||||
new GenericPersonAliasPropertiesStep(
|
||||
itemModel, parent);
|
||||
segmentedPanel.addSegment(new Label((String) ContenttypesGlobalizationUtil.
|
||||
globalize("cms.contenttypes.ui.person.alias").localize()),
|
||||
segmentedPanel.addSegment(new Label(ContenttypesGlobalizationUtil.
|
||||
globalize("cms.contenttypes.ui.person.alias")),
|
||||
aliasStep);
|
||||
|
||||
/* Sets the composed segmentedPanel as display component */
|
||||
|
|
|
|||
|
|
@ -76,14 +76,16 @@ public class GenericPersonPropertyForm extends BasicPageForm implements FormProc
|
|||
super.addWidgets();
|
||||
mandatoryFieldWidgets(this);
|
||||
|
||||
add(new Label((String) ContenttypesGlobalizationUtil.globalize("cms.contenttypes.ui.person.birthdate").localize()));
|
||||
add(new Label(ContenttypesGlobalizationUtil
|
||||
.globalize("cms.contenttypes.ui.person.birthdate")));
|
||||
ParameterModel birthdateParam = new DateParameter(BIRTHDATE);
|
||||
com.arsdigita.bebop.form.Date birthdate = new com.arsdigita.bebop.form.Date(birthdateParam);
|
||||
Calendar today = new GregorianCalendar();
|
||||
birthdate.setYearRange(1900, today.get(Calendar.YEAR));
|
||||
add(birthdate);
|
||||
|
||||
add(new Label((String) ContenttypesGlobalizationUtil.globalize("cms.contenttypes.ui.person.gender").localize()));
|
||||
add(new Label(ContenttypesGlobalizationUtil
|
||||
.globalize("cms.contenttypes.ui.person.gender")));
|
||||
ParameterModel genderParam = new StringParameter(GENDER);
|
||||
SingleSelect gender = new SingleSelect(genderParam);
|
||||
gender.addOption(new Option("", new Label((String) ContenttypesGlobalizationUtil.globalize("cms.ui.select_one").localize())));
|
||||
|
|
@ -91,7 +93,8 @@ public class GenericPersonPropertyForm extends BasicPageForm implements FormProc
|
|||
gender.addOption(new Option("m", new Label((String) ContenttypesGlobalizationUtil.globalize("cms.contenttypes.ui.person.gender.m").localize())));
|
||||
add(gender);
|
||||
|
||||
add(new Label((String) ContenttypesGlobalizationUtil.globalize("cms.contenttypes.ui.person.description").localize()));
|
||||
add(new Label(ContenttypesGlobalizationUtil
|
||||
.globalize("cms.contenttypes.ui.person.description")));
|
||||
ParameterModel descriptionParam = new StringParameter(DESCRIPTION);
|
||||
TextArea description = new TextArea(descriptionParam);
|
||||
description.setCols(50);
|
||||
|
|
@ -101,23 +104,27 @@ public class GenericPersonPropertyForm extends BasicPageForm implements FormProc
|
|||
}
|
||||
|
||||
public static void mandatoryFieldWidgets(FormSection form) {
|
||||
form.add(new Label((String) ContenttypesGlobalizationUtil.globalize("cms.contenttypes.ui.person.titlepre").localize()));
|
||||
form.add(new Label(ContenttypesGlobalizationUtil
|
||||
.globalize("cms.contenttypes.ui.person.titlepre")));
|
||||
ParameterModel titlepreParam = new StringParameter(TITLEPRE);
|
||||
TextField titlepre = new TextField(titlepreParam);
|
||||
form.add(titlepre);
|
||||
|
||||
form.add(new Label((String) ContenttypesGlobalizationUtil.globalize("cms.contenttypes.ui.person.surname").localize()));
|
||||
form.add(new Label(ContenttypesGlobalizationUtil
|
||||
.globalize("cms.contenttypes.ui.person.surname")));
|
||||
ParameterModel surnameParam = new StringParameter(SURNAME);
|
||||
surnameParam.addParameterListener(new NotNullValidationListener());
|
||||
TextField surname = new TextField(surnameParam);
|
||||
form.add(surname);
|
||||
|
||||
form.add(new Label((String) ContenttypesGlobalizationUtil.globalize("cms.contenttypes.ui.person.givenname").localize()));
|
||||
form.add(new Label(ContenttypesGlobalizationUtil
|
||||
.globalize("cms.contenttypes.ui.person.givenname")));
|
||||
ParameterModel givennameParam = new StringParameter(GIVENNAME);
|
||||
TextField givenname = new TextField(givennameParam);
|
||||
form.add(givenname);
|
||||
|
||||
form.add(new Label((String) ContenttypesGlobalizationUtil.globalize("cms.contenttypes.ui.person.titlepost").localize()));
|
||||
form.add(new Label(ContenttypesGlobalizationUtil
|
||||
.globalize("cms.contenttypes.ui.person.titlepost")));
|
||||
ParameterModel titlepostParam = new StringParameter(TITLEPOST);
|
||||
TextField titlepost = new TextField(titlepostParam);
|
||||
form.add(titlepost);
|
||||
|
|
|
|||
|
|
@ -33,19 +33,13 @@ import java.util.Iterator;
|
|||
*
|
||||
* @author <a href="mailto:phong@arsdigita.com">Phong Nguyen</a>
|
||||
* @version $Revision: #7 $
|
||||
**/
|
||||
*/
|
||||
public class ResettableContainer extends SimpleContainer implements Resettable {
|
||||
|
||||
// $Source: /cvsroot/content-types/apps/content-types/src/ui/ResettableContainer.java,v $
|
||||
// $Revision: #7 $
|
||||
// $Date: 2004/08/17 $
|
||||
// $Author: sskracic $
|
||||
|
||||
|
||||
// A list of all resettable components in this container
|
||||
/** A list of all resettable components in this container */
|
||||
private ArrayList m_resettableComponents = new ArrayList();
|
||||
|
||||
// A list of all components that are not visible by default
|
||||
/** A list of all components that are not visible by default */
|
||||
private ArrayList m_componentsNotVisibleByDefault = new ArrayList();
|
||||
|
||||
|
||||
|
|
|
|||
Loading…
Reference in New Issue