Verbesserung der Lokalisierung LDN Contact. Noch nicht fehlerfrei!.
git-svn-id: https://svn.libreccm.org/ccm/trunk@2224 8810af33-2d31-482b-a856-94f89814c4dfmaster
parent
9c7a80b93d
commit
c58251ff82
|
|
@ -38,7 +38,6 @@ import com.arsdigita.cms.SecurityManager;
|
|||
import com.arsdigita.cms.contenttypes.ArticleSection;
|
||||
import com.arsdigita.cms.contenttypes.ArticleSectionCollection;
|
||||
import com.arsdigita.cms.contenttypes.MultiPartArticle;
|
||||
import com.arsdigita.cms.dispatcher.Utilities;
|
||||
import com.arsdigita.cms.contenttypes.util.MPArticleGlobalizationUtil;
|
||||
import com.arsdigita.domain.DomainObjectFactory;
|
||||
import com.arsdigita.persistence.OID;
|
||||
|
|
@ -58,8 +57,7 @@ import java.math.BigDecimal;
|
|||
*/
|
||||
public class SectionTable extends Table
|
||||
{
|
||||
private static final Logger log =
|
||||
Logger.getLogger(SectionTable.class.getName());
|
||||
private static final Logger s_log = Logger.getLogger(SectionTable.class);
|
||||
|
||||
// match columns by (symbolic) index, makes for easier reordering
|
||||
public static final int COL_INDEX_TITLE = 0; // "Section";
|
||||
|
|
@ -69,18 +67,18 @@ public class SectionTable extends Table
|
|||
|
||||
private ItemSelectionModel m_selArticle;
|
||||
private ItemSelectionModel m_selSection;
|
||||
|
||||
private ItemSelectionModel m_moveSection;
|
||||
private static final Logger s_log = Logger.getLogger(SectionTable.class);
|
||||
|
||||
/**
|
||||
* Constructor.
|
||||
* Constructor. Create an instance of this class.
|
||||
*
|
||||
* @param selArticle a selection model that returns the MultiPartArticle
|
||||
* which holds the sections to display.
|
||||
* @param moveSection
|
||||
*/
|
||||
public SectionTable ( ItemSelectionModel selArticle, ItemSelectionModel moveSection ) {
|
||||
public SectionTable ( ItemSelectionModel selArticle,
|
||||
ItemSelectionModel moveSection ) {
|
||||
|
||||
super();
|
||||
m_selArticle = selArticle;
|
||||
m_moveSection = moveSection;
|
||||
|
|
@ -177,12 +175,17 @@ public class SectionTable extends Table
|
|||
* The model builder to generate a suitable model for the SectionTable
|
||||
*/
|
||||
protected class SectionTableModelBuilder extends LockableImpl
|
||||
implements TableModelBuilder
|
||||
{
|
||||
implements TableModelBuilder {
|
||||
|
||||
protected ItemSelectionModel m_selArticle;
|
||||
protected ItemSelectionModel m_moveSection;
|
||||
|
||||
|
||||
/**
|
||||
* Private class constructor.
|
||||
* @param selArticle
|
||||
* @param moveSection
|
||||
*/
|
||||
public SectionTableModelBuilder ( ItemSelectionModel selArticle,
|
||||
ItemSelectionModel moveSection ) {
|
||||
m_selArticle = selArticle;
|
||||
|
|
@ -190,6 +193,12 @@ public class SectionTable extends Table
|
|||
}
|
||||
|
||||
|
||||
/**
|
||||
*
|
||||
* @param table
|
||||
* @param state
|
||||
* @return
|
||||
*/
|
||||
public TableModel makeModel ( Table table, PageState state ) {
|
||||
table.getRowSelectionModel().clearSelection(state);
|
||||
|
||||
|
|
@ -202,9 +211,10 @@ public class SectionTable extends Table
|
|||
}
|
||||
|
||||
|
||||
protected class SectionTableModel
|
||||
implements TableModel
|
||||
{
|
||||
/**
|
||||
* Internal class
|
||||
*/
|
||||
protected class SectionTableModel implements TableModel {
|
||||
|
||||
private TableColumnModel m_colModel;
|
||||
private SectionTable m_table;
|
||||
|
|
@ -318,7 +328,6 @@ public class SectionTable extends Table
|
|||
Object key, int row, int column ) {
|
||||
|
||||
Component ret = null;
|
||||
// SecurityManager sm = Utilities.getSecurityManager(state);
|
||||
SecurityManager sm = CMS.getSecurityManager(state);
|
||||
ContentItem item = (ContentItem)m_selArticle.getSelectedObject(state);
|
||||
|
||||
|
|
|
|||
|
|
@ -981,7 +981,6 @@ cms.contenttypes.ui.person.delete_alias=Remove former name
|
|||
cms.contenttypes.ui.person.alias.none=No former name
|
||||
cms.contenttypes.ui.person.alias=Former name
|
||||
cms.contenttypes.ui.person.alias.select=Select former name
|
||||
cms.contenttypes.ui.contact.alias.select.add=Select former name
|
||||
cms.contenttypes.person.alias.select.wrong_type=No person selected
|
||||
cms.contenttypes.person.alias.select.same_as_person=Selected person is the same as the current person. Alias and person can't be identical.
|
||||
cms.contenttypes.person.alias.select.no_suitable_language_variant=The selected item has no suitable language variant.
|
||||
|
|
|
|||
|
|
@ -972,7 +972,6 @@ cms.contenttypes.ui.person.delete_alias=Fr\u00fcheren Namen entfernen
|
|||
cms.contenttypes.ui.person.alias.none=Kein fr\u00fcherer Name
|
||||
cms.contenttypes.ui.person.alias=Fr\u00fcherer Name
|
||||
cms.contenttypes.ui.person.alias.select=Fr\u00fcheren Namen ausw\u00e4hlen
|
||||
cms.contenttypes.ui.contact.alias.select.add=Fr\u00fcheren Namen ausw\u00e4hlen
|
||||
cms.contenttypes.person.alias.select.wrong_type=Kein Personendatensatz ausgew\u00e4hlt
|
||||
cms.contenttypes.person.alias.select.same_as_person=Der ausgew\u00e4hlte Datensatz ist der gleiche Datensatz wie der aktuelle Datensatz. Alias und Person k\u00f6nnen nicht identisch sein.
|
||||
cms.contenttypes.person.alias.select.no_suitable_language_variant=Das ausgew\u00e4hlte Item hat keine passende Sprachvariante.
|
||||
|
|
|
|||
|
|
@ -20,7 +20,6 @@ cms.contenttypes.ui.person.delete_alias=Remove former name
|
|||
cms.contenttypes.ui.person.alias.none=No former name
|
||||
cms.contenttypes.ui.person.alias=Former name
|
||||
cms.contenttypes.ui.person.alias.select=Select former name
|
||||
cms.contenttypes.ui.contact.alias.select.add=Select former name
|
||||
cms.contenttypes.person.alias.select.wrong_type=No person selected
|
||||
cms.contenttypes.person.alias.select.same_as_person=Selected person is the same as the current person. Alias and person can't be identical.
|
||||
cms.contenttypes.person.alias.select.no_suitable_language_variant=The selected item has no suitable language variant.
|
||||
|
|
|
|||
|
|
@ -501,7 +501,6 @@ cms.contenttypes.ui.person.delete_alias=Remove former name
|
|||
cms.contenttypes.ui.person.alias.none=No former name
|
||||
cms.contenttypes.ui.person.alias=Former name
|
||||
cms.contenttypes.ui.person.alias.select=Select former name
|
||||
cms.contenttypes.ui.contact.alias.select.add=Select former name
|
||||
cms.contenttypes.person.alias.select.wrong_type=No person selected
|
||||
cms.contenttypes.person.alias.select.same_as_person=Selected person is the same as the current person. Alias and person can't be identical.
|
||||
cms.contenttypes.person.alias.select.no_suitable_language_variant=The selected item has no suitable language variant.
|
||||
|
|
|
|||
|
|
@ -1,26 +1,31 @@
|
|||
com.arsdigita.london.contenttypes.ui.contact.address_saon=SAON
|
||||
com.arsdigita.london.contenttypes.ui.contact.address_paon=PAON
|
||||
com.arsdigita.london.contenttypes.ui.contact.address_streetdesc=Street Description
|
||||
com.arsdigita.london.contenttypes.ui.contact.address_streetrefno=Street Reference No
|
||||
com.arsdigita.london.contenttypes.ui.contact.address_locality=Locality
|
||||
com.arsdigita.london.contenttypes.ui.contact.address_town=Town
|
||||
com.arsdigita.london.contenttypes.ui.contact.address_administrative_area=Administrative Area
|
||||
com.arsdigita.london.contenttypes.ui.contact.address_posttown=Postal Town
|
||||
com.arsdigita.london.contenttypes.ui.contact.address_postcode=Postal Code
|
||||
com.arsdigita.london.contenttypes.ui.contact.address_proprefno=Property Reference No
|
||||
com.arsdigita.london.contenttypes.ui.contact_type=Contact Type
|
||||
com.arsdigita.london.contenttypes.ui.contact_orgname=Organization Name
|
||||
com.arsdigita.london.contenttypes.ui.contact_deptname=Department Name
|
||||
com.arsdigita.london.contenttypes.ui.contact_role=Role of Contact
|
||||
com.arsdigita.london.contenttypes.ui.contact_givenname=Given Name
|
||||
com.arsdigita.london.contenttypes.ui.contact_familyname=Family Name
|
||||
com.arsdigita.london.contenttypes.ui.contact_suffix=Suffix
|
||||
com.arsdigita.london.contenttypes.ui.contact_description=Contact Description
|
||||
com.arsdigita.london.contenttypes.ui.contact.phone_number=Number
|
||||
com.arsdigita.london.contenttypes.ui.phone_type=Types
|
||||
com.arsdigita.london.contenttypes.ui.contact_emails=Emails
|
||||
london.contenttypes.ui.contact.address.saon=SAON
|
||||
london.contenttypes.ui.contact.address.paon=PAON
|
||||
london.contenttypes.ui.contact.address.streetdesc=Street Description
|
||||
london.contenttypes.ui.contact.address.streetrefno=Street Reference No
|
||||
london.contenttypes.ui.contact.address.locality=Locality
|
||||
london.contenttypes.ui.contact.address.town=Town
|
||||
london.contenttypes.ui.contact.address.administrative_area=Administrative Area
|
||||
london.contenttypes.ui.contact.address.posttown=Postal Town
|
||||
london.contenttypes.ui.contact.address.postcode=Postal Code
|
||||
london.contenttypes.ui.contact.address.proprefno=Property Reference No
|
||||
london.contenttypes.ui.contact.type=Contact Type
|
||||
london.contenttypes.ui.contact.orgname=Organization Name
|
||||
london.contenttypes.ui.contact.deptname=Department Name
|
||||
london.contenttypes.ui.contact.role=Role of Contact
|
||||
london.contenttypes.ui.contact.givenname=Given Name
|
||||
london.contenttypes.ui.contact.familyname=Family Name
|
||||
london.contenttypes.ui.contact.suffix=Suffix
|
||||
london.contenttypes.ui.contact.phone_number=Number
|
||||
london.contenttypes.ui.contact.phone_type=Types
|
||||
london.contenttypes.ui.contact.emails=Emails
|
||||
com.arsdigita.london.contenttypes.contact_authoring_step_description=Contact
|
||||
com.arsdigita.london.contenttypes.contact_authoring_step_label=Contact
|
||||
com.arsdigita.london.contenttypes.ui.name=Name
|
||||
com.arsdigita.london.contenttypes.ui.title=Title
|
||||
com.arsdigita.london.contenttypes.ui.description=Description
|
||||
com.arsdigita.london.contenttypes.ui.contact.select_contact=Select Contact
|
||||
london.contenttypes.ui.contact.add_phone_button=Add Phone
|
||||
london.contenttypes.ui.contact.phonetable.no_entries_msg=No Phones associated with this Contact
|
||||
london.contenttypes.ui.contact.phonetable.header_type=Phone Type
|
||||
london.contenttypes.ui.contact.phonetable.header_num=Phone Number
|
||||
london.contenttypes.ui.contact.phonetable.header_delete=Delete
|
||||
london.contenttypes.ui.contact.phonetable.confirm_delete=Delete this Phone?
|
||||
london.contenttypes.ui.contact.phonetable.link_delete=delete
|
||||
london.contenttypes.ui.contact.phonetable.delete_confirmation=Delete this Phone?
|
||||
|
|
|
|||
|
|
@ -0,0 +1,31 @@
|
|||
london.contenttypes.ui.contact.address.saon=SAON
|
||||
london.contenttypes.ui.contact.address.paon=PAON
|
||||
london.contenttypes.ui.contact.address.streetdesc=Stra\u00dfenname
|
||||
london.contenttypes.ui.contact.address.streetrefno=Stra\u00dfennummer
|
||||
london.contenttypes.ui.contact.address.locality=Region
|
||||
london.contenttypes.ui.contact.address.town=Ort
|
||||
london.contenttypes.ui.contact.address.administrative_area=Administrative Area
|
||||
london.contenttypes.ui.contact.address.posttown=Postalischer Ort
|
||||
london.contenttypes.ui.contact.address.postcode=Postalischer Code
|
||||
london.contenttypes.ui.contact.address.proprefno=Gebietsreferenz
|
||||
london.contenttypes.ui.contact.type=Kontakt Typ
|
||||
london.contenttypes.ui.contact.orgname=Organisation (Name)
|
||||
london.contenttypes.ui.contact.deptname=Kreis
|
||||
london.contenttypes.ui.contact.role=Rolle des Kontakts
|
||||
london.contenttypes.ui.contact.givenname=Vorname
|
||||
london.contenttypes.ui.contact.familyname=Familienname
|
||||
london.contenttypes.ui.contact.suffix=Erg\u00e4nzung
|
||||
london.contenttypes.ui.contact.phone_number=Telefonnummer
|
||||
london.contenttypes.ui.contact.phone_type=Telefon Typ
|
||||
london.contenttypes.ui.contact.emails=E-Mail
|
||||
com.arsdigita.london.contenttypes.contact_authoring_step_description=Kontakteintrag
|
||||
com.arsdigita.london.contenttypes.contact_authoring_step_label=Kontakt
|
||||
com.arsdigita.london.contenttypes.ui.contact.select_contact=Einen Kontakt ausw\u00e4hlen
|
||||
london.contenttypes.ui.contact.add_phone_button=Telefonnummer hinzuf\u00fchren
|
||||
london.contenttypes.ui.contact.phonetable.no_entries_msg=Es sind keine Telefonnummer mit diesem Kontakt verkn\u00fcpft.
|
||||
london.contenttypes.ui.contact.phonetable.header_type=Telefon Typ
|
||||
london.contenttypes.ui.contact.phonetable.header_num=Telefonnummer
|
||||
london.contenttypes.ui.contact.phonetable.header_delete=L\u00f6schen
|
||||
london.contenttypes.ui.contact.phonetable.confirm_delete=Delete this Phone?
|
||||
london.contenttypes.ui.contact.phonetable.link_delete=l\u00f6schen
|
||||
london.contenttypes.ui.contact.phonetable.delete_confirmation=Diesen Eintrag l\u00f6schen?
|
||||
|
|
@ -0,0 +1,31 @@
|
|||
london.contenttypes.ui.contact.address.saon=SAON
|
||||
london.contenttypes.ui.contact.address.paon=PAON
|
||||
london.contenttypes.ui.contact.address.streetdesc=Street Description
|
||||
london.contenttypes.ui.contact.address.streetrefno=Street Reference No
|
||||
london.contenttypes.ui.contact.address.locality=Locality
|
||||
london.contenttypes.ui.contact.address.town=Town
|
||||
london.contenttypes.ui.contact.address.administrative_area=Administrative Area
|
||||
london.contenttypes.ui.contact.address.posttown=Postal Town
|
||||
london.contenttypes.ui.contact.address.postcode=Postal Code
|
||||
london.contenttypes.ui.contact.address.proprefno=Property Reference No
|
||||
london.contenttypes.ui.contact.type=Contact Type
|
||||
london.contenttypes.ui.contact.orgname=Organization Name
|
||||
london.contenttypes.ui.contact.deptname=Department Name
|
||||
london.contenttypes.ui.contact.role=Role of Contact
|
||||
london.contenttypes.ui.contact.givenname=Given Name
|
||||
london.contenttypes.ui.contact.familyname=Family Name
|
||||
london.contenttypes.ui.contact.suffix=Suffix
|
||||
london.contenttypes.ui.contact.phone_number=Number
|
||||
london.contenttypes.ui.contact.phone_type=Types
|
||||
london.contenttypes.ui.contact.emails=Emails
|
||||
com.arsdigita.london.contenttypes.contact_authoring_step_description=Contact
|
||||
com.arsdigita.london.contenttypes.contact_authoring_step_label=Contact
|
||||
com.arsdigita.london.contenttypes.ui.contact.select_contact=Select Contact
|
||||
london.contenttypes.ui.contact.add_phone_button=Add Phone
|
||||
london.contenttypes.ui.contact.phonetable.no_entries_msg=No Phones associated with this Contact
|
||||
london.contenttypes.ui.contact.phonetable.header_type=Phone Type
|
||||
london.contenttypes.ui.contact.phonetable.header_num=Phone Number
|
||||
london.contenttypes.ui.contact.phonetable.header_delete=Delete
|
||||
london.contenttypes.ui.contact.phonetable.confirm_delete=Delete this Phone?
|
||||
london.contenttypes.ui.contact.phonetable.link_delete=delete
|
||||
london.contenttypes.ui.contact.phonetable.delete_confirmation=Delete this Phone?
|
||||
|
|
@ -25,6 +25,7 @@ import com.arsdigita.cms.ui.authoring.AuthoringKitWizard;
|
|||
import com.arsdigita.cms.ui.authoring.BasicItemForm;
|
||||
import com.arsdigita.cms.ui.authoring.SimpleEditStep;
|
||||
import com.arsdigita.cms.ui.workflow.WorkflowLockedComponentAccess;
|
||||
import com.arsdigita.cms.util.GlobalizationUtil;
|
||||
import com.arsdigita.toolbox.ui.DomainObjectPropertySheet;
|
||||
|
||||
/**
|
||||
|
|
@ -50,7 +51,7 @@ public class ContactAddressProperties extends SimpleEditStep {
|
|||
form = new ContactAddressPropertyForm(itemModel);
|
||||
|
||||
add(EDIT_SHEET_NAME,
|
||||
"Edit",
|
||||
GlobalizationUtil.globalize("cms.ui.edit"),
|
||||
new WorkflowLockedComponentAccess(form, itemModel),
|
||||
form.getSaveCancelSection().getCancelButton());
|
||||
|
||||
|
|
@ -69,44 +70,44 @@ public class ContactAddressProperties extends SimpleEditStep {
|
|||
public static Component getAddressPropertySheet(ItemSelectionModel itemModel) {
|
||||
DomainObjectPropertySheet sheet = new DomainObjectPropertySheet(itemModel);
|
||||
|
||||
sheet.add(
|
||||
ContactGlobalizationUtil.globalize("com.arsdigita.london.contenttypes.ui.contact.address_saon"),
|
||||
sheet.add(ContactGlobalizationUtil.globalize(
|
||||
"london.contenttypes.ui.contact.address.saon"),
|
||||
"contactAddress.saon");
|
||||
|
||||
sheet.add(
|
||||
ContactGlobalizationUtil.globalize("com.arsdigita.london.contenttypes.ui.contact.address_paon"),
|
||||
sheet.add(ContactGlobalizationUtil.globalize(
|
||||
"london.contenttypes.ui.contact.address.paon"),
|
||||
"contactAddress.paon");
|
||||
|
||||
sheet.add(
|
||||
ContactGlobalizationUtil.globalize("com.arsdigita.london.contenttypes.ui.contact.address_streetdesc"),
|
||||
sheet.add(ContactGlobalizationUtil.globalize(
|
||||
"london.contenttypes.ui.contact.address.streetdesc"),
|
||||
"contactAddress.streetDesc");
|
||||
|
||||
sheet.add(
|
||||
ContactGlobalizationUtil.globalize("com.arsdigita.london.contenttypes.ui.contact.address_streetrefno"),
|
||||
sheet.add(ContactGlobalizationUtil.globalize(
|
||||
"london.contenttypes.ui.contact.address.streetrefno"),
|
||||
"contactAddress.streetRefNo");
|
||||
|
||||
sheet.add(
|
||||
ContactGlobalizationUtil.globalize("com.arsdigita.london.contenttypes.ui.contact.address_locality"),
|
||||
sheet.add(ContactGlobalizationUtil.globalize(
|
||||
"london.contenttypes.ui.contact.address.locality"),
|
||||
"contactAddress.locality");
|
||||
|
||||
sheet.add(
|
||||
ContactGlobalizationUtil.globalize("com.arsdigita.london.contenttypes.ui.contact.address_town"),
|
||||
sheet.add(ContactGlobalizationUtil.globalize(
|
||||
"london.contenttypes.ui.contact.address.town"),
|
||||
"contactAddress.town");
|
||||
|
||||
sheet.add(
|
||||
ContactGlobalizationUtil.globalize("com.arsdigita.london.contenttypes.ui.contact.address_administrative_area"),
|
||||
sheet.add(ContactGlobalizationUtil.globalize(
|
||||
"london.contenttypes.ui.contact.address.administrative_area"),
|
||||
"contactAddress.administrativeArea");
|
||||
|
||||
sheet.add(
|
||||
ContactGlobalizationUtil.globalize("com.arsdigita.london.contenttypes.ui.contact.address_posttown"),
|
||||
sheet.add(ContactGlobalizationUtil.globalize(
|
||||
"london.contenttypes.ui.contact.address.posttown"),
|
||||
"contactAddress.postTown");
|
||||
|
||||
sheet.add(
|
||||
ContactGlobalizationUtil.globalize("com.arsdigita.london.contenttypes.ui.contact.address_postcode"),
|
||||
sheet.add(ContactGlobalizationUtil.globalize(
|
||||
"london.contenttypes.ui.contact.address.postcode"),
|
||||
"contactAddress.postCode");
|
||||
|
||||
sheet.add(
|
||||
ContactGlobalizationUtil.globalize("com.arsdigita.london.contenttypes.ui.contact.address_proprefno"),
|
||||
sheet.add(ContactGlobalizationUtil.globalize(
|
||||
"london.contenttypes.ui.contact.address.proprefno"),
|
||||
"contactAddress.referenceNo");
|
||||
|
||||
return sheet;
|
||||
|
|
|
|||
|
|
@ -43,19 +43,20 @@ import com.arsdigita.cms.ui.authoring.BasicItemForm;
|
|||
*/
|
||||
public class ContactAddressPropertyForm extends BasicItemForm {
|
||||
|
||||
private static final Logger s_log = Logger.getLogger(
|
||||
ContactAddressPropertyForm.class);
|
||||
|
||||
/** Name of this form */
|
||||
private static final String ID = "Contact_address_edit";
|
||||
|
||||
private static final Logger s_log = Logger.getLogger(ContactAddressPropertyForm.class);
|
||||
|
||||
/**
|
||||
* Creates a new form to edit the <code>ContactAddress</code> object
|
||||
* properties associated with the <code>Contact</code> object specified by
|
||||
* the item selection model passed in.
|
||||
* Creates a new form to edit the <code>ContactAddress</code> object properties
|
||||
* associated with the <code>Contact</code> object specified by the
|
||||
* item selection model passed in.
|
||||
*
|
||||
* @param itemModel The ItemSelectionModel to use to obtain the Contact
|
||||
* object to work on
|
||||
**/
|
||||
*/
|
||||
public ContactAddressPropertyForm(ItemSelectionModel itemModel) {
|
||||
super(ID, itemModel);
|
||||
}
|
||||
|
|
@ -81,7 +82,7 @@ public class ContactAddressPropertyForm extends BasicItemForm {
|
|||
|
||||
protected void addSAON() {
|
||||
add(new Label(ContactGlobalizationUtil
|
||||
.globalize("com.arsdigita.london.contenttypes.ui.contact.address_saon")));
|
||||
.globalize("london.contenttypes.ui.contact.address.saon")));
|
||||
ParameterModel saonParam = new StringParameter(ContactAddress.SAON);
|
||||
TextField saon = new TextField(saonParam);
|
||||
add(saon);
|
||||
|
|
@ -89,7 +90,7 @@ public class ContactAddressPropertyForm extends BasicItemForm {
|
|||
|
||||
protected void addPAON() {
|
||||
add(new Label(ContactGlobalizationUtil
|
||||
.globalize("com.arsdigita.london.contenttypes.ui.contact.address_paon")));
|
||||
.globalize("london.contenttypes.ui.contact.address.paon")));
|
||||
ParameterModel paonParam = new StringParameter(ContactAddress.PAON);
|
||||
TextField paon = new TextField(paonParam);
|
||||
paon.addValidationListener(new NotNullValidationListener());
|
||||
|
|
@ -98,7 +99,7 @@ public class ContactAddressPropertyForm extends BasicItemForm {
|
|||
|
||||
protected void addStreetDesc() {
|
||||
add(new Label(ContactGlobalizationUtil
|
||||
.globalize("com.arsdigita.london.contenttypes.ui.contact.address_streetdesc")));
|
||||
.globalize("london.contenttypes.ui.contact.address.streetdesc")));
|
||||
ParameterModel streetDescParam = new StringParameter(ContactAddress.STREET_DESC);
|
||||
TextField streetDesc = new TextField(streetDescParam);
|
||||
streetDesc.addValidationListener(new NotNullValidationListener());
|
||||
|
|
@ -107,7 +108,7 @@ public class ContactAddressPropertyForm extends BasicItemForm {
|
|||
|
||||
protected void addStreetRefNo() {
|
||||
add(new Label(ContactGlobalizationUtil
|
||||
.globalize("com.arsdigita.london.contenttypes.ui.contact.address_streetrefno")));
|
||||
.globalize("london.contenttypes.ui.contact.address.streetrefno")));
|
||||
ParameterModel streetRefNoParam = new StringParameter(ContactAddress.STREET_REF_NO);
|
||||
TextField streetRefNo = new TextField(streetRefNoParam);
|
||||
add(streetRefNo);
|
||||
|
|
@ -115,7 +116,7 @@ public class ContactAddressPropertyForm extends BasicItemForm {
|
|||
|
||||
protected void addLocality() {
|
||||
add(new Label(ContactGlobalizationUtil
|
||||
.globalize("com.arsdigita.london.contenttypes.ui.contact.address_locality")));
|
||||
.globalize("london.contenttypes.ui.contact.address.locality")));
|
||||
ParameterModel localityParam = new StringParameter(ContactAddress.LOCALITY);
|
||||
TextField locality = new TextField(localityParam);
|
||||
add(locality);
|
||||
|
|
@ -123,7 +124,7 @@ public class ContactAddressPropertyForm extends BasicItemForm {
|
|||
|
||||
protected void addTown() {
|
||||
add(new Label(ContactGlobalizationUtil
|
||||
.globalize("com.arsdigita.london.contenttypes.ui.contact.address_town")));
|
||||
.globalize("london.contenttypes.ui.contact.address.town")));
|
||||
ParameterModel townParam = new StringParameter(ContactAddress.TOWN);
|
||||
TextField town = new TextField(townParam);
|
||||
add(town);
|
||||
|
|
@ -131,7 +132,7 @@ public class ContactAddressPropertyForm extends BasicItemForm {
|
|||
|
||||
protected void addArea() {
|
||||
add(new Label(ContactGlobalizationUtil
|
||||
.globalize("com.arsdigita.london.contenttypes.ui.contact.address_administrative_area")));
|
||||
.globalize("london.contenttypes.ui.contact.address.administrative_area")));
|
||||
ParameterModel adAreaParam = new StringParameter(ContactAddress.ADMINISTRATIVE_AREA);
|
||||
TextField adArea = new TextField(adAreaParam);
|
||||
add(adArea);
|
||||
|
|
@ -139,7 +140,7 @@ public class ContactAddressPropertyForm extends BasicItemForm {
|
|||
|
||||
protected void addPostTown() {
|
||||
add(new Label(ContactGlobalizationUtil
|
||||
.globalize("com.arsdigita.london.contenttypes.ui.contact.address_posttown")));
|
||||
.globalize("london.contenttypes.ui.contact.address.posttown")));
|
||||
ParameterModel postTownParam = new StringParameter(ContactAddress.POST_TOWN);
|
||||
TextField postTown = new TextField(postTownParam);
|
||||
add(postTown);
|
||||
|
|
@ -147,7 +148,7 @@ public class ContactAddressPropertyForm extends BasicItemForm {
|
|||
|
||||
protected void addPostCode() {
|
||||
add(new Label(ContactGlobalizationUtil
|
||||
.globalize("com.arsdigita.london.contenttypes.ui.contact.address_postcode")));
|
||||
.globalize("london.contenttypes.ui.contact.address.postcode")));
|
||||
ParameterModel postCodeParam = new StringParameter(ContactAddress.POST_CODE);
|
||||
TextField postCode = new TextField(postCodeParam);
|
||||
add(postCode);
|
||||
|
|
@ -155,7 +156,7 @@ public class ContactAddressPropertyForm extends BasicItemForm {
|
|||
|
||||
protected void addPropRefNo() {
|
||||
add(new Label(ContactGlobalizationUtil
|
||||
.globalize("com.arsdigita.london.contenttypes.ui.contact.address_proprefno")));
|
||||
.globalize("london.contenttypes.ui.contact.address.proprefno")));
|
||||
ParameterModel propRefNoParam = new StringParameter(ContactAddress.PROP_REF_NO);
|
||||
TextField propRefNo = new TextField(propRefNoParam);
|
||||
add(propRefNo);
|
||||
|
|
|
|||
|
|
@ -36,12 +36,11 @@ import com.arsdigita.cms.ui.authoring.PageCreate;
|
|||
|
||||
/**
|
||||
* Authoring kit create component to create objects of <code>Contact</code>
|
||||
* ContentType objects.
|
||||
* ContentType objects. Replaces the default PageCreate class usually used
|
||||
* for most content items.
|
||||
*
|
||||
* @author Shashin Shinde <a href="mailto:sshinde@redhat.com">sshinde@redhat.com</a>
|
||||
*
|
||||
* @version $Id: ContactCreate.java 287 2005-02-22 00:29:02Z sskracic $
|
||||
*
|
||||
*/
|
||||
public class ContactCreate extends PageCreate {
|
||||
|
||||
|
|
@ -56,21 +55,28 @@ public class ContactCreate extends PageCreate {
|
|||
|
||||
protected void addWidgets() {
|
||||
|
||||
/* Add the standard widgets title, name, and optional launchdate */
|
||||
super.addWidgets();
|
||||
|
||||
TextField givenName = new TextField(Contact.GIVEN_NAME);
|
||||
add(new Label(ContactGlobalizationUtil
|
||||
.globalize("com.arsdigita.london.contenttypes.ui.contact_givenname")));
|
||||
.globalize("london.contenttypes.ui.contact.givenname")));
|
||||
givenName.addValidationListener(new NotNullValidationListener());
|
||||
add(givenName);
|
||||
|
||||
TextField familyName = new TextField(Contact.FAMILY_NAME);
|
||||
add(new Label(ContactGlobalizationUtil
|
||||
.globalize("com.arsdigita.london.contenttypes.ui.contact_familyname")));
|
||||
.globalize("london.contenttypes.ui.contact.familyname")));
|
||||
familyName.addValidationListener(new NotNullValidationListener());
|
||||
add(familyName);
|
||||
}
|
||||
|
||||
/**
|
||||
*
|
||||
* @param e
|
||||
* @throws FormProcessException
|
||||
*/
|
||||
@Override
|
||||
public void process(FormSectionEvent e) throws FormProcessException {
|
||||
|
||||
FormData data = e.getFormData();
|
||||
|
|
@ -97,5 +103,4 @@ public class ContactCreate extends PageCreate {
|
|||
|
||||
m_parent.editItem(state, contact);
|
||||
}
|
||||
|
||||
}
|
||||
|
|
|
|||
|
|
@ -40,22 +40,20 @@ import java.util.ArrayList;
|
|||
* Form to Create objects of type <code>ContactPhone</code>.
|
||||
*
|
||||
* @author Shashin Shinde <sshinde@redhat.com>
|
||||
*
|
||||
* @version $Id: ContactCreatePhone.java 287 2005-02-22 00:29:02Z sskracic $
|
||||
*
|
||||
*/
|
||||
class ContactCreatePhone extends BasicItemForm {
|
||||
|
||||
private ItemSelectionModel m_model;
|
||||
|
||||
/**
|
||||
* Creates a new form to create the <code>ContactPhone</code> object
|
||||
* type associated with the <code>Contact</code> object specified
|
||||
* by the item selection model passed in.
|
||||
* Creates a new form to create the
|
||||
* <code>ContactPhone</code> object type associated with the
|
||||
* <code>Contact</code> object specified by the item selection model passed
|
||||
* in.
|
||||
*
|
||||
* @param itemModel
|
||||
* The ItemSelectionModel to use to obtain the Contact object to
|
||||
* work on
|
||||
* @param itemModel The ItemSelectionModel to use to obtain the Contact
|
||||
* object to work on
|
||||
*/
|
||||
public ContactCreatePhone(ItemSelectionModel itemModel) {
|
||||
super("Contact_phone_create", itemModel);
|
||||
|
|
@ -70,14 +68,14 @@ class ContactCreatePhone extends BasicItemForm {
|
|||
protected void addWidgets() {
|
||||
|
||||
add(new Label(ContactGlobalizationUtil.globalize(
|
||||
"com.arsdigita.london.contenttypes.ui.contact.phone_number")));
|
||||
"london.contenttypes.ui.contact.phone_number")));
|
||||
ParameterModel phoneNoParam = new StringParameter(ContactPhone.PHONE_NUMBER);
|
||||
TextField phoneNo = new TextField(phoneNoParam);
|
||||
phoneNo.addValidationListener(new NotNullValidationListener());
|
||||
add(phoneNo);
|
||||
|
||||
add(new Label(ContactGlobalizationUtil.globalize(
|
||||
"com.arsdigita.london.contenttypes.ui.phone_type")));
|
||||
"london.contenttypes.ui.contact.phone_type")));
|
||||
ParameterModel phoneTypeParam = new StringParameter(ContactPhone.PHONE_TYPE);
|
||||
SingleSelect phoneType = new SingleSelect(phoneTypeParam);
|
||||
add(phoneType);
|
||||
|
|
@ -96,8 +94,8 @@ class ContactCreatePhone extends BasicItemForm {
|
|||
}
|
||||
|
||||
/**
|
||||
* Create an object of type <code>ContactPhone</code> and add it to Contact
|
||||
* object retrieved from passed in ItemSelectionModel.
|
||||
* Create an object of type <code>ContactPhone</code> and add it
|
||||
* to Contact object retrieved from passed in ItemSelectionModel.
|
||||
*/
|
||||
public void process(FormSectionEvent fse) {
|
||||
FormData data = fse.getFormData();
|
||||
|
|
|
|||
|
|
@ -23,29 +23,31 @@ import com.arsdigita.cms.ui.authoring.AuthoringKitWizard;
|
|||
import com.arsdigita.cms.ui.authoring.BasicItemForm;
|
||||
import com.arsdigita.cms.ui.authoring.SimpleEditStep;
|
||||
import com.arsdigita.cms.ui.workflow.WorkflowLockedComponentAccess;
|
||||
import com.arsdigita.london.contenttypes.util.ContactGlobalizationUtil;
|
||||
|
||||
/**
|
||||
* A UI step to manipulate <code>Phones </code> for the Contact object
|
||||
* which is retrieved from the ItemSelectionModel.
|
||||
*
|
||||
* @author Shashin Shinde <a href="mailto:sshinde@redhat.com">sshinde@redhat.com</a>
|
||||
* A UI step to manipulate <code>Phones </code> for the Contact object which is
|
||||
* retrieved from the ItemSelectionModel.
|
||||
*
|
||||
* @author Shashin Shinde <a
|
||||
* href="mailto:sshinde@redhat.com">sshinde@redhat.com</a>
|
||||
* @version $Id: ContactPhonesPanel.java 287 2005-02-22 00:29:02Z sskracic $
|
||||
*
|
||||
*/
|
||||
public class ContactPhonesPanel extends SimpleEditStep {
|
||||
|
||||
/** The name of the editing sheet added to this step */
|
||||
/**
|
||||
* The name of the editing sheet added to this step
|
||||
*/
|
||||
private static String EDIT_SHEET_NAME = "manage-phones";
|
||||
|
||||
public ContactPhonesPanel(ItemSelectionModel itemModel, AuthoringKitWizard parent) {
|
||||
public ContactPhonesPanel(ItemSelectionModel itemModel,
|
||||
AuthoringKitWizard parent) {
|
||||
super(itemModel, parent);
|
||||
|
||||
BasicItemForm form = new ContactCreatePhone(itemModel);
|
||||
|
||||
add(
|
||||
EDIT_SHEET_NAME,
|
||||
"Add Phone",
|
||||
add(EDIT_SHEET_NAME,
|
||||
ContactGlobalizationUtil.globalize(
|
||||
"london.contenttypes.ui.contact.add_phone_button"),
|
||||
new WorkflowLockedComponentAccess(form, itemModel),
|
||||
form.getSaveCancelSection().getCancelButton());
|
||||
|
||||
|
|
@ -53,5 +55,4 @@ public class ContactPhonesPanel extends SimpleEditStep {
|
|||
setDisplayComponent(phTable);
|
||||
|
||||
}
|
||||
|
||||
}
|
||||
|
|
@ -30,66 +30,100 @@ 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.ItemSelectionModel;
|
||||
import com.arsdigita.cms.SecurityManager;
|
||||
import com.arsdigita.london.contenttypes.Contact;
|
||||
import com.arsdigita.london.contenttypes.ContactPhone;
|
||||
import com.arsdigita.london.contenttypes.ContactPhonesCollection;
|
||||
import com.arsdigita.cms.dispatcher.Utilities;
|
||||
import com.arsdigita.london.contenttypes.util.ContactGlobalizationUtil;
|
||||
import com.arsdigita.util.LockableImpl;
|
||||
|
||||
import org.apache.log4j.Logger;
|
||||
|
||||
import java.math.BigDecimal;
|
||||
|
||||
/**
|
||||
* A Table to display the Phones associated with the Contact object.
|
||||
* Provides links to delete the corresponding phone in each row.
|
||||
* A Table to display the Phones associated with the Contact object. Provides
|
||||
* links to delete the corresponding phone in each row.
|
||||
*
|
||||
* @author Shashin Shinde <a href="mailto:sshinde@redhat.com">sshinde@redhat.com</a>
|
||||
*
|
||||
* @version $Id: ContactPhonesTable.java 287 2005-02-22 00:29:02Z sskracic $
|
||||
*
|
||||
*/
|
||||
class ContactPhonesTable extends Table implements TableActionListener {
|
||||
|
||||
private ItemSelectionModel m_contactSel;
|
||||
private static final Logger log =
|
||||
Logger.getLogger(ContactPhonesTable.class.getName());
|
||||
|
||||
private static final String COL_PHONE_TYPE ="Phone Type";
|
||||
private static final String COL_PHONE_NUM="Phone Number";
|
||||
private static final String COL_DELETE ="Delete";
|
||||
// match columns by (symbolic) index, makes for easier reordering
|
||||
private static final int COL_INDEX_PHONE_TYPE = 0; //"Phone Type";
|
||||
private static final int COL_INDEX_PHONE_NUM = 1; //"Phone Number";
|
||||
private static final int COL_INDEX_DELETE = 2; //"Delete";
|
||||
|
||||
private ItemSelectionModel m_selContact;
|
||||
|
||||
/**
|
||||
* Constructor. Create an instance of this class.
|
||||
*
|
||||
* @param selContact , ItemSelectionModel which provides the
|
||||
* <code>Contact</code> object whose Phones are to be manipulated.
|
||||
* @param selContact ItemSelectionModel which provides the
|
||||
* <code>Contact</code> object whose Phones are to be
|
||||
* manipulated.
|
||||
*/
|
||||
public ContactPhonesTable(ItemSelectionModel selContact) {
|
||||
super();
|
||||
m_contactSel = selContact;
|
||||
|
||||
setEmptyView(new Label("No Phones associated with this Contact"));
|
||||
super();
|
||||
m_selContact = selContact;
|
||||
|
||||
setEmptyView(new Label(ContactGlobalizationUtil.globalize(
|
||||
"london.contenttypes.ui.contact.phonetable.no_entries_msg")));
|
||||
|
||||
TableColumnModel model = getColumnModel();
|
||||
model.add( new TableColumn( 0, COL_PHONE_TYPE ));
|
||||
model.add( new TableColumn( 1, COL_PHONE_NUM ));
|
||||
model.add( new TableColumn( 2, COL_DELETE ));
|
||||
|
||||
setModelBuilder(new PhonesTableModelBuilder(selContact));
|
||||
model.add(new TableColumn(
|
||||
COL_INDEX_PHONE_TYPE,
|
||||
new Label(ContactGlobalizationUtil.globalize(
|
||||
"london.contenttypes.ui.contact.phonetable.header_type")
|
||||
) ));
|
||||
model.add(new TableColumn(
|
||||
COL_INDEX_PHONE_NUM,
|
||||
new Label(ContactGlobalizationUtil.globalize(
|
||||
"london.contenttypes.ui.contact.phonetable.header_num")
|
||||
) ));
|
||||
model.add(new TableColumn(
|
||||
COL_INDEX_DELETE,
|
||||
new Label(ContactGlobalizationUtil.globalize(
|
||||
"london.contenttypes.ui.contact.phonetable.header_delete")
|
||||
) ));
|
||||
|
||||
model.get(2).setCellRenderer(new DeleteCellRenderer());
|
||||
|
||||
setModelBuilder(new PhonesTableModelBuilder(selContact));
|
||||
|
||||
addTableActionListener(this);
|
||||
|
||||
}
|
||||
|
||||
private class PhonesTableModelBuilder extends LockableImpl implements TableModelBuilder {
|
||||
/**
|
||||
*
|
||||
*/
|
||||
private class PhonesTableModelBuilder extends LockableImpl
|
||||
implements TableModelBuilder {
|
||||
|
||||
private ItemSelectionModel m_sel;
|
||||
|
||||
/**
|
||||
* Private class constructor
|
||||
* @param sel
|
||||
*/
|
||||
private PhonesTableModelBuilder(ItemSelectionModel sel) {
|
||||
m_sel = sel;
|
||||
}
|
||||
|
||||
/**
|
||||
*
|
||||
* @param table
|
||||
* @param state
|
||||
* @return
|
||||
*/
|
||||
public TableModel makeModel(Table table, PageState state) {
|
||||
table.getRowSelectionModel().clearSelection(state);
|
||||
|
||||
|
|
@ -99,24 +133,34 @@ class ContactPhonesTable extends Table implements TableActionListener{
|
|||
}
|
||||
}
|
||||
|
||||
/**
|
||||
* Internal private class.
|
||||
*/
|
||||
private class PhonesTableModel implements TableModel {
|
||||
|
||||
private Table m_table;
|
||||
private ContactPhonesCollection m_phones;
|
||||
private ContactPhone m_phone;
|
||||
|
||||
/**
|
||||
* Private class constructor.
|
||||
* @param t
|
||||
* @param ps
|
||||
* @param c
|
||||
*/
|
||||
private PhonesTableModel(Table t, PageState ps, Contact c) {
|
||||
m_table = t;
|
||||
m_phones = c.getPhones();
|
||||
}
|
||||
|
||||
/** Return the number of columsn this TableModel has. */
|
||||
public int getColumnCount() {
|
||||
return m_table.getColumnModel().size();
|
||||
}
|
||||
|
||||
/**
|
||||
* check collection for the existence of another row.If it has fetch the
|
||||
* value of Current Phone object into m_phone class variable.
|
||||
* check collection for the existence of another row. If it has fetch
|
||||
* the value of Current Phone object into m_phone class variable.
|
||||
*/
|
||||
public boolean nextRow() {
|
||||
if (m_phones != null && m_phones.next()) {
|
||||
|
|
@ -130,80 +174,122 @@ class ContactPhonesTable extends Table implements TableActionListener{
|
|||
/**
|
||||
* Return the phoneType and phoneNumber attributes for the Type and
|
||||
* Number columns respectively.
|
||||
*
|
||||
* @see com.arsdigita.bebop.table.TableModel#getElementAt(int)
|
||||
*/
|
||||
public Object getElementAt(int columnIndex) {
|
||||
|
||||
switch (columnIndex) {
|
||||
case 0:
|
||||
return m_phone.getPhoneType();
|
||||
case 1:
|
||||
return m_phone.getPhoneNumber();
|
||||
case 2:
|
||||
return "Delete";
|
||||
// return "Delete";
|
||||
return new Label(
|
||||
ContactGlobalizationUtil.globalize(
|
||||
"london.contenttypes.ui.contact.phonetable.link_delete")
|
||||
);
|
||||
default:
|
||||
return null;
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
* Always return the ID of <code>Phone</code> represented by current row.
|
||||
* Always return the ID of
|
||||
* <code>Phone</code> represented by current row.
|
||||
*
|
||||
* @see com.arsdigita.bebop.table.TableModel#getKeyAt(int)
|
||||
*/
|
||||
public Object getKeyAt(int columnIndex) {
|
||||
return m_phone.getID();
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
/**
|
||||
* Check for the permissions to delete item and put either a Lable or
|
||||
* a ControlLink accordingly.
|
||||
* Private class to check for the permissions to delete item and put either
|
||||
* a Lable 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) {
|
||||
/**
|
||||
*
|
||||
* @param table
|
||||
* @param state
|
||||
* @param value
|
||||
* @param isSelected
|
||||
* @param key
|
||||
* @param row
|
||||
* @param column
|
||||
* @return
|
||||
*/
|
||||
public Component getComponent(Table table, PageState state,
|
||||
Object value, boolean isSelected,
|
||||
Object key, int row, int column) {
|
||||
|
||||
Component ret = null;
|
||||
SecurityManager sm = CMS.getSecurityManager(state);
|
||||
Contact item = (Contact) m_selContact.getSelectedObject(state);
|
||||
|
||||
SecurityManager sm = Utilities.getSecurityManager(state);
|
||||
Contact item = (Contact) m_contactSel.getSelectedObject(state);
|
||||
|
||||
/* Check for permission to delete item */
|
||||
boolean canDelete = sm.canAccess(state.getRequest(),
|
||||
SecurityManager.DELETE_ITEM,
|
||||
item);
|
||||
|
||||
if ( value instanceof Label ) { // just the delete Controllink
|
||||
|
||||
if (canDelete) {
|
||||
ControlLink link = new ControlLink(value.toString());
|
||||
link.setConfirmation("Delete this Phone ?");
|
||||
return link;
|
||||
ret = new ControlLink((Component)value);
|
||||
// ret.setConfirmation(ContactGlobalizationUtil.globalize(
|
||||
// "london.contenttypes.ui.contact.phonetable.confirm_delete"));
|
||||
} else {
|
||||
return new Label(value.toString());
|
||||
ret = (Component)value;
|
||||
}
|
||||
|
||||
} else if ( value instanceof String ) { // phone type and value
|
||||
|
||||
// if (canDelete) {
|
||||
// ret = new ControlLink(value.toString());
|
||||
// ret = new ControlLink((String)value);
|
||||
// link.setConfirmation("Delete this Phone ?");
|
||||
// return link;
|
||||
// } else {
|
||||
ret = new Label((String)value);
|
||||
// }
|
||||
|
||||
} else {
|
||||
// return new Label(value.toString());
|
||||
/* Just returns the label without underlying link */
|
||||
ret = new Label(value.toString());
|
||||
}
|
||||
|
||||
return ret;
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
* Provide implementation to TableActionListener method.
|
||||
* Code that comes into picture when a link on the table is clicked.
|
||||
* Handles delete event.
|
||||
* Provide implementation to TableActionListener method. Code that comes
|
||||
* into picture when a link on the table is clicked. Handles delete event.
|
||||
*/
|
||||
public void cellSelected(TableActionEvent evt) {
|
||||
PageState state = evt.getPageState();
|
||||
|
||||
TableColumn col = getColumnModel().get(evt.getColumn().intValue());
|
||||
String colName = (String) col.getHeaderValue();
|
||||
int columnIndex = col.getModelIndex();
|
||||
|
||||
if ( COL_DELETE.equals(colName) ) {
|
||||
// if (COL_DELETE.equals(colName)) {
|
||||
if ( columnIndex == COL_INDEX_DELETE ) {
|
||||
BigDecimal phoneID = new BigDecimal(evt.getRowKey().toString());
|
||||
Contact contact = (Contact) m_contactSel.getSelectedObject(state);
|
||||
Contact contact = (Contact) m_selContact.getSelectedObject(state);
|
||||
ContactPhone ph = new ContactPhone(phoneID);
|
||||
contact.removePhone(ph);
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
* provide Implementation to TableActionListener method.
|
||||
* Does nothing in our case.
|
||||
* provide Implementation to TableActionListener method. Does nothing in our
|
||||
* case.
|
||||
*/
|
||||
public void headSelected(TableActionEvent e) {
|
||||
throw new UnsupportedOperationException("Not Implemented");
|
||||
|
|
|
|||
|
|
@ -20,14 +20,14 @@ package com.arsdigita.london.contenttypes.ui;
|
|||
|
||||
import com.arsdigita.bebop.Component;
|
||||
import com.arsdigita.cms.ItemSelectionModel;
|
||||
import com.arsdigita.london.contenttypes.Contact;
|
||||
import com.arsdigita.london.contenttypes.util.ContactGlobalizationUtil;
|
||||
import com.arsdigita.cms.ui.authoring.AuthoringKitWizard;
|
||||
import com.arsdigita.cms.ui.authoring.BasicPageForm;
|
||||
import com.arsdigita.cms.ui.authoring.SimpleEditStep;
|
||||
import com.arsdigita.cms.ui.workflow.WorkflowLockedComponentAccess;
|
||||
import com.arsdigita.cms.util.GlobalizationUtil;
|
||||
import com.arsdigita.domain.DomainObject;
|
||||
import com.arsdigita.london.contenttypes.Contact;
|
||||
import com.arsdigita.london.contenttypes.util.ContactGlobalizationUtil;
|
||||
import com.arsdigita.toolbox.ui.DomainObjectPropertySheet;
|
||||
import com.arsdigita.bebop.PageState;
|
||||
|
||||
|
|
@ -51,9 +51,8 @@ public class ContactPropertiesStep extends SimpleEditStep {
|
|||
BasicPageForm editSheet;
|
||||
|
||||
editSheet = new ContactPropertyForm(itemModel);
|
||||
add(
|
||||
EDIT_SHEET_NAME,
|
||||
"Edit",
|
||||
add(EDIT_SHEET_NAME,
|
||||
GlobalizationUtil.globalize("cms.ui.edit"),
|
||||
new WorkflowLockedComponentAccess(editSheet, itemModel),
|
||||
editSheet.getSaveCancelSection().getCancelButton());
|
||||
|
||||
|
|
@ -71,61 +70,59 @@ public class ContactPropertiesStep extends SimpleEditStep {
|
|||
public static Component getContactPropertySheet(ItemSelectionModel itemModel) {
|
||||
DomainObjectPropertySheet sheet = new DomainObjectPropertySheet(itemModel);
|
||||
|
||||
sheet.add(
|
||||
GlobalizationUtil.globalize("com.arsdigita.london.contenttypes.ui.title"),
|
||||
sheet.add(GlobalizationUtil.globalize("cms.contenttypes.ui.title"),
|
||||
Contact.TITLE);
|
||||
|
||||
sheet.add(
|
||||
GlobalizationUtil.globalize("com.arsdigita.london.contenttypes.ui.name"),
|
||||
sheet.add(GlobalizationUtil.globalize("cms.contenttypes.ui.name"),
|
||||
Contact.NAME);
|
||||
|
||||
sheet.add(
|
||||
ContactGlobalizationUtil.globalize(
|
||||
"com.arsdigita.london.contenttypes.ui.contact_givenname"),
|
||||
sheet.add(ContactGlobalizationUtil.globalize(
|
||||
"london.contenttypes.ui.contact.givenname"),
|
||||
Contact.GIVEN_NAME);
|
||||
|
||||
sheet.add(
|
||||
ContactGlobalizationUtil.globalize(
|
||||
"com.arsdigita.london.contenttypes.ui.contact_familyname"),
|
||||
sheet.add(ContactGlobalizationUtil.globalize(
|
||||
"london.contenttypes.ui.contact.familyname"),
|
||||
Contact.FAMILY_NAME);
|
||||
|
||||
sheet.add(
|
||||
ContactGlobalizationUtil.globalize("cms.contenttypes.ui.contact_type"),
|
||||
sheet.add(ContactGlobalizationUtil.globalize(
|
||||
"london.contenttypes.ui.contact.suffix"),
|
||||
Contact.SUFFIX);
|
||||
|
||||
sheet.add(ContactGlobalizationUtil.globalize(
|
||||
"london.contenttypes.ui.contact.type"),
|
||||
Contact.CONTACT_TYPE,
|
||||
new DomainObjectPropertySheet.AttributeFormatter() {
|
||||
public String format(DomainObject item,String attribute,PageState state) {
|
||||
public String format(DomainObject item,
|
||||
String attribute,
|
||||
PageState state) {
|
||||
Contact contact = (Contact) item;
|
||||
if (contact.getContactType() != null) {
|
||||
return contact.getContactTypeName();
|
||||
} else {
|
||||
return "unknown";
|
||||
return (String) GlobalizationUtil
|
||||
.globalize("cms.ui.unknown")
|
||||
.localize();
|
||||
}
|
||||
}
|
||||
});
|
||||
|
||||
sheet.add(
|
||||
GlobalizationUtil.globalize("com.arsdigita.london.contenttypes.ui.description"),
|
||||
sheet.add(GlobalizationUtil.globalize("cms.contenttypes.ui.description"),
|
||||
Contact.DESCRIPTION);
|
||||
|
||||
sheet.add(
|
||||
ContactGlobalizationUtil.globalize("com.arsdigita.london.contenttypes.ui.contact_emails"),
|
||||
sheet.add(ContactGlobalizationUtil.globalize(
|
||||
"london.contenttypes.ui.contact.emails"),
|
||||
Contact.EMAILS);
|
||||
|
||||
sheet.add(
|
||||
ContactGlobalizationUtil.globalize("com.arsdigita.london.contenttypes.ui.contact_suffix"),
|
||||
Contact.SUFFIX);
|
||||
|
||||
sheet.add(
|
||||
ContactGlobalizationUtil.globalize("com.arsdigita.london.contenttypes.ui.contact_orgname"),
|
||||
sheet.add(ContactGlobalizationUtil.globalize(
|
||||
"london.contenttypes.ui.contact.orgname"),
|
||||
Contact.ORG_NAME);
|
||||
|
||||
sheet.add(
|
||||
ContactGlobalizationUtil.globalize(
|
||||
"com.arsdigita.london.contenttypes.ui.contact_deptname"),
|
||||
sheet.add(ContactGlobalizationUtil.globalize(
|
||||
"london.contenttypes.ui.contact.deptname"),
|
||||
Contact.DEPT_NAME);
|
||||
|
||||
sheet.add(
|
||||
ContactGlobalizationUtil.globalize("com.arsdigita.london.contenttypes.ui.contact_role"),
|
||||
sheet.add(ContactGlobalizationUtil.globalize(
|
||||
"london.contenttypes.ui.contact.role"),
|
||||
Contact.ROLE);
|
||||
|
||||
return sheet;
|
||||
|
|
|
|||
|
|
@ -35,6 +35,7 @@ import com.arsdigita.london.contenttypes.ContactType;
|
|||
import com.arsdigita.london.contenttypes.ContactTypesCollection;
|
||||
import com.arsdigita.london.contenttypes.util.ContactGlobalizationUtil;
|
||||
import com.arsdigita.cms.ui.authoring.BasicPageForm;
|
||||
import com.arsdigita.cms.util.GlobalizationUtil;
|
||||
|
||||
/**
|
||||
* Form to edit basic properties of <code>Contact</code> object. Used by
|
||||
|
|
@ -81,32 +82,32 @@ public class ContactPropertyForm extends BasicPageForm {
|
|||
}
|
||||
|
||||
protected void addGivenNameWidget() {
|
||||
add(new Label(ContactGlobalizationUtil
|
||||
.globalize("com.arsdigita.london.contenttypes.ui.contact_givenname")));
|
||||
add(new Label(ContactGlobalizationUtil.globalize(
|
||||
"london.contenttypes.ui.contact.givenname")));
|
||||
ParameterModel givenNameParam = new StringParameter(Contact.GIVEN_NAME);
|
||||
TextField givenName = new TextField(givenNameParam);
|
||||
add(givenName);
|
||||
}
|
||||
|
||||
protected void addFamilyNameWidget() {
|
||||
add(new Label(ContactGlobalizationUtil
|
||||
.globalize("com.arsdigita.london.contenttypes.ui.contact_familyname")));
|
||||
add(new Label(ContactGlobalizationUtil.globalize(
|
||||
"london.contenttypes.ui.contact.familyname")));
|
||||
ParameterModel familyNameParam = new StringParameter(Contact.FAMILY_NAME);
|
||||
TextField familyName = new TextField(familyNameParam);
|
||||
add(familyName);
|
||||
}
|
||||
|
||||
protected void addSuffixWidget() {
|
||||
add(new Label(ContactGlobalizationUtil
|
||||
.globalize("com.arsdigita.london.contenttypes.ui.contact_suffix")));
|
||||
add(new Label(ContactGlobalizationUtil.globalize(
|
||||
"london.contenttypes.ui.contact.suffix")));
|
||||
ParameterModel suffixParam = new StringParameter(Contact.SUFFIX);
|
||||
TextField suffix = new TextField(suffixParam);
|
||||
add(suffix);
|
||||
}
|
||||
|
||||
protected void addContactTypeWidget() {
|
||||
add(new Label(ContactGlobalizationUtil
|
||||
.globalize("com.arsdigita.london.contenttypes.ui.contact_type")));
|
||||
add(new Label(ContactGlobalizationUtil.globalize(
|
||||
"london.contenttypes.ui.contact.type")));
|
||||
ParameterModel contactTypeParam = new StringParameter(Contact.CONTACT_TYPE);
|
||||
SingleSelect contactType = new SingleSelect(contactTypeParam);
|
||||
add(contactType);
|
||||
|
|
@ -118,8 +119,8 @@ public class ContactPropertyForm extends BasicPageForm {
|
|||
}
|
||||
|
||||
protected void addDescriptionWidget() {
|
||||
add(new Label(ContactGlobalizationUtil
|
||||
.globalize("com.arsdigita.london.contenttypes.ui.contact_description")));
|
||||
add(new Label(GlobalizationUtil.globalize(
|
||||
"cms.contenttypes.ui.description")));
|
||||
ParameterModel descParam = new StringParameter(Contact.DESCRIPTION);
|
||||
TextArea desc = new TextArea(descParam);
|
||||
desc.setRows(5);
|
||||
|
|
@ -128,7 +129,7 @@ public class ContactPropertyForm extends BasicPageForm {
|
|||
|
||||
protected void addEmailsWidget() {
|
||||
add(new Label(ContactGlobalizationUtil
|
||||
.globalize("com.arsdigita.london.contenttypes.ui.contact_emails")));
|
||||
.globalize("london.contenttypes.ui.contact.emails")));
|
||||
ParameterModel emailsParam = new StringParameter(Contact.EMAILS);
|
||||
TextField emails = new TextField(emailsParam);
|
||||
add(emails);
|
||||
|
|
@ -136,7 +137,7 @@ public class ContactPropertyForm extends BasicPageForm {
|
|||
|
||||
protected void addOrganizationNameWidget() {
|
||||
add(new Label(ContactGlobalizationUtil
|
||||
.globalize("com.arsdigita.london.contenttypes.ui.contact_orgname")));
|
||||
.globalize("london.contenttypes.ui.contact.orgname")));
|
||||
ParameterModel orgNameParam = new StringParameter(Contact.ORG_NAME);
|
||||
TextField orgName = new TextField(orgNameParam);
|
||||
add(orgName);
|
||||
|
|
@ -144,7 +145,7 @@ public class ContactPropertyForm extends BasicPageForm {
|
|||
|
||||
protected void addDepartmentNameWidget() {
|
||||
add(new Label(ContactGlobalizationUtil
|
||||
.globalize("com.arsdigita.london.contenttypes.ui.contact_deptname")));
|
||||
.globalize("london.contenttypes.ui.contact.deptname")));
|
||||
ParameterModel deptParam = new StringParameter(Contact.DEPT_NAME);
|
||||
TextField deptName = new TextField(deptParam);
|
||||
add(deptName);
|
||||
|
|
@ -152,7 +153,7 @@ public class ContactPropertyForm extends BasicPageForm {
|
|||
|
||||
protected void addRoleWidget() {
|
||||
add(new Label(ContactGlobalizationUtil
|
||||
.globalize("com.arsdigita.london.contenttypes.ui.contact_role")));
|
||||
.globalize("london.contenttypes.ui.contact.role")));
|
||||
ParameterModel roleParam = new StringParameter(Contact.ROLE);
|
||||
TextField role = new TextField(roleParam);
|
||||
add(role);
|
||||
|
|
|
|||
Loading…
Reference in New Issue