Verbesserung der Lokalisierung LDN Contact. Noch nicht fehlerfrei!.

git-svn-id: https://svn.libreccm.org/ccm/trunk@2224 8810af33-2d31-482b-a856-94f89814c4df
master
pb 2013-06-20 15:14:57 +00:00
parent 9c7a80b93d
commit c58251ff82
16 changed files with 598 additions and 436 deletions

View File

@ -38,7 +38,6 @@ import com.arsdigita.cms.SecurityManager;
import com.arsdigita.cms.contenttypes.ArticleSection; import com.arsdigita.cms.contenttypes.ArticleSection;
import com.arsdigita.cms.contenttypes.ArticleSectionCollection; import com.arsdigita.cms.contenttypes.ArticleSectionCollection;
import com.arsdigita.cms.contenttypes.MultiPartArticle; import com.arsdigita.cms.contenttypes.MultiPartArticle;
import com.arsdigita.cms.dispatcher.Utilities;
import com.arsdigita.cms.contenttypes.util.MPArticleGlobalizationUtil; import com.arsdigita.cms.contenttypes.util.MPArticleGlobalizationUtil;
import com.arsdigita.domain.DomainObjectFactory; import com.arsdigita.domain.DomainObjectFactory;
import com.arsdigita.persistence.OID; import com.arsdigita.persistence.OID;
@ -58,8 +57,7 @@ import java.math.BigDecimal;
*/ */
public class SectionTable extends Table public class SectionTable extends Table
{ {
private static final Logger log = private static final Logger s_log = Logger.getLogger(SectionTable.class);
Logger.getLogger(SectionTable.class.getName());
// match columns by (symbolic) index, makes for easier reordering // match columns by (symbolic) index, makes for easier reordering
public static final int COL_INDEX_TITLE = 0; // "Section"; 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_selArticle;
private ItemSelectionModel m_selSection; private ItemSelectionModel m_selSection;
private ItemSelectionModel m_moveSection; 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 * @param selArticle a selection model that returns the MultiPartArticle
* which holds the sections to display. * which holds the sections to display.
* @param moveSection * @param moveSection
*/ */
public SectionTable ( ItemSelectionModel selArticle, ItemSelectionModel moveSection ) { public SectionTable ( ItemSelectionModel selArticle,
ItemSelectionModel moveSection ) {
super(); super();
m_selArticle = selArticle; m_selArticle = selArticle;
m_moveSection = moveSection; m_moveSection = moveSection;
@ -177,12 +175,17 @@ public class SectionTable extends Table
* The model builder to generate a suitable model for the SectionTable * The model builder to generate a suitable model for the SectionTable
*/ */
protected class SectionTableModelBuilder extends LockableImpl protected class SectionTableModelBuilder extends LockableImpl
implements TableModelBuilder implements TableModelBuilder {
{
protected ItemSelectionModel m_selArticle; protected ItemSelectionModel m_selArticle;
protected ItemSelectionModel m_moveSection; protected ItemSelectionModel m_moveSection;
/**
* Private class constructor.
* @param selArticle
* @param moveSection
*/
public SectionTableModelBuilder ( ItemSelectionModel selArticle, public SectionTableModelBuilder ( ItemSelectionModel selArticle,
ItemSelectionModel moveSection ) { ItemSelectionModel moveSection ) {
m_selArticle = selArticle; m_selArticle = selArticle;
@ -190,6 +193,12 @@ public class SectionTable extends Table
} }
/**
*
* @param table
* @param state
* @return
*/
public TableModel makeModel ( Table table, PageState state ) { public TableModel makeModel ( Table table, PageState state ) {
table.getRowSelectionModel().clearSelection(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 TableColumnModel m_colModel;
private SectionTable m_table; private SectionTable m_table;
@ -318,7 +328,6 @@ public class SectionTable extends Table
Object key, int row, int column ) { Object key, int row, int column ) {
Component ret = null; Component ret = null;
// SecurityManager sm = Utilities.getSecurityManager(state);
SecurityManager sm = CMS.getSecurityManager(state); SecurityManager sm = CMS.getSecurityManager(state);
ContentItem item = (ContentItem)m_selArticle.getSelectedObject(state); ContentItem item = (ContentItem)m_selArticle.getSelectedObject(state);

View File

@ -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.none=No former name
cms.contenttypes.ui.person.alias=Former name cms.contenttypes.ui.person.alias=Former name
cms.contenttypes.ui.person.alias.select=Select 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.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.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. cms.contenttypes.person.alias.select.no_suitable_language_variant=The selected item has no suitable language variant.

View File

@ -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.none=Kein fr\u00fcherer Name
cms.contenttypes.ui.person.alias=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.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.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.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. cms.contenttypes.person.alias.select.no_suitable_language_variant=Das ausgew\u00e4hlte Item hat keine passende Sprachvariante.

View File

@ -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.none=No former name
cms.contenttypes.ui.person.alias=Former name cms.contenttypes.ui.person.alias=Former name
cms.contenttypes.ui.person.alias.select=Select 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.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.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. cms.contenttypes.person.alias.select.no_suitable_language_variant=The selected item has no suitable language variant.

View File

@ -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.none=No former name
cms.contenttypes.ui.person.alias=Former name cms.contenttypes.ui.person.alias=Former name
cms.contenttypes.ui.person.alias.select=Select 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.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.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. cms.contenttypes.person.alias.select.no_suitable_language_variant=The selected item has no suitable language variant.

View File

@ -1,26 +1,31 @@
com.arsdigita.london.contenttypes.ui.contact.address_saon=SAON london.contenttypes.ui.contact.address.saon=SAON
com.arsdigita.london.contenttypes.ui.contact.address_paon=PAON london.contenttypes.ui.contact.address.paon=PAON
com.arsdigita.london.contenttypes.ui.contact.address_streetdesc=Street Description london.contenttypes.ui.contact.address.streetdesc=Street Description
com.arsdigita.london.contenttypes.ui.contact.address_streetrefno=Street Reference No london.contenttypes.ui.contact.address.streetrefno=Street Reference No
com.arsdigita.london.contenttypes.ui.contact.address_locality=Locality london.contenttypes.ui.contact.address.locality=Locality
com.arsdigita.london.contenttypes.ui.contact.address_town=Town london.contenttypes.ui.contact.address.town=Town
com.arsdigita.london.contenttypes.ui.contact.address_administrative_area=Administrative Area london.contenttypes.ui.contact.address.administrative_area=Administrative Area
com.arsdigita.london.contenttypes.ui.contact.address_posttown=Postal Town london.contenttypes.ui.contact.address.posttown=Postal Town
com.arsdigita.london.contenttypes.ui.contact.address_postcode=Postal Code london.contenttypes.ui.contact.address.postcode=Postal Code
com.arsdigita.london.contenttypes.ui.contact.address_proprefno=Property Reference No london.contenttypes.ui.contact.address.proprefno=Property Reference No
com.arsdigita.london.contenttypes.ui.contact_type=Contact Type london.contenttypes.ui.contact.type=Contact Type
com.arsdigita.london.contenttypes.ui.contact_orgname=Organization Name london.contenttypes.ui.contact.orgname=Organization Name
com.arsdigita.london.contenttypes.ui.contact_deptname=Department Name london.contenttypes.ui.contact.deptname=Department Name
com.arsdigita.london.contenttypes.ui.contact_role=Role of Contact london.contenttypes.ui.contact.role=Role of Contact
com.arsdigita.london.contenttypes.ui.contact_givenname=Given Name london.contenttypes.ui.contact.givenname=Given Name
com.arsdigita.london.contenttypes.ui.contact_familyname=Family Name london.contenttypes.ui.contact.familyname=Family Name
com.arsdigita.london.contenttypes.ui.contact_suffix=Suffix london.contenttypes.ui.contact.suffix=Suffix
com.arsdigita.london.contenttypes.ui.contact_description=Contact Description london.contenttypes.ui.contact.phone_number=Number
com.arsdigita.london.contenttypes.ui.contact.phone_number=Number london.contenttypes.ui.contact.phone_type=Types
com.arsdigita.london.contenttypes.ui.phone_type=Types london.contenttypes.ui.contact.emails=Emails
com.arsdigita.london.contenttypes.ui.contact_emails=Emails
com.arsdigita.london.contenttypes.contact_authoring_step_description=Contact com.arsdigita.london.contenttypes.contact_authoring_step_description=Contact
com.arsdigita.london.contenttypes.contact_authoring_step_label=Contact com.arsdigita.london.contenttypes.contact_authoring_step_label=Contact
com.arsdigita.london.contenttypes.ui.name=Name com.arsdigita.london.contenttypes.ui.contact.select_contact=Select Contact
com.arsdigita.london.contenttypes.ui.title=Title london.contenttypes.ui.contact.add_phone_button=Add Phone
com.arsdigita.london.contenttypes.ui.description=Description 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?

View File

@ -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?

View File

@ -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?

View File

@ -25,6 +25,7 @@ import com.arsdigita.cms.ui.authoring.AuthoringKitWizard;
import com.arsdigita.cms.ui.authoring.BasicItemForm; import com.arsdigita.cms.ui.authoring.BasicItemForm;
import com.arsdigita.cms.ui.authoring.SimpleEditStep; import com.arsdigita.cms.ui.authoring.SimpleEditStep;
import com.arsdigita.cms.ui.workflow.WorkflowLockedComponentAccess; import com.arsdigita.cms.ui.workflow.WorkflowLockedComponentAccess;
import com.arsdigita.cms.util.GlobalizationUtil;
import com.arsdigita.toolbox.ui.DomainObjectPropertySheet; import com.arsdigita.toolbox.ui.DomainObjectPropertySheet;
/** /**
@ -50,7 +51,7 @@ public class ContactAddressProperties extends SimpleEditStep {
form = new ContactAddressPropertyForm(itemModel); form = new ContactAddressPropertyForm(itemModel);
add(EDIT_SHEET_NAME, add(EDIT_SHEET_NAME,
"Edit", GlobalizationUtil.globalize("cms.ui.edit"),
new WorkflowLockedComponentAccess(form, itemModel), new WorkflowLockedComponentAccess(form, itemModel),
form.getSaveCancelSection().getCancelButton()); form.getSaveCancelSection().getCancelButton());
@ -69,44 +70,44 @@ public class ContactAddressProperties extends SimpleEditStep {
public static Component getAddressPropertySheet(ItemSelectionModel itemModel) { public static Component getAddressPropertySheet(ItemSelectionModel itemModel) {
DomainObjectPropertySheet sheet = new DomainObjectPropertySheet(itemModel); DomainObjectPropertySheet sheet = new DomainObjectPropertySheet(itemModel);
sheet.add( sheet.add(ContactGlobalizationUtil.globalize(
ContactGlobalizationUtil.globalize("com.arsdigita.london.contenttypes.ui.contact.address_saon"), "london.contenttypes.ui.contact.address.saon"),
"contactAddress.saon"); "contactAddress.saon");
sheet.add( sheet.add(ContactGlobalizationUtil.globalize(
ContactGlobalizationUtil.globalize("com.arsdigita.london.contenttypes.ui.contact.address_paon"), "london.contenttypes.ui.contact.address.paon"),
"contactAddress.paon"); "contactAddress.paon");
sheet.add( sheet.add(ContactGlobalizationUtil.globalize(
ContactGlobalizationUtil.globalize("com.arsdigita.london.contenttypes.ui.contact.address_streetdesc"), "london.contenttypes.ui.contact.address.streetdesc"),
"contactAddress.streetDesc"); "contactAddress.streetDesc");
sheet.add( sheet.add(ContactGlobalizationUtil.globalize(
ContactGlobalizationUtil.globalize("com.arsdigita.london.contenttypes.ui.contact.address_streetrefno"), "london.contenttypes.ui.contact.address.streetrefno"),
"contactAddress.streetRefNo"); "contactAddress.streetRefNo");
sheet.add( sheet.add(ContactGlobalizationUtil.globalize(
ContactGlobalizationUtil.globalize("com.arsdigita.london.contenttypes.ui.contact.address_locality"), "london.contenttypes.ui.contact.address.locality"),
"contactAddress.locality"); "contactAddress.locality");
sheet.add( sheet.add(ContactGlobalizationUtil.globalize(
ContactGlobalizationUtil.globalize("com.arsdigita.london.contenttypes.ui.contact.address_town"), "london.contenttypes.ui.contact.address.town"),
"contactAddress.town"); "contactAddress.town");
sheet.add( sheet.add(ContactGlobalizationUtil.globalize(
ContactGlobalizationUtil.globalize("com.arsdigita.london.contenttypes.ui.contact.address_administrative_area"), "london.contenttypes.ui.contact.address.administrative_area"),
"contactAddress.administrativeArea"); "contactAddress.administrativeArea");
sheet.add( sheet.add(ContactGlobalizationUtil.globalize(
ContactGlobalizationUtil.globalize("com.arsdigita.london.contenttypes.ui.contact.address_posttown"), "london.contenttypes.ui.contact.address.posttown"),
"contactAddress.postTown"); "contactAddress.postTown");
sheet.add( sheet.add(ContactGlobalizationUtil.globalize(
ContactGlobalizationUtil.globalize("com.arsdigita.london.contenttypes.ui.contact.address_postcode"), "london.contenttypes.ui.contact.address.postcode"),
"contactAddress.postCode"); "contactAddress.postCode");
sheet.add( sheet.add(ContactGlobalizationUtil.globalize(
ContactGlobalizationUtil.globalize("com.arsdigita.london.contenttypes.ui.contact.address_proprefno"), "london.contenttypes.ui.contact.address.proprefno"),
"contactAddress.referenceNo"); "contactAddress.referenceNo");
return sheet; return sheet;

View File

@ -43,19 +43,20 @@ import com.arsdigita.cms.ui.authoring.BasicItemForm;
*/ */
public class ContactAddressPropertyForm extends BasicItemForm { public class ContactAddressPropertyForm extends BasicItemForm {
private static final Logger s_log = Logger.getLogger(
ContactAddressPropertyForm.class);
/** Name of this form */ /** Name of this form */
private static final String ID = "Contact_address_edit"; 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 * Creates a new form to edit the <code>ContactAddress</code> object properties
* properties associated with the <code>Contact</code> object specified by * associated with the <code>Contact</code> object specified by the
* the item selection model passed in. * item selection model passed in.
* *
* @param itemModel The ItemSelectionModel to use to obtain the Contact * @param itemModel The ItemSelectionModel to use to obtain the Contact
* object to work on * object to work on
**/ */
public ContactAddressPropertyForm(ItemSelectionModel itemModel) { public ContactAddressPropertyForm(ItemSelectionModel itemModel) {
super(ID, itemModel); super(ID, itemModel);
} }
@ -81,7 +82,7 @@ public class ContactAddressPropertyForm extends BasicItemForm {
protected void addSAON() { protected void addSAON() {
add(new Label(ContactGlobalizationUtil 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); ParameterModel saonParam = new StringParameter(ContactAddress.SAON);
TextField saon = new TextField(saonParam); TextField saon = new TextField(saonParam);
add(saon); add(saon);
@ -89,7 +90,7 @@ public class ContactAddressPropertyForm extends BasicItemForm {
protected void addPAON() { protected void addPAON() {
add(new Label(ContactGlobalizationUtil 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); ParameterModel paonParam = new StringParameter(ContactAddress.PAON);
TextField paon = new TextField(paonParam); TextField paon = new TextField(paonParam);
paon.addValidationListener(new NotNullValidationListener()); paon.addValidationListener(new NotNullValidationListener());
@ -98,7 +99,7 @@ public class ContactAddressPropertyForm extends BasicItemForm {
protected void addStreetDesc() { protected void addStreetDesc() {
add(new Label(ContactGlobalizationUtil 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); ParameterModel streetDescParam = new StringParameter(ContactAddress.STREET_DESC);
TextField streetDesc = new TextField(streetDescParam); TextField streetDesc = new TextField(streetDescParam);
streetDesc.addValidationListener(new NotNullValidationListener()); streetDesc.addValidationListener(new NotNullValidationListener());
@ -107,7 +108,7 @@ public class ContactAddressPropertyForm extends BasicItemForm {
protected void addStreetRefNo() { protected void addStreetRefNo() {
add(new Label(ContactGlobalizationUtil 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); ParameterModel streetRefNoParam = new StringParameter(ContactAddress.STREET_REF_NO);
TextField streetRefNo = new TextField(streetRefNoParam); TextField streetRefNo = new TextField(streetRefNoParam);
add(streetRefNo); add(streetRefNo);
@ -115,7 +116,7 @@ public class ContactAddressPropertyForm extends BasicItemForm {
protected void addLocality() { protected void addLocality() {
add(new Label(ContactGlobalizationUtil 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); ParameterModel localityParam = new StringParameter(ContactAddress.LOCALITY);
TextField locality = new TextField(localityParam); TextField locality = new TextField(localityParam);
add(locality); add(locality);
@ -123,7 +124,7 @@ public class ContactAddressPropertyForm extends BasicItemForm {
protected void addTown() { protected void addTown() {
add(new Label(ContactGlobalizationUtil 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); ParameterModel townParam = new StringParameter(ContactAddress.TOWN);
TextField town = new TextField(townParam); TextField town = new TextField(townParam);
add(town); add(town);
@ -131,7 +132,7 @@ public class ContactAddressPropertyForm extends BasicItemForm {
protected void addArea() { protected void addArea() {
add(new Label(ContactGlobalizationUtil 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); ParameterModel adAreaParam = new StringParameter(ContactAddress.ADMINISTRATIVE_AREA);
TextField adArea = new TextField(adAreaParam); TextField adArea = new TextField(adAreaParam);
add(adArea); add(adArea);
@ -139,7 +140,7 @@ public class ContactAddressPropertyForm extends BasicItemForm {
protected void addPostTown() { protected void addPostTown() {
add(new Label(ContactGlobalizationUtil 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); ParameterModel postTownParam = new StringParameter(ContactAddress.POST_TOWN);
TextField postTown = new TextField(postTownParam); TextField postTown = new TextField(postTownParam);
add(postTown); add(postTown);
@ -147,7 +148,7 @@ public class ContactAddressPropertyForm extends BasicItemForm {
protected void addPostCode() { protected void addPostCode() {
add(new Label(ContactGlobalizationUtil 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); ParameterModel postCodeParam = new StringParameter(ContactAddress.POST_CODE);
TextField postCode = new TextField(postCodeParam); TextField postCode = new TextField(postCodeParam);
add(postCode); add(postCode);
@ -155,7 +156,7 @@ public class ContactAddressPropertyForm extends BasicItemForm {
protected void addPropRefNo() { protected void addPropRefNo() {
add(new Label(ContactGlobalizationUtil 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); ParameterModel propRefNoParam = new StringParameter(ContactAddress.PROP_REF_NO);
TextField propRefNo = new TextField(propRefNoParam); TextField propRefNo = new TextField(propRefNoParam);
add(propRefNo); add(propRefNo);

View File

@ -36,12 +36,11 @@ import com.arsdigita.cms.ui.authoring.PageCreate;
/** /**
* Authoring kit create component to create objects of <code>Contact</code> * 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> * @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 $ * @version $Id: ContactCreate.java 287 2005-02-22 00:29:02Z sskracic $
*
*/ */
public class ContactCreate extends PageCreate { public class ContactCreate extends PageCreate {
@ -56,21 +55,28 @@ public class ContactCreate extends PageCreate {
protected void addWidgets() { protected void addWidgets() {
/* Add the standard widgets title, name, and optional launchdate */
super.addWidgets(); super.addWidgets();
TextField givenName = new TextField(Contact.GIVEN_NAME); TextField givenName = new TextField(Contact.GIVEN_NAME);
add(new Label(ContactGlobalizationUtil add(new Label(ContactGlobalizationUtil
.globalize("com.arsdigita.london.contenttypes.ui.contact_givenname"))); .globalize("london.contenttypes.ui.contact.givenname")));
givenName.addValidationListener(new NotNullValidationListener()); givenName.addValidationListener(new NotNullValidationListener());
add(givenName); add(givenName);
TextField familyName = new TextField(Contact.FAMILY_NAME); TextField familyName = new TextField(Contact.FAMILY_NAME);
add(new Label(ContactGlobalizationUtil add(new Label(ContactGlobalizationUtil
.globalize("com.arsdigita.london.contenttypes.ui.contact_familyname"))); .globalize("london.contenttypes.ui.contact.familyname")));
familyName.addValidationListener(new NotNullValidationListener()); familyName.addValidationListener(new NotNullValidationListener());
add(familyName); add(familyName);
} }
/**
*
* @param e
* @throws FormProcessException
*/
@Override
public void process(FormSectionEvent e) throws FormProcessException { public void process(FormSectionEvent e) throws FormProcessException {
FormData data = e.getFormData(); FormData data = e.getFormData();
@ -97,5 +103,4 @@ public class ContactCreate extends PageCreate {
m_parent.editItem(state, contact); m_parent.editItem(state, contact);
} }
} }

View File

@ -40,22 +40,20 @@ import java.util.ArrayList;
* Form to Create objects of type <code>ContactPhone</code>. * Form to Create objects of type <code>ContactPhone</code>.
* *
* @author Shashin Shinde <sshinde@redhat.com> * @author Shashin Shinde <sshinde@redhat.com>
*
* @version $Id: ContactCreatePhone.java 287 2005-02-22 00:29:02Z sskracic $ * @version $Id: ContactCreatePhone.java 287 2005-02-22 00:29:02Z sskracic $
*
*/ */
class ContactCreatePhone extends BasicItemForm { class ContactCreatePhone extends BasicItemForm {
private ItemSelectionModel m_model; private ItemSelectionModel m_model;
/** /**
* Creates a new form to create the <code>ContactPhone</code> object * Creates a new form to create the
* type associated with the <code>Contact</code> object specified * <code>ContactPhone</code> object type associated with the
* by the item selection model passed in. * <code>Contact</code> object specified by the item selection model passed
* in.
* *
* @param itemModel * @param itemModel The ItemSelectionModel to use to obtain the Contact
* The ItemSelectionModel to use to obtain the Contact object to * object to work on
* work on
*/ */
public ContactCreatePhone(ItemSelectionModel itemModel) { public ContactCreatePhone(ItemSelectionModel itemModel) {
super("Contact_phone_create", itemModel); super("Contact_phone_create", itemModel);
@ -70,14 +68,14 @@ class ContactCreatePhone extends BasicItemForm {
protected void addWidgets() { protected void addWidgets() {
add(new Label(ContactGlobalizationUtil.globalize( 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); ParameterModel phoneNoParam = new StringParameter(ContactPhone.PHONE_NUMBER);
TextField phoneNo = new TextField(phoneNoParam); TextField phoneNo = new TextField(phoneNoParam);
phoneNo.addValidationListener(new NotNullValidationListener()); phoneNo.addValidationListener(new NotNullValidationListener());
add(phoneNo); add(phoneNo);
add(new Label(ContactGlobalizationUtil.globalize( 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); ParameterModel phoneTypeParam = new StringParameter(ContactPhone.PHONE_TYPE);
SingleSelect phoneType = new SingleSelect(phoneTypeParam); SingleSelect phoneType = new SingleSelect(phoneTypeParam);
add(phoneType); add(phoneType);
@ -96,8 +94,8 @@ class ContactCreatePhone extends BasicItemForm {
} }
/** /**
* Create an object of type <code>ContactPhone</code> and add it to Contact * Create an object of type <code>ContactPhone</code> and add it
* object retrieved from passed in ItemSelectionModel. * to Contact object retrieved from passed in ItemSelectionModel.
*/ */
public void process(FormSectionEvent fse) { public void process(FormSectionEvent fse) {
FormData data = fse.getFormData(); FormData data = fse.getFormData();

View File

@ -23,29 +23,31 @@ import com.arsdigita.cms.ui.authoring.AuthoringKitWizard;
import com.arsdigita.cms.ui.authoring.BasicItemForm; import com.arsdigita.cms.ui.authoring.BasicItemForm;
import com.arsdigita.cms.ui.authoring.SimpleEditStep; import com.arsdigita.cms.ui.authoring.SimpleEditStep;
import com.arsdigita.cms.ui.workflow.WorkflowLockedComponentAccess; import com.arsdigita.cms.ui.workflow.WorkflowLockedComponentAccess;
import com.arsdigita.london.contenttypes.util.ContactGlobalizationUtil;
/** /**
* A UI step to manipulate <code>Phones </code> for the Contact object * A UI step to manipulate <code>Phones </code> for the Contact object which is
* which is retrieved from the ItemSelectionModel. * retrieved from the ItemSelectionModel.
*
* @author Shashin Shinde <a href="mailto:sshinde@redhat.com">sshinde@redhat.com</a>
* *
* @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 $ * @version $Id: ContactPhonesPanel.java 287 2005-02-22 00:29:02Z sskracic $
*
*/ */
public class ContactPhonesPanel extends SimpleEditStep { 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"; private static String EDIT_SHEET_NAME = "manage-phones";
public ContactPhonesPanel(ItemSelectionModel itemModel, AuthoringKitWizard parent) { public ContactPhonesPanel(ItemSelectionModel itemModel,
AuthoringKitWizard parent) {
super(itemModel, parent); super(itemModel, parent);
BasicItemForm form = new ContactCreatePhone(itemModel); BasicItemForm form = new ContactCreatePhone(itemModel);
add(EDIT_SHEET_NAME,
add( ContactGlobalizationUtil.globalize(
EDIT_SHEET_NAME, "london.contenttypes.ui.contact.add_phone_button"),
"Add Phone",
new WorkflowLockedComponentAccess(form, itemModel), new WorkflowLockedComponentAccess(form, itemModel),
form.getSaveCancelSection().getCancelButton()); form.getSaveCancelSection().getCancelButton());
@ -53,5 +55,4 @@ public class ContactPhonesPanel extends SimpleEditStep {
setDisplayComponent(phTable); setDisplayComponent(phTable);
} }
} }

View File

@ -30,66 +30,100 @@ import com.arsdigita.bebop.table.TableColumn;
import com.arsdigita.bebop.table.TableColumnModel; import com.arsdigita.bebop.table.TableColumnModel;
import com.arsdigita.bebop.table.TableModel; import com.arsdigita.bebop.table.TableModel;
import com.arsdigita.bebop.table.TableModelBuilder; import com.arsdigita.bebop.table.TableModelBuilder;
import com.arsdigita.cms.CMS;
import com.arsdigita.cms.ItemSelectionModel; import com.arsdigita.cms.ItemSelectionModel;
import com.arsdigita.cms.SecurityManager; import com.arsdigita.cms.SecurityManager;
import com.arsdigita.london.contenttypes.Contact; import com.arsdigita.london.contenttypes.Contact;
import com.arsdigita.london.contenttypes.ContactPhone; import com.arsdigita.london.contenttypes.ContactPhone;
import com.arsdigita.london.contenttypes.ContactPhonesCollection; 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 com.arsdigita.util.LockableImpl;
import org.apache.log4j.Logger;
import java.math.BigDecimal; import java.math.BigDecimal;
/** /**
* A Table to display the Phones associated with the Contact object. * A Table to display the Phones associated with the Contact object. Provides
* Provides links to delete the corresponding phone in each row. * links to delete the corresponding phone in each row.
* *
* @author Shashin Shinde <a href="mailto:sshinde@redhat.com">sshinde@redhat.com</a> * @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 $ * @version $Id: ContactPhonesTable.java 287 2005-02-22 00:29:02Z sskracic $
*
*/ */
class ContactPhonesTable extends Table implements TableActionListener { 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"; // match columns by (symbolic) index, makes for easier reordering
private static final String COL_PHONE_NUM="Phone Number"; private static final int COL_INDEX_PHONE_TYPE = 0; //"Phone Type";
private static final String COL_DELETE ="Delete"; 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. * Constructor. Create an instance of this class.
* *
* @param selContact , ItemSelectionModel which provides the * @param selContact ItemSelectionModel which provides the
* <code>Contact</code> object whose Phones are to be manipulated. * <code>Contact</code> object whose Phones are to be
* manipulated.
*/ */
public ContactPhonesTable(ItemSelectionModel selContact) { 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(); TableColumnModel model = getColumnModel();
model.add( new TableColumn( 0, COL_PHONE_TYPE )); model.add(new TableColumn(
model.add( new TableColumn( 1, COL_PHONE_NUM )); COL_INDEX_PHONE_TYPE,
model.add( new TableColumn( 2, COL_DELETE )); new Label(ContactGlobalizationUtil.globalize(
"london.contenttypes.ui.contact.phonetable.header_type")
setModelBuilder(new PhonesTableModelBuilder(selContact)); ) ));
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()); model.get(2).setCellRenderer(new DeleteCellRenderer());
setModelBuilder(new PhonesTableModelBuilder(selContact));
addTableActionListener(this); addTableActionListener(this);
} }
private class PhonesTableModelBuilder extends LockableImpl implements TableModelBuilder { /**
*
*/
private class PhonesTableModelBuilder extends LockableImpl
implements TableModelBuilder {
private ItemSelectionModel m_sel; private ItemSelectionModel m_sel;
/**
* Private class constructor
* @param sel
*/
private PhonesTableModelBuilder(ItemSelectionModel sel) { private PhonesTableModelBuilder(ItemSelectionModel sel) {
m_sel = sel; m_sel = sel;
} }
/**
*
* @param table
* @param state
* @return
*/
public TableModel makeModel(Table table, PageState state) { public TableModel makeModel(Table table, PageState state) {
table.getRowSelectionModel().clearSelection(state); table.getRowSelectionModel().clearSelection(state);
@ -99,24 +133,34 @@ class ContactPhonesTable extends Table implements TableActionListener{
} }
} }
/**
* Internal private class.
*/
private class PhonesTableModel implements TableModel { private class PhonesTableModel implements TableModel {
private Table m_table; private Table m_table;
private ContactPhonesCollection m_phones; private ContactPhonesCollection m_phones;
private ContactPhone m_phone; private ContactPhone m_phone;
/**
* Private class constructor.
* @param t
* @param ps
* @param c
*/
private PhonesTableModel(Table t, PageState ps, Contact c) { private PhonesTableModel(Table t, PageState ps, Contact c) {
m_table = t; m_table = t;
m_phones = c.getPhones(); m_phones = c.getPhones();
} }
/** Return the number of columsn this TableModel has. */
public int getColumnCount() { public int getColumnCount() {
return m_table.getColumnModel().size(); return m_table.getColumnModel().size();
} }
/** /**
* check collection for the existence of another row.If it has fetch the * check collection for the existence of another row. If it has fetch
* value of Current Phone object into m_phone class variable. * the value of Current Phone object into m_phone class variable.
*/ */
public boolean nextRow() { public boolean nextRow() {
if (m_phones != null && m_phones.next()) { 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 * Return the phoneType and phoneNumber attributes for the Type and
* Number columns respectively. * Number columns respectively.
*
* @see com.arsdigita.bebop.table.TableModel#getElementAt(int) * @see com.arsdigita.bebop.table.TableModel#getElementAt(int)
*/ */
public Object getElementAt(int columnIndex) { public Object getElementAt(int columnIndex) {
switch (columnIndex) { switch (columnIndex) {
case 0: case 0:
return m_phone.getPhoneType(); return m_phone.getPhoneType();
case 1: case 1:
return m_phone.getPhoneNumber(); return m_phone.getPhoneNumber();
case 2: case 2:
return "Delete"; // return "Delete";
return new Label(
ContactGlobalizationUtil.globalize(
"london.contenttypes.ui.contact.phonetable.link_delete")
);
default: default:
return null; 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) * @see com.arsdigita.bebop.table.TableModel#getKeyAt(int)
*/ */
public Object getKeyAt(int columnIndex) { public Object getKeyAt(int columnIndex) {
return m_phone.getID(); return m_phone.getID();
} }
} }
/** /**
* Check for the permissions to delete item and put either a Lable or * Private class to check for the permissions to delete item and put either
* a ControlLink accordingly. * 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); /* Check for permission to delete item */
Contact item = (Contact) m_contactSel.getSelectedObject(state);
boolean canDelete = sm.canAccess(state.getRequest(), boolean canDelete = sm.canAccess(state.getRequest(),
SecurityManager.DELETE_ITEM, SecurityManager.DELETE_ITEM,
item); item);
if ( value instanceof Label ) { // just the delete Controllink
if (canDelete) { if (canDelete) {
ControlLink link = new ControlLink(value.toString()); ret = new ControlLink((Component)value);
link.setConfirmation("Delete this Phone ?"); // ret.setConfirmation(ContactGlobalizationUtil.globalize(
return link; // "london.contenttypes.ui.contact.phonetable.confirm_delete"));
} else { } 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. * Provide implementation to TableActionListener method. Code that comes
* Code that comes into picture when a link on the table is clicked. * into picture when a link on the table is clicked. Handles delete event.
* Handles delete event.
*/ */
public void cellSelected(TableActionEvent evt) { public void cellSelected(TableActionEvent evt) {
PageState state = evt.getPageState(); PageState state = evt.getPageState();
TableColumn col = getColumnModel().get(evt.getColumn().intValue()); 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()); 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); ContactPhone ph = new ContactPhone(phoneID);
contact.removePhone(ph); contact.removePhone(ph);
} }
} }
/** /**
* provide Implementation to TableActionListener method. * provide Implementation to TableActionListener method. Does nothing in our
* Does nothing in our case. * case.
*/ */
public void headSelected(TableActionEvent e) { public void headSelected(TableActionEvent e) {
throw new UnsupportedOperationException("Not Implemented"); throw new UnsupportedOperationException("Not Implemented");

View File

@ -20,14 +20,14 @@ package com.arsdigita.london.contenttypes.ui;
import com.arsdigita.bebop.Component; import com.arsdigita.bebop.Component;
import com.arsdigita.cms.ItemSelectionModel; 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.AuthoringKitWizard;
import com.arsdigita.cms.ui.authoring.BasicPageForm; import com.arsdigita.cms.ui.authoring.BasicPageForm;
import com.arsdigita.cms.ui.authoring.SimpleEditStep; import com.arsdigita.cms.ui.authoring.SimpleEditStep;
import com.arsdigita.cms.ui.workflow.WorkflowLockedComponentAccess; import com.arsdigita.cms.ui.workflow.WorkflowLockedComponentAccess;
import com.arsdigita.cms.util.GlobalizationUtil; import com.arsdigita.cms.util.GlobalizationUtil;
import com.arsdigita.domain.DomainObject; 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.toolbox.ui.DomainObjectPropertySheet;
import com.arsdigita.bebop.PageState; import com.arsdigita.bebop.PageState;
@ -51,9 +51,8 @@ public class ContactPropertiesStep extends SimpleEditStep {
BasicPageForm editSheet; BasicPageForm editSheet;
editSheet = new ContactPropertyForm(itemModel); editSheet = new ContactPropertyForm(itemModel);
add( add(EDIT_SHEET_NAME,
EDIT_SHEET_NAME, GlobalizationUtil.globalize("cms.ui.edit"),
"Edit",
new WorkflowLockedComponentAccess(editSheet, itemModel), new WorkflowLockedComponentAccess(editSheet, itemModel),
editSheet.getSaveCancelSection().getCancelButton()); editSheet.getSaveCancelSection().getCancelButton());
@ -71,61 +70,59 @@ public class ContactPropertiesStep extends SimpleEditStep {
public static Component getContactPropertySheet(ItemSelectionModel itemModel) { public static Component getContactPropertySheet(ItemSelectionModel itemModel) {
DomainObjectPropertySheet sheet = new DomainObjectPropertySheet(itemModel); DomainObjectPropertySheet sheet = new DomainObjectPropertySheet(itemModel);
sheet.add( sheet.add(GlobalizationUtil.globalize("cms.contenttypes.ui.title"),
GlobalizationUtil.globalize("com.arsdigita.london.contenttypes.ui.title"),
Contact.TITLE); Contact.TITLE);
sheet.add( sheet.add(GlobalizationUtil.globalize("cms.contenttypes.ui.name"),
GlobalizationUtil.globalize("com.arsdigita.london.contenttypes.ui.name"),
Contact.NAME); Contact.NAME);
sheet.add( sheet.add(ContactGlobalizationUtil.globalize(
ContactGlobalizationUtil.globalize( "london.contenttypes.ui.contact.givenname"),
"com.arsdigita.london.contenttypes.ui.contact_givenname"),
Contact.GIVEN_NAME); Contact.GIVEN_NAME);
sheet.add( sheet.add(ContactGlobalizationUtil.globalize(
ContactGlobalizationUtil.globalize( "london.contenttypes.ui.contact.familyname"),
"com.arsdigita.london.contenttypes.ui.contact_familyname"),
Contact.FAMILY_NAME); Contact.FAMILY_NAME);
sheet.add( sheet.add(ContactGlobalizationUtil.globalize(
ContactGlobalizationUtil.globalize("cms.contenttypes.ui.contact_type"), "london.contenttypes.ui.contact.suffix"),
Contact.SUFFIX);
sheet.add(ContactGlobalizationUtil.globalize(
"london.contenttypes.ui.contact.type"),
Contact.CONTACT_TYPE, Contact.CONTACT_TYPE,
new DomainObjectPropertySheet.AttributeFormatter() { 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; Contact contact = (Contact) item;
if (contact.getContactType() != null) { if (contact.getContactType() != null) {
return contact.getContactTypeName(); return contact.getContactTypeName();
} else { } else {
return "unknown"; return (String) GlobalizationUtil
.globalize("cms.ui.unknown")
.localize();
} }
} }
}); });
sheet.add( sheet.add(GlobalizationUtil.globalize("cms.contenttypes.ui.description"),
GlobalizationUtil.globalize("com.arsdigita.london.contenttypes.ui.description"),
Contact.DESCRIPTION); Contact.DESCRIPTION);
sheet.add( sheet.add(ContactGlobalizationUtil.globalize(
ContactGlobalizationUtil.globalize("com.arsdigita.london.contenttypes.ui.contact_emails"), "london.contenttypes.ui.contact.emails"),
Contact.EMAILS); Contact.EMAILS);
sheet.add( sheet.add(ContactGlobalizationUtil.globalize(
ContactGlobalizationUtil.globalize("com.arsdigita.london.contenttypes.ui.contact_suffix"), "london.contenttypes.ui.contact.orgname"),
Contact.SUFFIX);
sheet.add(
ContactGlobalizationUtil.globalize("com.arsdigita.london.contenttypes.ui.contact_orgname"),
Contact.ORG_NAME); Contact.ORG_NAME);
sheet.add( sheet.add(ContactGlobalizationUtil.globalize(
ContactGlobalizationUtil.globalize( "london.contenttypes.ui.contact.deptname"),
"com.arsdigita.london.contenttypes.ui.contact_deptname"),
Contact.DEPT_NAME); Contact.DEPT_NAME);
sheet.add( sheet.add(ContactGlobalizationUtil.globalize(
ContactGlobalizationUtil.globalize("com.arsdigita.london.contenttypes.ui.contact_role"), "london.contenttypes.ui.contact.role"),
Contact.ROLE); Contact.ROLE);
return sheet; return sheet;

View File

@ -35,6 +35,7 @@ import com.arsdigita.london.contenttypes.ContactType;
import com.arsdigita.london.contenttypes.ContactTypesCollection; import com.arsdigita.london.contenttypes.ContactTypesCollection;
import com.arsdigita.london.contenttypes.util.ContactGlobalizationUtil; import com.arsdigita.london.contenttypes.util.ContactGlobalizationUtil;
import com.arsdigita.cms.ui.authoring.BasicPageForm; 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 * Form to edit basic properties of <code>Contact</code> object. Used by
@ -81,32 +82,32 @@ public class ContactPropertyForm extends BasicPageForm {
} }
protected void addGivenNameWidget() { protected void addGivenNameWidget() {
add(new Label(ContactGlobalizationUtil add(new Label(ContactGlobalizationUtil.globalize(
.globalize("com.arsdigita.london.contenttypes.ui.contact_givenname"))); "london.contenttypes.ui.contact.givenname")));
ParameterModel givenNameParam = new StringParameter(Contact.GIVEN_NAME); ParameterModel givenNameParam = new StringParameter(Contact.GIVEN_NAME);
TextField givenName = new TextField(givenNameParam); TextField givenName = new TextField(givenNameParam);
add(givenName); add(givenName);
} }
protected void addFamilyNameWidget() { protected void addFamilyNameWidget() {
add(new Label(ContactGlobalizationUtil add(new Label(ContactGlobalizationUtil.globalize(
.globalize("com.arsdigita.london.contenttypes.ui.contact_familyname"))); "london.contenttypes.ui.contact.familyname")));
ParameterModel familyNameParam = new StringParameter(Contact.FAMILY_NAME); ParameterModel familyNameParam = new StringParameter(Contact.FAMILY_NAME);
TextField familyName = new TextField(familyNameParam); TextField familyName = new TextField(familyNameParam);
add(familyName); add(familyName);
} }
protected void addSuffixWidget() { protected void addSuffixWidget() {
add(new Label(ContactGlobalizationUtil add(new Label(ContactGlobalizationUtil.globalize(
.globalize("com.arsdigita.london.contenttypes.ui.contact_suffix"))); "london.contenttypes.ui.contact.suffix")));
ParameterModel suffixParam = new StringParameter(Contact.SUFFIX); ParameterModel suffixParam = new StringParameter(Contact.SUFFIX);
TextField suffix = new TextField(suffixParam); TextField suffix = new TextField(suffixParam);
add(suffix); add(suffix);
} }
protected void addContactTypeWidget() { protected void addContactTypeWidget() {
add(new Label(ContactGlobalizationUtil add(new Label(ContactGlobalizationUtil.globalize(
.globalize("com.arsdigita.london.contenttypes.ui.contact_type"))); "london.contenttypes.ui.contact.type")));
ParameterModel contactTypeParam = new StringParameter(Contact.CONTACT_TYPE); ParameterModel contactTypeParam = new StringParameter(Contact.CONTACT_TYPE);
SingleSelect contactType = new SingleSelect(contactTypeParam); SingleSelect contactType = new SingleSelect(contactTypeParam);
add(contactType); add(contactType);
@ -118,8 +119,8 @@ public class ContactPropertyForm extends BasicPageForm {
} }
protected void addDescriptionWidget() { protected void addDescriptionWidget() {
add(new Label(ContactGlobalizationUtil add(new Label(GlobalizationUtil.globalize(
.globalize("com.arsdigita.london.contenttypes.ui.contact_description"))); "cms.contenttypes.ui.description")));
ParameterModel descParam = new StringParameter(Contact.DESCRIPTION); ParameterModel descParam = new StringParameter(Contact.DESCRIPTION);
TextArea desc = new TextArea(descParam); TextArea desc = new TextArea(descParam);
desc.setRows(5); desc.setRows(5);
@ -128,7 +129,7 @@ public class ContactPropertyForm extends BasicPageForm {
protected void addEmailsWidget() { protected void addEmailsWidget() {
add(new Label(ContactGlobalizationUtil add(new Label(ContactGlobalizationUtil
.globalize("com.arsdigita.london.contenttypes.ui.contact_emails"))); .globalize("london.contenttypes.ui.contact.emails")));
ParameterModel emailsParam = new StringParameter(Contact.EMAILS); ParameterModel emailsParam = new StringParameter(Contact.EMAILS);
TextField emails = new TextField(emailsParam); TextField emails = new TextField(emailsParam);
add(emails); add(emails);
@ -136,7 +137,7 @@ public class ContactPropertyForm extends BasicPageForm {
protected void addOrganizationNameWidget() { protected void addOrganizationNameWidget() {
add(new Label(ContactGlobalizationUtil 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); ParameterModel orgNameParam = new StringParameter(Contact.ORG_NAME);
TextField orgName = new TextField(orgNameParam); TextField orgName = new TextField(orgNameParam);
add(orgName); add(orgName);
@ -144,7 +145,7 @@ public class ContactPropertyForm extends BasicPageForm {
protected void addDepartmentNameWidget() { protected void addDepartmentNameWidget() {
add(new Label(ContactGlobalizationUtil 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); ParameterModel deptParam = new StringParameter(Contact.DEPT_NAME);
TextField deptName = new TextField(deptParam); TextField deptName = new TextField(deptParam);
add(deptName); add(deptName);
@ -152,7 +153,7 @@ public class ContactPropertyForm extends BasicPageForm {
protected void addRoleWidget() { protected void addRoleWidget() {
add(new Label(ContactGlobalizationUtil add(new Label(ContactGlobalizationUtil
.globalize("com.arsdigita.london.contenttypes.ui.contact_role"))); .globalize("london.contenttypes.ui.contact.role")));
ParameterModel roleParam = new StringParameter(Contact.ROLE); ParameterModel roleParam = new StringParameter(Contact.ROLE);
TextField role = new TextField(roleParam); TextField role = new TextField(roleParam);
add(role); add(role);