Nachtrag Vervollständigen Lokalisierung.
git-svn-id: https://svn.libreccm.org/ccm/trunk@2227 8810af33-2d31-482b-a856-94f89814c4dfmaster
parent
04997be566
commit
e5346d6047
|
|
@ -19,11 +19,9 @@
|
|||
*/
|
||||
package com.arsdigita.cms.contenttypes;
|
||||
|
||||
import com.arsdigita.cms.ContentType;
|
||||
import com.arsdigita.domain.DataObjectNotFoundException;
|
||||
import com.arsdigita.persistence.DataObject;
|
||||
import com.arsdigita.persistence.OID;
|
||||
import com.arsdigita.util.Assert;
|
||||
import java.math.BigDecimal;
|
||||
|
||||
/**
|
||||
|
|
@ -34,7 +32,8 @@ import java.math.BigDecimal;
|
|||
public class Person extends GenericPerson {
|
||||
|
||||
/** Data object type for this domain object */
|
||||
public static final String BASE_DATA_OBJECT_TYPE = "com.arsdigita.cms.contenttypes.Person";
|
||||
public static final String BASE_DATA_OBJECT_TYPE =
|
||||
"com.arsdigita.cms.contenttypes.Person";
|
||||
|
||||
/**
|
||||
* Default constructor. This creates a new (empty) Person.
|
||||
|
|
|
|||
|
|
@ -24,6 +24,7 @@ import com.arsdigita.cms.ItemSelectionModel;
|
|||
import com.arsdigita.cms.ui.authoring.AuthoringKitWizard;
|
||||
import com.arsdigita.cms.ui.authoring.BasicPageForm;
|
||||
import com.arsdigita.cms.ui.workflow.WorkflowLockedComponentAccess;
|
||||
import com.arsdigita.cms.util.GlobalizationUtil;
|
||||
|
||||
public class PersonPropertiesStep extends GenericPersonPropertiesStep {
|
||||
|
||||
|
|
@ -37,7 +38,8 @@ public class PersonPropertiesStep extends GenericPersonPropertiesStep {
|
|||
protected void createEditSheet(ItemSelectionModel itemModel) {
|
||||
BasicPageForm editSheet;
|
||||
editSheet = new PersonPropertyForm(itemModel, this);
|
||||
add(EDIT_SHEET_NAME, "Edit",
|
||||
add(EDIT_SHEET_NAME,
|
||||
GlobalizationUtil.globalize("cms.ui.edit"),
|
||||
new WorkflowLockedComponentAccess(editSheet, itemModel), editSheet.
|
||||
getSaveCancelSection().getCancelButton());
|
||||
}
|
||||
|
|
|
|||
|
|
@ -20,18 +20,13 @@
|
|||
package com.arsdigita.cms.contenttypes.ui;
|
||||
|
||||
import com.arsdigita.bebop.FormData;
|
||||
import com.arsdigita.bebop.Label;
|
||||
import com.arsdigita.bebop.event.FormInitListener;
|
||||
import com.arsdigita.bebop.event.FormProcessListener;
|
||||
import com.arsdigita.bebop.event.FormSectionEvent;
|
||||
import com.arsdigita.bebop.event.FormSubmissionListener;
|
||||
import com.arsdigita.bebop.form.TextField;
|
||||
import com.arsdigita.bebop.parameters.ParameterModel;
|
||||
import com.arsdigita.bebop.parameters.StringParameter;
|
||||
import com.arsdigita.cms.ItemSelectionModel;
|
||||
import com.arsdigita.cms.contenttypes.Person;
|
||||
import com.arsdigita.cms.contenttypes.util.PersonGlobalizationUtil;
|
||||
import com.arsdigita.cms.ui.authoring.BasicPageForm;
|
||||
|
||||
import org.apache.log4j.Logger;
|
||||
|
||||
/**
|
||||
|
|
@ -39,11 +34,10 @@ import org.apache.log4j.Logger;
|
|||
*
|
||||
* @author: Jens Pelzetter
|
||||
*/
|
||||
public class PersonPropertyForm
|
||||
extends GenericPersonPropertyForm
|
||||
implements FormProcessListener,
|
||||
FormInitListener,
|
||||
FormSubmissionListener {
|
||||
public class PersonPropertyForm extends GenericPersonPropertyForm
|
||||
implements FormProcessListener,
|
||||
FormInitListener,
|
||||
FormSubmissionListener {
|
||||
|
||||
private static final Logger s_log = Logger.getLogger(
|
||||
PersonPropertyForm.class);
|
||||
|
|
@ -66,12 +60,14 @@ public class PersonPropertyForm
|
|||
super.addWidgets();
|
||||
}
|
||||
|
||||
@Override
|
||||
public void init(FormSectionEvent fse) {
|
||||
super.init(fse);
|
||||
FormData data = fse.getFormData();
|
||||
Person person = (Person) super.initBasicWidgets(fse);
|
||||
}
|
||||
|
||||
@Override
|
||||
public void process(FormSectionEvent fse) {
|
||||
super.process(fse);
|
||||
FormData data = fse.getFormData();
|
||||
|
|
|
|||
|
|
@ -978,8 +978,6 @@ cms.ui.type.permissions.actions.revoke=Revoke permission
|
|||
cms.ui.type.permissions.can_use.no=No
|
||||
cms.contenttypes.ui.person.set_alias=Set former name
|
||||
cms.contenttypes.ui.person.delete_alias=Remove former name
|
||||
cms.contenttypes.ui.person.alias.none=No former name
|
||||
cms.contenttypes.ui.person.alias=Former name
|
||||
cms.contenttypes.ui.person.alias.select=Select former name
|
||||
cms.contenttypes.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.
|
||||
|
|
@ -1011,7 +1009,6 @@ cms.ui.search.create.select_edit=Select item and edit
|
|||
cms.ui.clear=Clear
|
||||
cms.ui.item_search.create.folder_missing=No folder selected
|
||||
cms.ui.images_links=
|
||||
cms.contenttypes.ui.person.alias.delete.label=Delete
|
||||
cms.ui.contentcenter.mainpage.search=Search
|
||||
cms.ui.contentcenter.mainpage.taskssections=Tasks/Sections
|
||||
cms.ui.contentcenter.section=Section
|
||||
|
|
|
|||
|
|
@ -969,8 +969,6 @@ cms.ui.type.permissions.actions.revoke=Berechtigung widerrufen
|
|||
cms.ui.type.permissions.can_use.no=Nein
|
||||
cms.contenttypes.ui.person.set_alias=Fr\u00fcheren Namen setzen
|
||||
cms.contenttypes.ui.person.delete_alias=Fr\u00fcheren Namen entfernen
|
||||
cms.contenttypes.ui.person.alias.none=Kein fr\u00fcherer Name
|
||||
cms.contenttypes.ui.person.alias=Fr\u00fcherer Name
|
||||
cms.contenttypes.ui.person.alias.select=Fr\u00fcheren Namen ausw\u00e4hlen
|
||||
cms.contenttypes.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.
|
||||
|
|
@ -1003,7 +1001,6 @@ cms.ui.type.minimum_number_of_values_bigger_than_maximum_number_of_values=Maxima
|
|||
cms.ui.type.minimummaximum_number_of_values_cannot_be_negative=Keine negativen Werte erlaubt
|
||||
cms.ui.item_search.create.folder_missing=kein Ordner ausgew\u00e4hlt
|
||||
cms.ui.images_links=
|
||||
cms.contenttypes.ui.person.alias.delete.label=L\u00f6schen
|
||||
cms.ui.contentcenter.mainpage.search=Suche
|
||||
cms.ui.contentcenter.mainpage.taskssections=Aufgaben/Content Sections
|
||||
cms.ui.contentcenter.section=Content Section
|
||||
|
|
|
|||
|
|
@ -17,8 +17,6 @@ cms.ui.type.permissions.actions.revoke=Revoke permission
|
|||
cms.ui.type.permissions.can_use.no=No
|
||||
cms.contenttypes.ui.person.set_alias=Set former name
|
||||
cms.contenttypes.ui.person.delete_alias=Remove former name
|
||||
cms.contenttypes.ui.person.alias.none=No former name
|
||||
cms.contenttypes.ui.person.alias=Former name
|
||||
cms.contenttypes.ui.person.alias.select=Select former name
|
||||
cms.contenttypes.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.
|
||||
|
|
@ -50,7 +48,6 @@ cms.ui.search.create.select_edit=Select item and edit
|
|||
cms.ui.clear=Clear
|
||||
cms.ui.item_search.create.folder_missing=No folder selected
|
||||
cms.ui.images_links=
|
||||
cms.contenttypes.ui.person.alias.delete.label=Delete
|
||||
cms.ui.contentcenter.mainpage.search=Search
|
||||
cms.ui.contentcenter.mainpage.taskssections=Tasks/Sections
|
||||
cms.ui.contentcenter.section=Section
|
||||
|
|
|
|||
|
|
@ -498,8 +498,6 @@ cms.ui.type.permissions.actions.revoke=Revoke permission
|
|||
cms.ui.type.permissions.can_use.no=No
|
||||
cms.contenttypes.ui.person.set_alias=Set former name
|
||||
cms.contenttypes.ui.person.delete_alias=Remove former name
|
||||
cms.contenttypes.ui.person.alias.none=No former name
|
||||
cms.contenttypes.ui.person.alias=Former name
|
||||
cms.contenttypes.ui.person.alias.select=Select former name
|
||||
cms.contenttypes.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.
|
||||
|
|
@ -531,7 +529,6 @@ cms.ui.search.create.select_edit=Select item and edit
|
|||
cms.ui.clear=
|
||||
cms.ui.item_search.create.folder_missing=No folder selected
|
||||
cms.ui.images_links=
|
||||
cms.contenttypes.ui.person.alias.delete.label=Delete
|
||||
cms.ui.contentcenter.mainpage.search=
|
||||
cms.ui.contentcenter.mainpage.taskssections=
|
||||
cms.ui.contentcenter.section=
|
||||
|
|
|
|||
|
|
@ -157,3 +157,5 @@ person.authoring.orgas.title=Organisational Units
|
|||
cms.contenttypes.ui.person.set_alias=Set former name
|
||||
cms.contenttypes.ui.person.delete_alias=Remove former name
|
||||
cms.contenttypes.ui.person.alias.none=No former name
|
||||
cms.contenttypes.ui.person.alias_title=Former Name
|
||||
cms.contenttypes.ui.person.select_contact=Select a Contact
|
||||
|
|
|
|||
|
|
@ -165,4 +165,6 @@ person.ui.orgaunits.columns.type=Typ
|
|||
person.authoring.orgas.title=Organisationseinheiten
|
||||
cms.contenttypes.ui.person.set_alias=Fr\u00fcheren Namen setzen
|
||||
cms.contenttypes.ui.person.delete_alias=Fr\u00fcheren Namen entfernen
|
||||
cms.contenttypes.ui.person.alias.none=Kein fr\u00fchrer Name
|
||||
cms.contenttypes.ui.person.alias.none=Kein fr\u00fcherer Name
|
||||
cms.contenttypes.ui.person.alias_title=Fr\u00fcherer Name
|
||||
cms.contenttypes.ui.person.select_contact=Einen Kontakt ausw\u00e4hlen
|
||||
|
|
|
|||
|
|
@ -66,8 +66,8 @@ public class GenericPersonAliasPropertiesStep extends SimpleEditStep {
|
|||
this);
|
||||
|
||||
add(SET_ALIAS_SHEET_NAME,
|
||||
(String) ContenttypesGlobalizationUtil.globalize(
|
||||
"cms.contenttypes.ui.person.set_alias").localize(),
|
||||
ContenttypesGlobalizationUtil.globalize(
|
||||
"cms.contenttypes.ui.person.set_alias"),
|
||||
new GenericPersonAliasSetWorkflowLockedComponentAccess(setAliasSheet,
|
||||
itemModel),
|
||||
setAliasSheet.getSaveCancelSection().getCancelButton());
|
||||
|
|
@ -79,8 +79,8 @@ public class GenericPersonAliasPropertiesStep extends SimpleEditStep {
|
|||
itemModel),
|
||||
changeAliasSheet.getSaveCancelSection().getCancelButton());*/
|
||||
add(DELETE_ALIAS_SHEET_NAME,
|
||||
(String) ContenttypesGlobalizationUtil.globalize(
|
||||
"cms.contenttypes.ui.person.delete_alias").localize(),
|
||||
ContenttypesGlobalizationUtil.globalize(
|
||||
"cms.contenttypes.ui.person.delete_alias"),
|
||||
new GenericPersonAliasEditWorkflowLockedComponentAccess(
|
||||
deleteAliasSheet,
|
||||
itemModel),
|
||||
|
|
@ -114,8 +114,8 @@ public class GenericPersonAliasPropertiesStep extends SimpleEditStep {
|
|||
|
||||
public static Component getEmptyAliasPropertySheet(
|
||||
final ItemSelectionModel itemModel) {
|
||||
return new Label((String) ContenttypesGlobalizationUtil.globalize(
|
||||
"cms.contenttypes.ui.person.alias.none").localize());
|
||||
return new Label(ContenttypesGlobalizationUtil.globalize(
|
||||
"cms.contenttypes.ui.person.alias.none"));
|
||||
}
|
||||
|
||||
private class GenericPersonAliasSetWorkflowLockedComponentAccess
|
||||
|
|
|
|||
|
|
@ -39,6 +39,7 @@ import com.arsdigita.cms.contenttypes.GenericContactTypeCollection;
|
|||
import com.arsdigita.cms.contenttypes.GenericPersonContactCollection;
|
||||
import com.arsdigita.cms.contenttypes.GenericPerson;
|
||||
import com.arsdigita.cms.ui.ItemSearchWidget;
|
||||
import com.arsdigita.cms.util.GlobalizationUtil;
|
||||
|
||||
import com.arsdigita.globalization.GlobalizationHelper;
|
||||
|
||||
|
|
@ -92,7 +93,7 @@ public class GenericPersonContactAddForm extends BasicItemForm {
|
|||
SingleSelect contactType = new SingleSelect(contactTypeParam);
|
||||
contactType.addValidationListener(new NotNullValidationListener());
|
||||
contactType.addOption(new Option("",
|
||||
new Label(ContenttypesGlobalizationUtil.
|
||||
new Label(GlobalizationUtil.
|
||||
globalize("cms.ui.select_one"))));
|
||||
|
||||
// Add the Options to the SingleSelect widget
|
||||
|
|
|
|||
|
|
@ -33,16 +33,20 @@ public class GenericPersonContactPropertiesStep extends SimpleEditStep {
|
|||
/** The name of the editing sheet added to this step */
|
||||
private static String ADD_CONTACT_SHEET_NAME = "addContact";
|
||||
|
||||
public GenericPersonContactPropertiesStep(ItemSelectionModel itemModel, AuthoringKitWizard parent) {
|
||||
public GenericPersonContactPropertiesStep(ItemSelectionModel itemModel,
|
||||
AuthoringKitWizard parent) {
|
||||
this(itemModel, parent, null);
|
||||
}
|
||||
|
||||
public GenericPersonContactPropertiesStep(ItemSelectionModel itemModel, AuthoringKitWizard parent, String prefix) {
|
||||
public GenericPersonContactPropertiesStep(ItemSelectionModel itemModel,
|
||||
AuthoringKitWizard parent,
|
||||
String prefix) {
|
||||
super(itemModel, parent, prefix);
|
||||
|
||||
BasicItemForm addContactSheet = new GenericPersonContactAddForm(itemModel);
|
||||
add(ADD_CONTACT_SHEET_NAME,
|
||||
(String) ContenttypesGlobalizationUtil.globalize("cms.contenttypes.ui.person.add_contact").localize(),
|
||||
ContenttypesGlobalizationUtil.globalize(
|
||||
"cms.contenttypes.ui.person.add_contact"),
|
||||
new WorkflowLockedComponentAccess(addContactSheet, itemModel),
|
||||
addContactSheet.getSaveCancelSection().getCancelButton());
|
||||
|
||||
|
|
|
|||
|
|
@ -34,6 +34,7 @@ import com.arsdigita.cms.ui.authoring.SimpleEditStep;
|
|||
import com.arsdigita.cms.ui.workflow.WorkflowLockedComponentAccess;
|
||||
|
||||
import com.arsdigita.cms.contenttypes.util.ContenttypesGlobalizationUtil;
|
||||
import com.arsdigita.cms.util.GlobalizationUtil;
|
||||
import java.text.DateFormat;
|
||||
|
||||
/**
|
||||
|
|
@ -66,12 +67,12 @@ public class GenericPersonPropertiesStep extends SimpleEditStep {
|
|||
BasicPageForm editBasicSheet = new GenericPersonPropertyForm(itemModel,
|
||||
this);
|
||||
basicProperties.add(EDIT_SHEET_NAME,
|
||||
(String) ContenttypesGlobalizationUtil.globalize(
|
||||
"cms.contenttypes.ui.person.edit_basic_properties").
|
||||
localize(), new WorkflowLockedComponentAccess(editBasicSheet,
|
||||
ContenttypesGlobalizationUtil.globalize(
|
||||
"cms.contenttypes.ui.person.edit_basic_properties"),
|
||||
new WorkflowLockedComponentAccess(editBasicSheet,
|
||||
itemModel),
|
||||
editBasicSheet.getSaveCancelSection().
|
||||
getCancelButton());
|
||||
editBasicSheet.getSaveCancelSection()
|
||||
.getCancelButton());
|
||||
|
||||
/* Set the displayComponent for this step */
|
||||
basicProperties.setDisplayComponent(getGenericPersonPropertySheet(
|
||||
|
|
@ -91,7 +92,7 @@ public class GenericPersonPropertiesStep extends SimpleEditStep {
|
|||
new GenericPersonAliasPropertiesStep(
|
||||
itemModel, parent);
|
||||
segmentedPanel.addSegment(new Label(ContenttypesGlobalizationUtil.
|
||||
globalize("cms.contenttypes.ui.person.alias")),
|
||||
globalize("cms.contenttypes.ui.person.alias_title")),
|
||||
aliasStep);
|
||||
|
||||
/* Sets the composed segmentedPanel as display component */
|
||||
|
|
@ -129,14 +130,14 @@ public class GenericPersonPropertiesStep extends SimpleEditStep {
|
|||
return DateFormat.getDateInstance(DateFormat.LONG).format(person.
|
||||
getBirthdate());
|
||||
} else {
|
||||
return (String) ContenttypesGlobalizationUtil.globalize(
|
||||
return (String) GlobalizationUtil.globalize(
|
||||
"cms.ui.unknown").localize();
|
||||
}
|
||||
}
|
||||
});
|
||||
|
||||
sheet.add(ContenttypesGlobalizationUtil.globalize(
|
||||
"cms.contenttypes.ui.person.gender"),
|
||||
"cms.contenttypes.ui.person.gender"),
|
||||
GenericPerson.GENDER,
|
||||
new DomainObjectPropertySheet.AttributeFormatter() {
|
||||
|
||||
|
|
@ -146,11 +147,11 @@ public class GenericPersonPropertiesStep extends SimpleEditStep {
|
|||
//ContentPage page = (ContentPage) item;
|
||||
GenericPerson person = (GenericPerson) item;
|
||||
if (person.getGender() != null) {
|
||||
return (String) ContenttypesGlobalizationUtil.globalize("cms.contenttypes.ui.person.gender."
|
||||
+ person.
|
||||
getGender().toLowerCase()).localize();
|
||||
} else {
|
||||
return (String) ContenttypesGlobalizationUtil.globalize(
|
||||
"cms.contenttypes.ui.person.gender."
|
||||
+ person.getGender().toLowerCase()).localize();
|
||||
} else {
|
||||
return (String) GlobalizationUtil.globalize(
|
||||
"cms.ui.unknown").localize();
|
||||
}
|
||||
}
|
||||
|
|
@ -158,27 +159,13 @@ public class GenericPersonPropertiesStep extends SimpleEditStep {
|
|||
|
||||
if (!ContentSection.getConfig().getHideLaunchDate()) {
|
||||
sheet.add(ContenttypesGlobalizationUtil.globalize(
|
||||
"cms.ui.authoring.page_launch_date"),
|
||||
"cms.ui.authoring.page_launch_date"),
|
||||
ContentPage.LAUNCH_DATE,
|
||||
new DomainObjectPropertySheet.AttributeFormatter() {
|
||||
|
||||
public String format(DomainObject item,
|
||||
String attribute,
|
||||
PageState state) {
|
||||
ContentPage page = (ContentPage) item;
|
||||
if (page.getLaunchDate() != null) {
|
||||
return DateFormat.getDateInstance(DateFormat.LONG).
|
||||
format(page.getLaunchDate());
|
||||
} else {
|
||||
return (String) ContenttypesGlobalizationUtil.globalize(
|
||||
"cms.ui.unknown").localize();
|
||||
}
|
||||
}
|
||||
});
|
||||
new LaunchDateAttributeFormatter() );
|
||||
}
|
||||
|
||||
sheet.add(ContenttypesGlobalizationUtil.globalize(
|
||||
"cms.contenttypes.ui.person.description"),
|
||||
"cms.contenttypes.ui.person.description"),
|
||||
GenericPerson.DESCRIPTION);
|
||||
return sheet;
|
||||
}
|
||||
|
|
|
|||
|
|
@ -444,6 +444,10 @@ public class DomainObjectPropertySheet extends PropertySheet {
|
|||
|
||||
/* Determine the default value */
|
||||
GlobalizedMessage defaultMsg = getDefaultValue();
|
||||
|
||||
if (obj == null) {
|
||||
return (String)defaultMsg.localize();
|
||||
}
|
||||
Object value = get(obj, attribute);
|
||||
|
||||
if (value == null) {
|
||||
|
|
|
|||
Loading…
Reference in New Issue