Base Address, BaseContact

Lokalisierung vervollständigt

Noch vorhandene Fehler:

 * Es fehlt zur Zeit noch eine Möglichkeit, die ActionLinks dem aktuelle Zustand der Verknüpfung anzupassen. Es soll eigentlich nur "Attach" angezeigt werden, wenn kein CT verknüpft ist. Sonst sollen "Change", "Edit" und "Delete" angezeigt werden.

 * Aus einem mir noch nicht nachvollziehbaren Grund schließt sich das ItemSerachWidget nicht automatisch nach der Auswahl eines CTs

 * Der Versuch, ein nicht verknüpften CT zu editieren endet in einer Exception. Das Problem löst sich, sobald eine Möglichkeit zum bedarfsgerechten Ändern der Links gefunden wurde.

 * Bei nichtverknüpften CTs soll eigentlich nur angezeigt werden, daß keine Verknüpfung vorhanden ist. Das Problem löst sich, sobald eine Möglichkeit zum bedarfsgerechten Ändern der Links gefunden wurde.


git-svn-id: https://svn.libreccm.org/ccm/trunk@217 8810af33-2d31-482b-a856-94f89814c4df
master
quasi 2009-07-21 10:29:01 +00:00
parent 4bad58d14b
commit c3d0b15777
23 changed files with 347 additions and 110 deletions

View File

@ -1,7 +1,7 @@
cms.contenttypes.ui.baseAddress.address=Adresse
cms.contenttypes.ui.baseAddress.address=Anschrift
cms.contenttypes.ui.baseAddress.postal_code=Postleitzahl
cms.contenttypes.ui.baseAddress.city=Stadt
cms.contenttypes.ui.baseAddress.state=Bundesland
cms.contenttypes.ui.baseAddress.iso_country_code=Land
cms.contenttypes.ui.baseAddress.error_iso_country=Bitte wählen Sie ein Land aus
baseAddress.authoring.basic_properties.title=Eigenschaften
baseAddress.authoring.basic_properties.title=Eigenschaften von Adresse

View File

@ -14,10 +14,10 @@
createComponent="com.arsdigita.cms.ui.authoring.PageCreate">
<ctd:authoring-step
labelKey="baseContact.authoring.basic_properties.title"
labelBundle="com.arsdigita.cms.contenttypes.BaseContactResources"
descriptionKey="baseContact.authoring.basic_properties.description"
descriptionBundle="com.arsdigita.cms.contenttypes.BaseContactResources"
labelKey="cms.contenttypes.shared.basic_properties.title"
labelBundle="com.arsdigita.cms.ui.CMSResources"
descriptionKey="cms.contenttypes.shared.basic_properties.description"
descriptionBundle="com.arsdigita.cms.ui.CMSResources"
component="com.arsdigita.cms.contenttypes.ui.BaseContactPropertiesStep"
ordering="1"/>

View File

@ -37,6 +37,7 @@
<xrd:property name="/object/contactentries/name"/>
<xrd:property name="/object/contactentries/language"/>
<xrd:property name="/object/contactentries/isDeleted"/>
<xrd:property name="/object/contactentries/description"/>
</xrd:attributes>
<xrd:associations rule="include">
<xrd:property name="/object/person"/>

View File

@ -44,7 +44,10 @@ public class BaseContact extends ContentPage {
public static final String CONTACT_ENTRIES = "contactentries";
// Config
private static BaseContactConfig s_config = new BaseContactConfig();
private static final BaseContactConfig s_config = new BaseContactConfig();
static {
s_config.load();
}
/** Data object type for tihs domain object */
public static final String BASE_DATA_OBJECT_TYPE
@ -81,7 +84,7 @@ public class BaseContact extends ContentPage {
/**
* Retrieves the current configuration
*/
public static BaseContactConfig getConfig() {
public static final BaseContactConfig getConfig() {
return s_config;
}

View File

@ -0,0 +1,149 @@
package com.arsdigita.cms.contenttypes;
import com.arsdigita.runtime.AbstractConfig;
import com.arsdigita.util.parameter.Parameter;
import com.arsdigita.util.parameter.BooleanParameter;
import com.arsdigita.util.parameter.StringParameter;
import java.util.StringTokenizer;
import org.apache.log4j.Logger;
/**
* Stores the configuration record for the baseContact.
*
* @author Sören Bernstein (quasimodo) quasi@zes.uni-bremen.de
*/
public final class BaseContactConfig extends AbstractConfig {
private static Logger s_log = Logger.getLogger(BaseContactConfig.class);
private final Parameter m_hidePerson;
private final Parameter m_hideAddress;
private final Parameter m_hideAddressPostalCode;
private final Parameter m_hideAddressState;
private final Parameter m_hideAddressCountry;
private final Parameter m_contactEntryKeys;
/**
* Public Constructor
*/
public BaseContactConfig() {
/**
* If set to true disables the possibility to attach a person ct
*/
m_hidePerson = new BooleanParameter
("com.arsdigita.cms.contenttypes.baseContact.hide_person",
Parameter.REQUIRED,
new Boolean(false));
/**
* If set to true disables the possibility to attach a baseAddress ct
*/
m_hideAddress = new BooleanParameter
("com.arsdigita.cms.contenttypes.baseContact.hide_address",
Parameter.REQUIRED,
new Boolean(false));
/**
* If set to true hides the postal code entry field for the attached address ct
*/
m_hideAddressPostalCode = new BooleanParameter
("com.arsdigita.cms.contenttypes.baseContact.address.hide_postal_code",
Parameter.REQUIRED,
new Boolean(false));
/**
* If set to true hides the state entry field for the attached address ct
*/
m_hideAddressState = new BooleanParameter
("com.arsdigita.cms.contenttypes.baseContact.address.hide_state",
Parameter.REQUIRED,
new Boolean(false));
/**
* If set to true hides the country selection for the attaches address ct
*/
m_hideAddressCountry = new BooleanParameter
("com.arsdigita.cms.contenttypes.baseContact.address.hide_country",
Parameter.REQUIRED,
new Boolean(false));
/**
*/
m_contactEntryKeys = new StringParameter
("com.arsdigita.cms.contenttypes.baseContact.contact_entry_keys",
Parameter.REQUIRED,
"contact_type,office_hours,phone_office,phone_private,phone_mobile,email,fax,im,www");
register(m_hidePerson);
register(m_hideAddress);
register(m_hideAddressPostalCode);
register(m_hideAddressState);
register(m_hideAddressCountry);
register(m_contactEntryKeys);
loadInfo();
}
/**
*/
public final boolean getHidePerson() {
return ((Boolean) get(m_hidePerson)).booleanValue();
}
/**
*/
public final boolean getHideAddress() {
return ((Boolean) get(m_hideAddress)).booleanValue();
}
/**
*/
public final boolean getHideAddressPostalCode() {
return ((Boolean) get(m_hideAddressPostalCode)).booleanValue();
}
/**
*/
public final boolean getHideAddressState() {
return ((Boolean) get(m_hideAddressState)).booleanValue();
}
/**
*/
public final boolean getHideAddressCountry() {
return ((Boolean) get(m_hideAddressCountry)).booleanValue();
}
/**
* Returns the contactEntryKeys as StringTokenizer.
*/
public final StringTokenizer getContactEntryKeys() {
return new StringTokenizer((((String) get(m_contactEntryKeys)).replace(" ","")), ",", false);
}
/**
* Return true, if language lang is part of supported langs
*/
public final boolean hasKey(String key) {
return ((String) get(m_contactEntryKeys)).contains(key);
}
/**
* Return the index value for given key
*/
public final int getKeyIndex(String key) {
int index = -1;
if(hasKey(key)) {
StringTokenizer keys = getContactEntryKeys();
while(keys.hasMoreElements()) {
index++;
if(keys.nextToken().equals(key)) break;
}
}
return index;
}
}

View File

@ -0,0 +1,29 @@
com.arsdigita.cms.contenttypes.baseContact.hide_person.title=Hide person attachment
com.arsdigita.cms.contenttypes.baseContact.hide_person.purpose=Hide the part to attach a person CT
com.arsdigita.cms.contenttypes.baseContact.hide_person.example=false
com.arsdigita.cms.contenttypes.baseContact.hide_person.format=[boolean]
com.arsdigita.cms.contenttypes.baseContact.hide_address.title=Hide address attachment
com.arsdigita.cms.contenttypes.baseContact.hide_address.purpose=Hide the part to attach a baseAddress CT
com.arsdigita.cms.contenttypes.baseContact.hide_address.example=false
com.arsdigita.cms.contenttypes.baseContact.hide_address.format=[boolean]
com.arsdigita.cms.contenttypes.baseContact.address.hide_postal_code.title=Hide postal code for attached adress
com.arsdigita.cms.contenttypes.baseContact.address.hide_postal_code.purpose=Hide the postal code entry field for the attached baseAddress
com.arsdigita.cms.contenttypes.baseContact.address.hide_postal_code.example=false
com.arsdigita.cms.contenttypes.baseContact.address.hide_postal_code.format=[boolean]
com.arsdigita.cms.contenttypes.baseContact.address.hide_state.title=Hide state for attached adress
com.arsdigita.cms.contenttypes.baseContact.address.hide_state.purpose=Hide the state entry field for the attached baseAddress
com.arsdigita.cms.contenttypes.baseContact.address.hide_state.example=false
com.arsdigita.cms.contenttypes.baseContact.address.hide_state.format=[boolean]
com.arsdigita.cms.contenttypes.baseContact.address.hide_country.title=Hide country for attached address
com.arsdigita.cms.contenttypes.baseContact.address.hide_country.purpose=Hide the country selection box for the attached baseAddress
com.arsdigita.cms.contenttypes.baseContact.address.hide_country.example=false
com.arsdigita.cms.contenttypes.baseContact.address.hide_country.format=[boolean]
com.arsdigita.cms.contenttypes.baseContact.contact_entry_keys.title=Select available contact entry types
com.arsdigita.cms.contenttypes.baseContact.contact_entry_keys.purpose=Select available contact entry types and define display order
com.arsdigita.cms.contenttypes.baseContact.contact_entry_keys.example=contact_type,office_hours,phone_office,phone_private,phone_mobile,email,fax,im,www
com.arsdigita.cms.contenttypes.baseContact.contact_entry_keys.format=[string]

View File

@ -10,7 +10,6 @@ package com.arsdigita.cms.contenttypes;
import com.arsdigita.domain.DomainCollection;
import com.arsdigita.persistence.DataCollection;
import com.arsdigita.persistence.DataObject;
/**
@ -23,7 +22,7 @@ public class BaseContactEntryCollection extends DomainCollection {
* Creates a new instance of BaseContactEntryCollection
*/
public BaseContactEntryCollection(BaseContact baseContact) {
super((DataCollection) baseContact.getContactEntries());
this((DataCollection) baseContact.getContactEntries());
}
public BaseContactEntryCollection(DataCollection dataCollection) {
@ -43,7 +42,7 @@ public class BaseContactEntryCollection extends DomainCollection {
}
public BaseContactEntry getBaseContactEntry() {
return new BaseContactEntry(m_dataCollection.getDataObject());
return new BaseContactEntry(m_dataCollection.getDataObject());
}
}

View File

@ -1,30 +1,11 @@
/*
* Copyright (C) 2003-2004 Red Hat Inc. All Rights Reserved.
*
* This library is free software; you can redistribute it and/or
* modify it under the terms of the GNU Lesser General Public License
* as published by the Free Software Foundation; either version 2.1 of
* the License, or (at your option) any later version.
*
* This library is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
* Lesser General Public License for more details.
*
* You should have received a copy of the GNU Lesser General Public
* License along with this library; if not, write to the Free Software
* Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
*
*/
package com.arsdigita.cms.contenttypes;
import org.apache.log4j.Logger;
/**
* The CMS initializer.
*
* @author Justin Ross &lt;jross@redhat.com&gt;
* @version $Id: OrganizationInitializer.java 757 2005-09-02 14:12:21Z sskracic $
* @author Sören Bernstein;
*/
public class BaseContactInitializer extends ContentTypeInitializer {
public final static String versionId =

View File

@ -1,21 +1,4 @@
/*
* Copyright (C) 2003-2004 Red Hat Inc. All Rights Reserved.
*
* This library is free software; you can redistribute it and/or
* modify it under the terms of the GNU Lesser General Public License
* as published by the Free Software Foundation; either version 2.1 of
* the License, or (at your option) any later version.
*
* This library is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
* Lesser General Public License for more details.
*
* You should have received a copy of the GNU Lesser General Public
* License along with this library; if not, write to the Free Software
* Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
*
*/
package com.arsdigita.cms.contenttypes;
import com.arsdigita.cms.contenttypes.AbstractContentTypeLoader;
@ -24,8 +7,7 @@ import com.arsdigita.cms.contenttypes.AbstractContentTypeLoader;
/**
* Loader.
*
* @author Justin Ross &lt;jross@redhat.com&gt;
* @version $Id: OrganizationLoader.java 287 2005-02-22 00:29:02Z sskracic $
* @author Sören Bernstein
*/
public class BaseContactLoader extends AbstractContentTypeLoader {
public final static String versionId =

View File

@ -1,2 +1,50 @@
cms.contenttypes.ui.baseContact.basic_properties=Basic Properties
cms.contenttypes.ui.baseContact.edit_basic_properties=Edit Basic Properties
cms.contenttypes.ui.baseContact.edit_basic_properties.description=Description
cms.contenttypes.ui.baseContact.confirm_delete=Sure?
cms.contenttypes.ui.baseContact.person=Person
cms.contenttypes.ui.baseContact.address=Address
cms.contenttypes.ui.baseContact.attach_address=Attach Address
cms.contenttypes.ui.baseContact.edit_address=Edit Address
cms.contenttypes.ui.baseContact.reattach_address=Reattach Address
cms.contenttypes.ui.baseContact.delete_address=Delete Address
cms.contenttypes.ui.baseContact.emptyAddress=There is no Address attached
cms.contenttypes.ui.baseContact.select_address=Please select a baseContact content type
cms.contenttypes.ui.baseContact.select_address.add=Add
cms.contenttypes.ui.baseContact.select_address.change=Change
cms.contenttypes.ui.baseContact.select_address.wrong_type=BaseAddress selection is required
cms.contenttypes.ui.baseContact.select_address.cancelled=cancelled
cms.contenttypes.ui.baseContact.delete_address.label=Do you want to delete the link to the baseContact content type?
cms.contenttypes.ui.baseContact.delete_address.button_label=Delete
cms.contenttypes.ui.baseContact.attach_person=Attach Person
cms.contenttypes.ui.baseContact.edit_person=Edit Person
cms.contenttypes.ui.baseContact.reattach_person=Reattach Person
cms.contenttypes.ui.baseContact.delete_person=Delete Person
cms.contenttypes.ui.baseContact.emptyPerson=There is no Address attached
cms.contenttypes.ui.baseContact.select_person=Please select a Person content type
cms.contenttypes.ui.baseContact.select_person.add=Add
cms.contenttypes.ui.baseContact.select_person.change=Change
cms.contenttypes.ui.baseContact.select_person.wrong_type=Person selection is required
cms.contenttypes.ui.baseContact.select_person.cancelled=cancelled
cms.contenttypes.ui.baseContact.delete_person.label=Do you want to delete the link to the Person content type?
cms.contenttypes.ui.baseContact.delete_person.button_label=Delete
cms.contenttypes.ui.baseContact.add_contactEntry=Add Contact Entry
cms.contenttypes.ui.baseContact.contactEntry=Contact Entries
cms.contenttypes.ui.baseContact.contactEntry.key=Type
cms.contenttypes.ui.baseContact.contactEntry.value=Value
cms.contenttypes.ui.baseContact.contactEntry.description=Description (internal use only)
cms.contenttypes.ui.baseContact.contactEntry.action=Action
cms.contenttypes.ui.baseContact.contactEntry.key.contact_type=Type of Contact
cms.contenttypes.ui.baseContact.contactEntry.key.office_hours=Office Hours
cms.contenttypes.ui.baseContact.contactEntry.key.phone_office=Phone (office)
cms.contenttypes.ui.baseContact.contactEntry.key.phone_private=Phone (private)
cms.contenttypes.ui.baseContact.contactEntry.key.phone_mobile=Phone (mobile)
cms.contenttypes.ui.baseContact.contactEntry.key.email=eMail
cms.contenttypes.ui.baseContact.contactEntry.key.fax=Fax
cms.contenttypes.ui.baseContact.contactEntry.key.im=Instant Messenger
cms.contenttypes.ui.baseContact.contactEntry.key.www=Homepage

View File

@ -0,0 +1,52 @@
cms.contenttypes.ui.baseContact.basic_properties=Eigenschaften von Contact
cms.contenttypes.ui.baseContact.edit_basic_properties=Bearbeiten
cms.contenttypes.ui.baseContact.edit_basic_properties.description=Description
cms.contenttypes.ui.baseContact.confirm_delete=Sind Sie sicher?
cms.contenttypes.ui.baseContact.person=Person
cms.contenttypes.ui.baseContact.address=Adresse
cms.contenttypes.ui.baseContact.attach_address=Adresse verknüpfen
cms.contenttypes.ui.baseContact.edit_address=Adresse bearbeiten
cms.contenttypes.ui.baseContact.reattach_address=Adresse neu verknüpfen
cms.contenttypes.ui.baseContact.delete_address=Adresse löschen
cms.contenttypes.ui.baseContact.emptyAddress=Zur Zeit ist keine Adresse verknüpft
cms.contenttypes.ui.baseContact.select_address=Bitte wählen Sie eine Eintrag vom Typ BaseAddress
cms.contenttypes.ui.baseContact.select_address.add=Verknüpfen
cms.contenttypes.ui.baseContact.select_address.change=Verändern
cms.contenttypes.ui.baseContact.select_address.wrong_type=Der gewählte Eintrag ist nicht vom Typ BaseAddress
cms.contenttypes.ui.baseContact.select_address.cancelled=Abbruch
cms.contenttypes.ui.baseContact.delete_address.label=Wollen Sie die Verknüpfung zur Adresse entfernen?
cms.contenttypes.ui.baseContact.delete_address.button_label=Löschen
cms.contenttypes.ui.baseContact.attach_person=Person verknüpfen
cms.contenttypes.ui.baseContact.edit_person=Person bearbeiten
cms.contenttypes.ui.baseContact.reattach_person=Person neu verknüpfen
cms.contenttypes.ui.baseContact.delete_person=Person löschen
cms.contenttypes.ui.baseContact.emptyPerson=Zur Zeit ist keine Person verknüft
cms.contenttypes.ui.baseContact.select_person=Bitte wählen Sie einen Eintrag vom Typ Person
cms.contenttypes.ui.baseContact.select_person.add=Verknüpfen
cms.contenttypes.ui.baseContact.select_person.change=Verändern
cms.contenttypes.ui.baseContact.select_person.wrong_type=Der gewählte Eintrag ist nicht vom Typ Person
cms.contenttypes.ui.baseContact.select_person.cancelled=Abbruch
cms.contenttypes.ui.baseContact.delete_person.label=WollenSie die Verknüfung zur Person entfernen?
cms.contenttypes.ui.baseContact.delete_person.button_label=Löschen
cms.contenttypes.ui.baseContact.add_contactEntry=Kontaktinformation hinzufügen
cms.contenttypes.ui.baseContact.contactEntry=Kontaktinformationen
cms.contenttypes.ui.baseContact.contactEntry.key=Art der Information
cms.contenttypes.ui.baseContact.contactEntry.value=Inhalt
cms.contenttypes.ui.baseContact.contactEntry.description=Beschreibung (wird nicht öffentlich angezeigt)
cms.contenttypes.ui.baseContact.contactEntry.action=Aktionen
cms.contenttypes.ui.baseContact.contactEntry.key.contact_type=Kontaktart
cms.contenttypes.ui.baseContact.contactEntry.key.office_hours=Öffnungszeiten
cms.contenttypes.ui.baseContact.contactEntry.key.phone_office=Telefon (Büro)
cms.contenttypes.ui.baseContact.contactEntry.key.phone_private=Telefon (Privat)
cms.contenttypes.ui.baseContact.contactEntry.key.phone_mobile=Telefon (Mobil)
cms.contenttypes.ui.baseContact.contactEntry.key.email=E-Mail
cms.contenttypes.ui.baseContact.contactEntry.key.fax=Fax
cms.contenttypes.ui.baseContact.contactEntry.key.im=Instant Messenger
cms.contenttypes.ui.baseContact.contactEntry.key.www=Homepage
cms.contenttypes.ui.baseContact.contactEntry.none=Zur Zeit sind keine Kontaktinformatioonen vorhanden

View File

@ -48,7 +48,7 @@ public class BaseContactAddressPropertiesStep extends SimpleEditStep {
//XXX
// if(/*baseContact.getAddress() == null*/ true) {
BasicPageForm attachAddressSheet = new BaseContactAttachAddressPropertyForm(itemModel, this);
add(ADD_ADDRESS_SHEET_NAME, "Attach Address", new WorkflowLockedComponentAccess(attachAddressSheet, itemModel), attachAddressSheet.getSaveCancelSection().getCancelButton());
add(ADD_ADDRESS_SHEET_NAME, (String)BaseContactGlobalizationUtil.globalize("cms.contenttypes.ui.baseContact.attach_address").localize(), new WorkflowLockedComponentAccess(attachAddressSheet, itemModel), attachAddressSheet.getSaveCancelSection().getCancelButton());
/* Set the displayComponent for this step */
// setDisplayComponent(getEmptyBaseAddressPropertySheet(itemModel));
@ -57,13 +57,13 @@ public class BaseContactAddressPropertiesStep extends SimpleEditStep {
// editAddress
BasicPageForm editAddressSheet = new BaseContactEditAddressPropertyForm(itemModel, this);
add(EDIT_ADDRESS_SHEET_NAME, "Edit Address", new WorkflowLockedComponentAccess(editAddressSheet, itemModel), editAddressSheet.getSaveCancelSection().getCancelButton());
add(EDIT_ADDRESS_SHEET_NAME, (String)BaseContactGlobalizationUtil.globalize("cms.contenttypes.ui.baseContact.edit_address").localize(), new WorkflowLockedComponentAccess(editAddressSheet, itemModel), editAddressSheet.getSaveCancelSection().getCancelButton());
// BasicPageForm attachAddressSheet = new BaseContactAttachAddressPropertyForm(itemModel, this);
// add(CHANGE_ADDRESS_SHEET_NAME, "Reattach Address", new WorkflowLockedComponentAccess(attachAddressSheet, itemModel), attachAddressSheet.getSaveCancelSection().getCancelButton());
// add(CHANGE_ADDRESS_SHEET_NAME, (String)BaseContactGlobalizationUtil.globalize("cms.contenttypes.ui.baseContact.reattach_address").localize(), new WorkflowLockedComponentAccess(attachAddressSheet, itemModel), attachAddressSheet.getSaveCancelSection().getCancelButton());
BasicPageForm deleteAddressSheet = new BaseContactDeleteAddressForm(itemModel, this);
add(DELETE_ADDRESS_SHEET_NAME, "Delete Address", new WorkflowLockedComponentAccess(deleteAddressSheet, itemModel), deleteAddressSheet.getSaveCancelSection().getCancelButton());
add(DELETE_ADDRESS_SHEET_NAME, (String)BaseContactGlobalizationUtil.globalize("cms.contenttypes.ui.baseContact.delete_address").localize(), new WorkflowLockedComponentAccess(deleteAddressSheet, itemModel), deleteAddressSheet.getSaveCancelSection().getCancelButton());
/* Set the displayComponent for this step */
setDisplayComponent(getBaseAddressPropertySheet(itemModel));

View File

@ -27,6 +27,7 @@ import com.arsdigita.cms.contenttypes.BaseAddress;
import com.arsdigita.cms.contenttypes.BaseContact;
import com.arsdigita.cms.ui.ItemSearchWidget;
import com.arsdigita.cms.ContentType;
import com.arsdigita.cms.contenttypes.util.BaseContactGlobalizationUtil;
import com.arsdigita.util.UncheckedWrapperException;
import org.apache.log4j.Logger;
@ -77,7 +78,7 @@ public class BaseContactAttachAddressPropertyForm extends BasicPageForm implemen
@Override
public void addWidgets() {
add(new Label("BaseContact.address"));
add(new Label((String)BaseContactGlobalizationUtil.globalize("cms.contenttypes.ui.baseContact.select_address").localize()));
this.m_itemSearch = new ItemSearchWidget(ITEM_SEARCH, ContentType.findByAssociatedObjectType("com.arsdigita.cms.contenttypes.BaseAddress"));
add(this.m_itemSearch);
}
@ -118,9 +119,9 @@ public class BaseContactAttachAddressPropertyForm extends BasicPageForm implemen
Submit target = (Submit) e.getTarget();
if (baseContact.getAddress() != null) {
target.setButtonLabel("Change");
target.setButtonLabel((String)BaseContactGlobalizationUtil.globalize("cms.contenttypes.ui.baseContact.select_address.change").localize());
} else {
target.setButtonLabel("Add");
target.setButtonLabel((String)BaseContactGlobalizationUtil.globalize("cms.contenttypes.ui.baseContact.select_address.add").localize());
}
}
});
@ -131,14 +132,14 @@ public class BaseContactAttachAddressPropertyForm extends BasicPageForm implemen
public void validate(FormSectionEvent e) throws FormProcessException {
if (e.getFormData().get(ITEM_SEARCH) == null) {
throw new FormProcessException("BaseAddress selection is required");
throw new FormProcessException((String)BaseContactGlobalizationUtil.globalize("cms.contenttypes.ui.baseContact.select_address.wrong_type").localize());
}
}
public void submitted(FormSectionEvent e) throws FormProcessException {
if (getSaveCancelSection().getCancelButton().isSelected(e.getPageState())) {
init(e);
throw new FormProcessException("cancelled");
throw new FormProcessException((String)BaseContactGlobalizationUtil.globalize("cms.contenttypes.ui.baseContact.select_address.cancelled").localize());
}
}
}

View File

@ -27,6 +27,7 @@ import com.arsdigita.cms.contenttypes.Person;
import com.arsdigita.cms.contenttypes.BaseContact;
import com.arsdigita.cms.ui.ItemSearchWidget;
import com.arsdigita.cms.ContentType;
import com.arsdigita.cms.contenttypes.util.BaseContactGlobalizationUtil;
import com.arsdigita.util.UncheckedWrapperException;
import org.apache.log4j.Logger;
@ -77,7 +78,7 @@ public class BaseContactAttachPersonPropertyForm extends BasicPageForm implement
@Override
public void addWidgets() {
add(new Label("BaseContact.person"));
add(new Label((String)BaseContactGlobalizationUtil.globalize("cms.contenttypes.ui.baseContact.select_person").localize()));
this.m_itemSearch = new ItemSearchWidget(ITEM_SEARCH, ContentType.findByAssociatedObjectType("com.arsdigita.cms.contenttypes.Person"));
add(this.m_itemSearch);
}
@ -118,9 +119,9 @@ public class BaseContactAttachPersonPropertyForm extends BasicPageForm implement
Submit target = (Submit) e.getTarget();
if (baseContact.getPerson() != null) {
target.setButtonLabel("Change");
target.setButtonLabel((String)BaseContactGlobalizationUtil.globalize("cms.contenttypes.ui.baseContact.select_person.change").localize());
} else {
target.setButtonLabel("Add");
target.setButtonLabel((String)BaseContactGlobalizationUtil.globalize("cms.contenttypes.ui.baseContact.select_person.add").localize());
}
}
});
@ -131,14 +132,14 @@ public class BaseContactAttachPersonPropertyForm extends BasicPageForm implement
public void validate(FormSectionEvent e) throws FormProcessException {
if (e.getFormData().get(ITEM_SEARCH) == null) {
throw new FormProcessException("BasePerson selection is required");
throw new FormProcessException((String)BaseContactGlobalizationUtil.globalize("cms.contenttypes.ui.baseContact.select_person.wrong_type").localize());
}
}
public void submitted(FormSectionEvent e) throws FormProcessException {
if (getSaveCancelSection().getCancelButton().isSelected(e.getPageState())) {
init(e);
throw new FormProcessException("cancelled");
throw new FormProcessException((String)BaseContactGlobalizationUtil.globalize("cms.contenttypes.ui.baseContact.select_person.cancelled").localize());
}
}
}

View File

@ -19,6 +19,7 @@ import com.arsdigita.bebop.event.PrintListener;
import com.arsdigita.bebop.form.Submit;
import com.arsdigita.cms.ItemSelectionModel;
import com.arsdigita.cms.contenttypes.BaseContact;
import com.arsdigita.cms.contenttypes.util.BaseContactGlobalizationUtil;
import com.arsdigita.cms.ui.authoring.BasicPageForm;
import com.arsdigita.util.UncheckedWrapperException;
@ -43,7 +44,7 @@ public class BaseContactDeleteAddressForm extends BasicPageForm implements FormP
}
public void addWidgets() {
add(new Label("BaseContact.address.delete"));
add(new Label((String)BaseContactGlobalizationUtil.globalize("cms.contenttypes.ui.baseContact.delete_address.label").localize()));
}
/**
@ -56,7 +57,7 @@ public class BaseContactDeleteAddressForm extends BasicPageForm implements FormP
public void prepare(PrintEvent e) {
BaseContact baseContact = (BaseContact)getItemSelectionModel().getSelectedObject(e.getPageState());
Submit target = (Submit) e.getTarget();
target.setButtonLabel("Delete");
target.setButtonLabel((String)BaseContactGlobalizationUtil.globalize("cms.contenttypes.ui.baseContact.delete_address.button_label").localize());
}
});
} catch (Exception ex) {

View File

@ -19,6 +19,7 @@ import com.arsdigita.bebop.event.PrintListener;
import com.arsdigita.bebop.form.Submit;
import com.arsdigita.cms.ItemSelectionModel;
import com.arsdigita.cms.contenttypes.BaseContact;
import com.arsdigita.cms.contenttypes.util.BaseContactGlobalizationUtil;
import com.arsdigita.cms.ui.authoring.BasicPageForm;
import com.arsdigita.util.UncheckedWrapperException;
@ -43,7 +44,7 @@ public class BaseContactDeletePersonForm extends BasicPageForm implements FormPr
}
public void addWidgets() {
add(new Label("BaseContact.person.delete"));
add(new Label((String)BaseContactGlobalizationUtil.globalize("cms.contenttypes.ui.baseContact.delete_person.label").localize()));
}
/**
@ -56,7 +57,7 @@ public class BaseContactDeletePersonForm extends BasicPageForm implements FormPr
public void prepare(PrintEvent e) {
BaseContact baseContact = (BaseContact)getItemSelectionModel().getSelectedObject(e.getPageState());
Submit target = (Submit) e.getTarget();
target.setButtonLabel("Delete");
target.setButtonLabel((String)BaseContactGlobalizationUtil.globalize("cms.contenttypes.ui.baseContact.delete_person").localize());
}
});
} catch (Exception ex) {

View File

@ -25,7 +25,7 @@ import com.arsdigita.cms.ItemSelectionModel;
import com.arsdigita.cms.ui.authoring.BasicPageForm;
import com.arsdigita.cms.contenttypes.BaseContact;
import com.arsdigita.cms.contenttypes.Person;
import com.arsdigita.cms.contenttypes.util.BaseAddressGlobalizationUtil;
import com.arsdigita.cms.contenttypes.util.PersonGlobalizationUtil;
import org.apache.log4j.Logger;
@ -72,27 +72,27 @@ public class BaseContactEditPersonPropertyForm extends BasicPageForm implements
@Override
public void addWidgets() {
add(new Label((String)BaseAddressGlobalizationUtil.globalize("cms.contenttypes.ui.person.surname").localize()));
add(new Label((String)PersonGlobalizationUtil.globalize("cms.contenttypes.ui.person.surname").localize()));
ParameterModel surnameParam = new StringParameter(SURNAME);
surnameParam.addParameterListener( new NotNullValidationListener( ) );
surnameParam.addParameterListener( new StringInRangeValidationListener(0, 1000) );
TextField surname = new TextField(surnameParam);
add(surname);
add(new Label((String)BaseAddressGlobalizationUtil.globalize("cms.contenttypes.ui.person.givenname").localize()));
add(new Label((String)PersonGlobalizationUtil.globalize("cms.contenttypes.ui.person.givenname").localize()));
ParameterModel givennameParam = new StringParameter(GIVENNAME);
givennameParam.addParameterListener( new NotNullValidationListener( ) );
givennameParam.addParameterListener( new StringInRangeValidationListener(0, 1000) );
TextField givenname = new TextField(givennameParam);
add(givenname);
add(new Label((String)BaseAddressGlobalizationUtil.globalize("cms.contenttypes.ui.person.titlepre").localize()));
add(new Label((String)PersonGlobalizationUtil.globalize("cms.contenttypes.ui.person.titlepre").localize()));
ParameterModel titlepreParam = new StringParameter(TITLEPRE);
titlepreParam.addParameterListener( new StringInRangeValidationListener(0, 1000) );
TextField titlepre = new TextField(titlepreParam);
add(titlepre);
add(new Label((String)BaseAddressGlobalizationUtil.globalize("cms.contenttypes.ui.person.titlepost").localize()));
add(new Label((String)PersonGlobalizationUtil.globalize("cms.contenttypes.ui.person.titlepost").localize()));
ParameterModel titlepostParam = new StringParameter(TITLEPOST);
titlepostParam.addParameterListener( new StringInRangeValidationListener(0, 1000) );
TextField titlepost = new TextField(titlepostParam);

View File

@ -19,6 +19,7 @@
package com.arsdigita.cms.contenttypes.ui;
import com.arsdigita.cms.ItemSelectionModel;
import com.arsdigita.cms.contenttypes.util.BaseContactGlobalizationUtil;
import com.arsdigita.cms.ui.authoring.AuthoringKitWizard;
import com.arsdigita.cms.ui.authoring.BasicItemForm;
import com.arsdigita.cms.ui.authoring.SimpleEditStep;
@ -44,9 +45,8 @@ public class BaseContactEntriesPropertiesStep extends SimpleEditStep {
public BaseContactEntriesPropertiesStep(ItemSelectionModel itemModel, AuthoringKitWizard parent, String prefix) {
super(itemModel, parent, prefix);
//XXX
BasicItemForm addContactEntrySheet = new BaseContactEntryAddForm(itemModel);
add(ADD_CONTACT_ENTRY_SHEET_NAME, "Add Contact Entry", new WorkflowLockedComponentAccess(addContactEntrySheet, itemModel), addContactEntrySheet.getSaveCancelSection().getCancelButton());
add(ADD_CONTACT_ENTRY_SHEET_NAME, (String)BaseContactGlobalizationUtil.globalize("cms.contenttypes.ui.baseContact.add_contactEntry").localize(), new WorkflowLockedComponentAccess(addContactEntrySheet, itemModel), addContactEntrySheet.getSaveCancelSection().getCancelButton());
BaseContactEntriesTable contactEntriesTable = new BaseContactEntriesTable(itemModel);
setDisplayComponent(contactEntriesTable);

View File

@ -35,8 +35,8 @@ import com.arsdigita.cms.SecurityManager;
import com.arsdigita.cms.contenttypes.BaseContact;
import com.arsdigita.cms.contenttypes.BaseContactEntry;
import com.arsdigita.cms.contenttypes.BaseContactEntryCollection;
import com.arsdigita.cms.contenttypes.util.BaseContactGlobalizationUtil;
import com.arsdigita.cms.dispatcher.Utilities;
import com.arsdigita.cms.ui.authoring.AuthoringKitWizard;
import com.arsdigita.cms.util.GlobalizationUtil;
import com.arsdigita.util.LockableImpl;
import java.math.BigDecimal;
@ -63,14 +63,14 @@ public class BaseContactEntriesTable extends Table implements TableActionListene
this.m_itemModel = itemModel;
// if table is empty:
setEmptyView(new Label(GlobalizationUtil.globalize("cms.contenttypes.ui.baseContact.contactentries.none")));
setEmptyView(new Label(BaseContactGlobalizationUtil.globalize("cms.contenttypes.ui.baseContact.contactEntry.none")));
TableColumnModel tab_model = getColumnModel();
// define columns
tab_model.add(new TableColumn(0, GlobalizationUtil.globalize("cms.contenttypes.ui.baseContact.contactentries.key").localize(), TABLE_COL_EDIT));
tab_model.add(new TableColumn(1, GlobalizationUtil.globalize("cms.contenttypes.ui.baseContact.contactentries.value").localize()));
tab_model.add(new TableColumn(2, GlobalizationUtil.globalize("cms.contenttypes.ui.baseContact.contactentries.description").localize()));
tab_model.add(new TableColumn(3, GlobalizationUtil.globalize("cms.contenttypes.ui.baseContact.contactentries.delete").localize(), TABLE_COL_DEL));
tab_model.add(new TableColumn(0, BaseContactGlobalizationUtil.globalize("cms.contenttypes.ui.baseContact.contactEntry.key").localize(), TABLE_COL_EDIT));
tab_model.add(new TableColumn(1, BaseContactGlobalizationUtil.globalize("cms.contenttypes.ui.baseContact.contactEntry.value").localize()));
tab_model.add(new TableColumn(2, BaseContactGlobalizationUtil.globalize("cms.contenttypes.ui.baseContact.contactEntry.description").localize()));
tab_model.add(new TableColumn(3, BaseContactGlobalizationUtil.globalize("cms.contenttypes.ui.baseContact.contactEntry.action").localize(), TABLE_COL_DEL));
setModelBuilder(new BaseContactTableModelBuilder(itemModel));
@ -154,7 +154,7 @@ public class BaseContactEntriesTable extends Table implements TableActionListene
public Object getElementAt(int columnIndex) {
switch (columnIndex){
case 0:
return m_baseContactEntry.getKey();
return (String)BaseContactGlobalizationUtil.globalize("cms.contenttypes.ui.baseContact.contactEntry.key." + m_baseContactEntry.getKey()).localize();
case 1:
return m_baseContactEntry.getValue();
case 2:
@ -221,8 +221,7 @@ public class BaseContactEntriesTable extends Table implements TableActionListene
baseContact);
if(canDelete) {
ControlLink link = new ControlLink(value.toString());
link.setConfirmation((String) GlobalizationUtil.globalize(
"cms.contenttypes.ui.baseContact.confirm_delete").localize());
link.setConfirmation((String) BaseContactGlobalizationUtil.globalize("cms.contenttypes.ui.baseContact.confirm_delete").localize());
return link;
} else {
return new Label(value.toString());

View File

@ -29,7 +29,6 @@ import com.arsdigita.bebop.parameters.ParameterModel;
import com.arsdigita.cms.ItemSelectionModel;
import com.arsdigita.cms.contenttypes.BaseContact;
import com.arsdigita.cms.contenttypes.BaseContactEntry;
import com.arsdigita.cms.contenttypes.util.BaseAddressGlobalizationUtil;
import com.arsdigita.cms.contenttypes.util.BaseContactGlobalizationUtil;
import com.arsdigita.cms.ui.authoring.BasicItemForm;
import com.arsdigita.bebop.parameters.StringParameter;
@ -65,11 +64,11 @@ public class BaseContactEntryAddForm extends BasicItemForm {
ParameterModel contactEntryKeyParam = new StringParameter(BaseContactEntry.KEY);
SingleSelect contactEntryKey = new SingleSelect(contactEntryKeyParam);
contactEntryKey.addValidationListener(new NotNullValidationListener());
contactEntryKey.addOption(new Option("", new Label((String)BaseAddressGlobalizationUtil.globalize("cms.ui.select_one" ).localize())));
contactEntryKey.addOption(new Option("", new Label((String)BaseContactGlobalizationUtil.globalize("cms.ui.select_one").localize())));
// Add the Options to the SingleSelect widget
StringTokenizer keyList = BaseContact.getConfig().getContactEntryKeys();
while(keyList.hasMoreTokens()) {
while(keyList.hasMoreElements()) {
String currentKey = keyList.nextToken();
contactEntryKey.addOption(new Option(currentKey, ((String)BaseContactGlobalizationUtil.globalize("cms.contenttypes.ui.baseContact.contactEntry.key." + currentKey).localize())));
}

View File

@ -46,7 +46,7 @@ public class BaseContactPersonPropertiesStep extends SimpleEditStep {
// if(false/*EMPTY*/) {
BasicPageForm addPersonSheet = new BaseContactAttachPersonPropertyForm(itemModel, this);
add(ADD_PERSON_SHEET_NAME, "Attach Person", new WorkflowLockedComponentAccess(addPersonSheet, itemModel), addPersonSheet.getSaveCancelSection().getCancelButton());
add(ADD_PERSON_SHEET_NAME, (String)BaseContactGlobalizationUtil.globalize("cms.contenttypes.ui.baseContact.attach_person").localize(), new WorkflowLockedComponentAccess(addPersonSheet, itemModel), addPersonSheet.getSaveCancelSection().getCancelButton());
/* Set the displayComponent for this step */
// setDisplayComponent(getEmptyPersonPropertySheet(itemModel));
@ -54,13 +54,13 @@ public class BaseContactPersonPropertiesStep extends SimpleEditStep {
// } else {
BasicPageForm editPersonSheet = new BaseContactEditPersonPropertyForm(itemModel, this);
add(EDIT_PERSON_SHEET_NAME, "Edit Person", new WorkflowLockedComponentAccess(editPersonSheet, itemModel), editPersonSheet.getSaveCancelSection().getCancelButton());
add(EDIT_PERSON_SHEET_NAME, (String)BaseContactGlobalizationUtil.globalize("cms.contenttypes.ui.baseContact.edit_person").localize(), new WorkflowLockedComponentAccess(editPersonSheet, itemModel), editPersonSheet.getSaveCancelSection().getCancelButton());
// BasicPageForm changePersonSheet = new BaseContactEditPersonPropertyForm(itemModel, this);
// add(CHANGE_PERSON_SHEET_NAME, "Change Person", new WorkflowLockedComponentAccess(changePersonSheet, itemModel), changePersonSheet.getSaveCancelSection().getCancelButton());
// add(CHANGE_PERSON_SHEET_NAME, (String)BaseContactGlobalizationUtil.globalize("cms.contenttypes.ui.baseContact.reattach_person").localize(), new WorkflowLockedComponentAccess(changePersonSheet, itemModel), changePersonSheet.getSaveCancelSection().getCancelButton());
BasicPageForm deletePersonSheet = new BaseContactDeletePersonForm(itemModel, this);
add(DELETE_PERSON_SHEET_NAME, "Delete Person", new WorkflowLockedComponentAccess(deletePersonSheet, itemModel), deletePersonSheet.getSaveCancelSection().getCancelButton());
add(DELETE_PERSON_SHEET_NAME, (String)BaseContactGlobalizationUtil.globalize("cms.contenttypes.ui.baseContact.delete_person").localize(), new WorkflowLockedComponentAccess(deletePersonSheet, itemModel), deletePersonSheet.getSaveCancelSection().getCancelButton());
/* Set the displayComponent for this step */
setDisplayComponent(getPersonPropertySheet(itemModel));

View File

@ -15,6 +15,7 @@ import com.arsdigita.bebop.Component;
import com.arsdigita.bebop.Label;
import com.arsdigita.bebop.SegmentedPanel;
import com.arsdigita.cms.contenttypes.BaseContact;
import com.arsdigita.cms.contenttypes.util.BaseContactGlobalizationUtil;
import java.text.DateFormat;
import org.apache.log4j.Logger;
@ -54,28 +55,28 @@ public class BaseContactPropertiesStep extends SimpleEditStep {
/* Create the edit component for this SimpleEditStep and the corresponding link */
BasicPageForm editBasicSheet = new BaseContactPropertyForm(itemModel, this);
basicProperties.add(EDIT_BASIC_SHEET_NAME, "Edit Basic", new WorkflowLockedComponentAccess(editBasicSheet, itemModel), editBasicSheet.getSaveCancelSection().getCancelButton());
basicProperties.add(EDIT_BASIC_SHEET_NAME, (String)BaseContactGlobalizationUtil.globalize("cms.contenttypes.ui.baseContact.edit_basic_properties").localize(), new WorkflowLockedComponentAccess(editBasicSheet, itemModel), editBasicSheet.getSaveCancelSection().getCancelButton());
/* Set the displayComponent for this step */
basicProperties.setDisplayComponent(getBaseContactPropertySheet(itemModel));
/* Add the SimpleEditStep to the segmented panel */
segmentedPanel.addSegment(new Label("Basic"), basicProperties);
segmentedPanel.addSegment(new Label((String)BaseContactGlobalizationUtil.globalize("cms.contenttypes.ui.baseContact.basic_properties").localize()), basicProperties);
// If not disabled via registry, add the ui for attaching a person
if(!BaseContact.getConfig().getHidePerson()) {
BaseContactPersonPropertiesStep personProperties = new BaseContactPersonPropertiesStep(itemModel, parent);
segmentedPanel.addSegment(new Label((String)GlobalizationUtil.globalize("cms.contenttypes.ui.baseContact.person").localize()), personProperties);
segmentedPanel.addSegment(new Label((String)BaseContactGlobalizationUtil.globalize("cms.contenttypes.ui.baseContact.person").localize()), personProperties);
}
// If not disabled via registry, add the ui for attaching a baseAddress
if(!BaseContact.getConfig().getHideAddress()) {
BaseContactAddressPropertiesStep addressProperties = new BaseContactAddressPropertiesStep(itemModel, parent);
segmentedPanel.addSegment(new Label((String)GlobalizationUtil.globalize("cms.contenttypes.ui.baseContact.address").localize()), addressProperties);
segmentedPanel.addSegment(new Label((String)BaseContactGlobalizationUtil.globalize("cms.contenttypes.ui.baseContact.address").localize()), addressProperties);
}
BaseContactEntriesPropertiesStep baseContactEntries = new BaseContactEntriesPropertiesStep(itemModel, parent);
segmentedPanel.addSegment(new Label((String)GlobalizationUtil.globalize("cms.contenttypes.ui.baseContact.baseContactEntries").localize()), baseContactEntries);
segmentedPanel.addSegment(new Label((String)BaseContactGlobalizationUtil.globalize("cms.contenttypes.ui.baseContact.contactEntry").localize()), baseContactEntries);
/* Sets the composed segmentedPanel as display component */
setDisplayComponent(segmentedPanel);

View File

@ -56,17 +56,7 @@ public class BaseContactPropertyForm extends BasicPageForm implements FormProces
super.addWidgets();
/*
add(new Label(GlobalizationUtil.globalize("cms.contenttypes.genericorganization.ui.organizationname")));
ParameterModel organizationNameParam = new StringParameter(ORGANIZATIONAME);
TextField organizationName = new TextField(organizationNameParam);
organizationName.addValidationListener(new NotNullValidationListener());
add(organizationName);
add(new Label(GlobalizationUtil.globalize("cms.contenttypes.genericorganization.ui.organizationnameaddendum")));
TextField organizationNameAddendum = new TextField(ORGANIZATIONNAMEADDENDUM);
add(organizationNameAddendum);
add(new Label(GlobalizationUtil.globalize("cms.contenttypes.genericorganzation.ui.description")));
add(new Label((String)BaseContactGlobalizationUtil.globalize("cms.contenttypes.ui.baseContact.basic_properties.description").localize())));
TextArea description = new TextArea(DESCRIPTION);
description.setRows(5);
description.setCols(30);