Weitere Verbesserung der Lokalisierung.
git-svn-id: https://svn.libreccm.org/ccm/trunk@2226 8810af33-2d31-482b-a856-94f89814c4dfmaster
parent
ede1f2036b
commit
04997be566
|
|
@ -86,12 +86,14 @@ public class PublicPersonalProfileCreate extends PageCreate {
|
||||||
add(m_workflowSection, ColumnPanel.INSERT);
|
add(m_workflowSection, ColumnPanel.INSERT);
|
||||||
add(new Label(GlobalizationUtil.globalize(
|
add(new Label(GlobalizationUtil.globalize(
|
||||||
"cms.ui.authoring.content_type")));
|
"cms.ui.authoring.content_type")));
|
||||||
add(new Label(type.getLabel()));
|
add(new Label(type.getLabel())); // the title or name of the type
|
||||||
add(new Label(GlobalizationUtil.globalize("cms.ui.language.field")));
|
add(new Label(GlobalizationUtil.globalize("cms.ui.language.field")));
|
||||||
add(new LanguageWidget(LANGUAGE));
|
add(new LanguageWidget(LANGUAGE));
|
||||||
|
|
||||||
add(new Label(PublicPersonalProfileGlobalizationUtil.globalize("publicpersonalprofile.ui.create.select_person")));
|
add(new Label(PublicPersonalProfileGlobalizationUtil.globalize(
|
||||||
final ParameterModel ownerModel = new StringParameter(PublicPersonalProfileBundle.OWNER);
|
"publicpersonalprofile.ui.create.select_person")));
|
||||||
|
final ParameterModel ownerModel = new
|
||||||
|
StringParameter(PublicPersonalProfileBundle.OWNER);
|
||||||
final SingleSelect ownerSelect = new SingleSelect(ownerModel);
|
final SingleSelect ownerSelect = new SingleSelect(ownerModel);
|
||||||
ownerSelect.addValidationListener(new NotNullValidationListener());
|
ownerSelect.addValidationListener(new NotNullValidationListener());
|
||||||
|
|
||||||
|
|
@ -111,9 +113,11 @@ public class PublicPersonalProfileCreate extends PageCreate {
|
||||||
if (types.size() == 0) {
|
if (types.size() == 0) {
|
||||||
personType = "com.arsdigita.cms.contenttypes.GenericPerson";
|
personType = "com.arsdigita.cms.contenttypes.GenericPerson";
|
||||||
}
|
}
|
||||||
DataCollection persons = SessionManager.getSession().retrieve(personType);
|
DataCollection persons = SessionManager.getSession()
|
||||||
|
.retrieve(personType);
|
||||||
//persons.addFilter("profile is null");
|
//persons.addFilter("profile is null");
|
||||||
persons.addFilter(String.format("version = '%s'", ContentItem.DRAFT));
|
persons.addFilter(String.format("version = '%s'",
|
||||||
|
ContentItem.DRAFT));
|
||||||
persons.addOrder("surname asc");
|
persons.addOrder("surname asc");
|
||||||
persons.addOrder("givenname asc");
|
persons.addOrder("givenname asc");
|
||||||
persons.addOrder("language asc");
|
persons.addOrder("language asc");
|
||||||
|
|
|
||||||
|
|
@ -34,7 +34,7 @@ public class PublicPersonalProfileGlobalizationUtil {
|
||||||
|
|
||||||
/** Name of Java resource files to handle PPP's globalisation. */
|
/** Name of Java resource files to handle PPP's globalisation. */
|
||||||
public static final String BUNDLE_NAME =
|
public static final String BUNDLE_NAME =
|
||||||
"com.arsdigita.cms.contenttypes.ui.PublicPersonalProfileResources";
|
"com.arsdigita.cms.contenttypes.PublicPersonalProfileResources";
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* This returns a globalized message using the package specific bundle,
|
* This returns a globalized message using the package specific bundle,
|
||||||
|
|
|
||||||
|
|
@ -49,8 +49,8 @@ public class PublicPersonalProfileMiscStep extends SimpleEditStep {
|
||||||
final BasicItemForm editPositionForm = new PublicPersonalProfileMiscEditForm(
|
final BasicItemForm editPositionForm = new PublicPersonalProfileMiscEditForm(
|
||||||
itemModel);
|
itemModel);
|
||||||
add(EDIT_MISC_SHEET_NAME,
|
add(EDIT_MISC_SHEET_NAME,
|
||||||
(String) PublicPersonalProfileGlobalizationUtil.globalize(
|
PublicPersonalProfileGlobalizationUtil.globalize(
|
||||||
"publicpersonalprofile.ui.misc.edit").localize(),
|
"publicpersonalprofile.ui.misc.edit"),
|
||||||
new WorkflowLockedComponentAccess(editPositionForm, itemModel),
|
new WorkflowLockedComponentAccess(editPositionForm, itemModel),
|
||||||
editPositionForm.getSaveCancelSection().getCancelButton());
|
editPositionForm.getSaveCancelSection().getCancelButton());
|
||||||
|
|
||||||
|
|
|
||||||
|
|
@ -93,9 +93,8 @@ public class PublicPersonalProfileNavigationAddForm
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
public void addWidgets() {
|
public void addWidgets() {
|
||||||
add(new Label((String) PublicPersonalProfileGlobalizationUtil.globalize(
|
add(new Label(PublicPersonalProfileGlobalizationUtil.globalize(
|
||||||
"publicpersonalprofile.ui.nav.select_nav_item").
|
"publicpersonalprofile.ui.nav.select_nav_item") ));
|
||||||
localize()));
|
|
||||||
ParameterModel navItemModel =
|
ParameterModel navItemModel =
|
||||||
new StringParameter(PublicPersonalProfileNavItem.KEY);
|
new StringParameter(PublicPersonalProfileNavItem.KEY);
|
||||||
SingleSelect navItemSelect = new SingleSelect(navItemModel);
|
SingleSelect navItemSelect = new SingleSelect(navItemModel);
|
||||||
|
|
@ -162,9 +161,8 @@ public class PublicPersonalProfileNavigationAddForm
|
||||||
add(navItemSelect);
|
add(navItemSelect);
|
||||||
|
|
||||||
//if (!showGenerated()) {
|
//if (!showGenerated()) {
|
||||||
add(new Label((String) PublicPersonalProfileGlobalizationUtil.globalize(
|
add(new Label(PublicPersonalProfileGlobalizationUtil.globalize(
|
||||||
"publicpersonalprofile.ui.nav.select_target").
|
"publicpersonalprofile.ui.nav.select_target") ));
|
||||||
localize()));
|
|
||||||
itemSearch = new ItemSearchWidget(ITEM_SEARCH);
|
itemSearch = new ItemSearchWidget(ITEM_SEARCH);
|
||||||
itemSearch.addValidationListener(this);
|
itemSearch.addValidationListener(this);
|
||||||
add(this.itemSearch);
|
add(this.itemSearch);
|
||||||
|
|
|
||||||
|
|
@ -51,8 +51,8 @@ public class PublicPersonalProfileNavigationStep extends SimpleEditStep {
|
||||||
new PublicPersonalProfileNavigationAddForm(itemModel,
|
new PublicPersonalProfileNavigationAddForm(itemModel,
|
||||||
this);
|
this);
|
||||||
add(EDIT_NAV_ITEM_SHEET_NAME,
|
add(EDIT_NAV_ITEM_SHEET_NAME,
|
||||||
(String) PublicPersonalProfileGlobalizationUtil.globalize(
|
PublicPersonalProfileGlobalizationUtil.globalize(
|
||||||
"publicpersonalprofile.ui.profile.content.add").localize(),
|
"publicpersonalprofile.ui.profile.content.add"),
|
||||||
new WorkflowLockedComponentAccess(editNavItemSheet, itemModel),
|
new WorkflowLockedComponentAccess(editNavItemSheet, itemModel),
|
||||||
editNavItemSheet.getSaveCancelSection().getCancelButton());
|
editNavItemSheet.getSaveCancelSection().getCancelButton());
|
||||||
|
|
||||||
|
|
|
||||||
|
|
@ -31,7 +31,6 @@ 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.ContentItem;
|
import com.arsdigita.cms.ContentItem;
|
||||||
import com.arsdigita.cms.ContentPage;
|
import com.arsdigita.cms.ContentPage;
|
||||||
import com.arsdigita.cms.ContentSection;
|
import com.arsdigita.cms.ContentSection;
|
||||||
|
|
@ -55,8 +54,7 @@ import org.apache.log4j.Logger;
|
||||||
* @author Jens Pelzetter
|
* @author Jens Pelzetter
|
||||||
* @version $Id$
|
* @version $Id$
|
||||||
*/
|
*/
|
||||||
public class PublicPersonalProfileNavigationTable
|
public class PublicPersonalProfileNavigationTable extends Table
|
||||||
extends Table
|
|
||||||
implements TableActionListener {
|
implements TableActionListener {
|
||||||
|
|
||||||
private static final Logger logger = Logger.getLogger(
|
private static final Logger logger = Logger.getLogger(
|
||||||
|
|
@ -79,20 +77,20 @@ public class PublicPersonalProfileNavigationTable
|
||||||
TableColumnModel colModel = getColumnModel();
|
TableColumnModel colModel = getColumnModel();
|
||||||
colModel.add(new TableColumn(
|
colModel.add(new TableColumn(
|
||||||
0,
|
0,
|
||||||
PublicPersonalProfileGlobalizationUtil.globalize(
|
new Label(PublicPersonalProfileGlobalizationUtil.globalize(
|
||||||
"publicpersonalprofile.ui.nav.target").localize(),
|
"publicpersonalprofile.ui.nav.target") ),
|
||||||
TABLE_COL_EDIT));
|
TABLE_COL_EDIT));
|
||||||
|
|
||||||
colModel.add(new TableColumn(
|
colModel.add(new TableColumn(
|
||||||
1,
|
1,
|
||||||
PublicPersonalProfileGlobalizationUtil.globalize(
|
new Label(PublicPersonalProfileGlobalizationUtil.globalize(
|
||||||
"publicpersonalprofile.ui.nav.targetitem").localize(),
|
"publicpersonalprofile.ui.nav.targetitem")),
|
||||||
TABLE_COL_TARGET));
|
TABLE_COL_TARGET));
|
||||||
|
|
||||||
colModel.add(new TableColumn(
|
colModel.add(new TableColumn(
|
||||||
2,
|
2,
|
||||||
PublicPersonalProfileGlobalizationUtil.globalize(
|
new Label(PublicPersonalProfileGlobalizationUtil.globalize(
|
||||||
"publicpersonalprofile.ui.nav.remove").localize(),
|
"publicpersonalprofile.ui.nav.remove")),
|
||||||
TABLE_COL_DEL));
|
TABLE_COL_DEL));
|
||||||
|
|
||||||
setModelBuilder(new PublicPersonalProfileNavigationTableModelBuilder(
|
setModelBuilder(new PublicPersonalProfileNavigationTableModelBuilder(
|
||||||
|
|
@ -193,8 +191,11 @@ public class PublicPersonalProfileNavigationTable
|
||||||
return targetItem;
|
return targetItem;
|
||||||
}
|
}
|
||||||
case 2:
|
case 2:
|
||||||
return PublicPersonalProfileGlobalizationUtil.globalize(
|
// return PublicPersonalProfileGlobalizationUtil.globalize(
|
||||||
"publicpersonalprofile.ui.nav.remove").localize();
|
// "publicpersonalprofile.ui.nav.remove").localize();
|
||||||
|
return new Label(
|
||||||
|
PublicPersonalProfileGlobalizationUtil.globalize(
|
||||||
|
"publicpersonalprofile.ui.nav.remove"));
|
||||||
default:
|
default:
|
||||||
return null;
|
return null;
|
||||||
}
|
}
|
||||||
|
|
@ -222,7 +223,8 @@ public class PublicPersonalProfileNavigationTable
|
||||||
int col) {
|
int col) {
|
||||||
//com.arsdigita.cms.SecurityManager securityManager = Utilities.getSecurityManager(state);
|
//com.arsdigita.cms.SecurityManager securityManager = Utilities.getSecurityManager(state);
|
||||||
|
|
||||||
return new Label((String) value);
|
// return new Label((String) value);
|
||||||
|
return (Component)value;
|
||||||
}
|
}
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
@ -293,13 +295,14 @@ public class PublicPersonalProfileNavigationTable
|
||||||
|
|
||||||
if (canDelete) {
|
if (canDelete) {
|
||||||
ControlLink link = new ControlLink(value.toString());
|
ControlLink link = new ControlLink(value.toString());
|
||||||
link.setConfirmation((String) PublicPersonalProfileGlobalizationUtil.
|
link.setConfirmation(PublicPersonalProfileGlobalizationUtil.
|
||||||
globalize("publicpersonalprofile.ui.nav.remove.confirm").
|
globalize("publicpersonalprofile.ui.nav.remove.confirm")
|
||||||
localize());
|
);
|
||||||
return link;
|
return link;
|
||||||
} else {
|
} else {
|
||||||
Label label = new Label(value.toString());
|
// Label label = new Label(value.toString());
|
||||||
return label;
|
// return label;
|
||||||
|
return (Component)value;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
||||||
|
|
@ -20,7 +20,6 @@ package com.arsdigita.cms.contenttypes.ui;
|
||||||
|
|
||||||
import com.arsdigita.bebop.FormData;
|
import com.arsdigita.bebop.FormData;
|
||||||
import com.arsdigita.bebop.FormProcessException;
|
import com.arsdigita.bebop.FormProcessException;
|
||||||
import com.arsdigita.bebop.FormSection;
|
|
||||||
import com.arsdigita.bebop.Label;
|
import com.arsdigita.bebop.Label;
|
||||||
import com.arsdigita.bebop.PageState;
|
import com.arsdigita.bebop.PageState;
|
||||||
import com.arsdigita.bebop.event.FormInitListener;
|
import com.arsdigita.bebop.event.FormInitListener;
|
||||||
|
|
|
||||||
|
|
@ -50,8 +50,8 @@ public class PublicPersonalProfilePositionStep extends SimpleEditStep {
|
||||||
final BasicItemForm editPositionForm = new PublicPersonalProfilePositionEditForm(
|
final BasicItemForm editPositionForm = new PublicPersonalProfilePositionEditForm(
|
||||||
itemModel);
|
itemModel);
|
||||||
add(EDIT_POSITION_SHEET_NAME,
|
add(EDIT_POSITION_SHEET_NAME,
|
||||||
(String) PublicPersonalProfileGlobalizationUtil.globalize(
|
PublicPersonalProfileGlobalizationUtil.globalize(
|
||||||
"publicpersonalprofile.ui.position.edit").localize(),
|
"publicpersonalprofile.ui.position.edit"),
|
||||||
new WorkflowLockedComponentAccess(editPositionForm, itemModel),
|
new WorkflowLockedComponentAccess(editPositionForm, itemModel),
|
||||||
editPositionForm.getSaveCancelSection().getCancelButton());
|
editPositionForm.getSaveCancelSection().getCancelButton());
|
||||||
|
|
||||||
|
|
|
||||||
|
|
@ -59,22 +59,19 @@ public class PublicPersonalProfilePropertiesStep extends SimpleEditStep {
|
||||||
BasicPageForm editBasicSheet =
|
BasicPageForm editBasicSheet =
|
||||||
new PublicPersonalProfilePropertyForm(itemModel,
|
new PublicPersonalProfilePropertyForm(itemModel,
|
||||||
this);
|
this);
|
||||||
basicProperties.add(EDIT_SHEET_NAME,
|
basicProperties.add(
|
||||||
(String) PublicPersonalProfileGlobalizationUtil.
|
EDIT_SHEET_NAME,
|
||||||
globalize(
|
PublicPersonalProfileGlobalizationUtil.globalize(
|
||||||
"publicpersonalprofile.ui.profile.edit_basic_properties").
|
"publicpersonalprofile.ui.profile.edit_basic_properties"),
|
||||||
localize(),
|
new WorkflowLockedComponentAccess(editBasicSheet,itemModel),
|
||||||
new WorkflowLockedComponentAccess(editBasicSheet,
|
editBasicSheet.getSaveCancelSection().getCancelButton());
|
||||||
itemModel),
|
|
||||||
editBasicSheet.getSaveCancelSection().
|
|
||||||
getCancelButton());
|
|
||||||
|
|
||||||
basicProperties.setDisplayComponent(getPublicPersonalProfilePropertySheet(
|
basicProperties.setDisplayComponent(getPublicPersonalProfilePropertySheet(
|
||||||
itemModel));
|
itemModel));
|
||||||
|
|
||||||
segmentedPanel.addSegment(new Label((String) PublicPersonalProfileGlobalizationUtil.
|
segmentedPanel.addSegment(new Label(PublicPersonalProfileGlobalizationUtil.
|
||||||
globalize("publicpersonalprofile.ui.profile.basic_properties").
|
globalize("publicpersonalprofile.ui.profile.basic_properties")),
|
||||||
localize()), basicProperties);
|
basicProperties);
|
||||||
|
|
||||||
setDisplayComponent(segmentedPanel);
|
setDisplayComponent(segmentedPanel);
|
||||||
}
|
}
|
||||||
|
|
|
||||||
|
|
@ -51,9 +51,9 @@ public class PublicPersonalProfileResearchInterestsStep extends SimpleEditStep {
|
||||||
final BasicItemForm editRiForm =
|
final BasicItemForm editRiForm =
|
||||||
new PublicPersonalProfileResearchInterestsEditForm
|
new PublicPersonalProfileResearchInterestsEditForm
|
||||||
(itemModel);
|
(itemModel);
|
||||||
add(EDIT_RI_SHEET_NAME, (String) PublicPersonalProfileGlobalizationUtil.
|
add(EDIT_RI_SHEET_NAME,
|
||||||
globalize("publicpersonalprofile.ui.research_interests.edit").
|
PublicPersonalProfileGlobalizationUtil.globalize(
|
||||||
localize(),
|
"publicpersonalprofile.ui.research_interests.edit"),
|
||||||
new WorkflowLockedComponentAccess(editRiForm, itemModel),
|
new WorkflowLockedComponentAccess(editRiForm, itemModel),
|
||||||
editRiForm.getSaveCancelSection().getCancelButton());
|
editRiForm.getSaveCancelSection().getCancelButton());
|
||||||
|
|
||||||
|
|
|
||||||
|
|
@ -62,8 +62,11 @@ public class ContentType extends ACSObject {
|
||||||
public static final String BASE_DATA_OBJECT_TYPE =
|
public static final String BASE_DATA_OBJECT_TYPE =
|
||||||
"com.arsdigita.cms.ContentType";
|
"com.arsdigita.cms.ContentType";
|
||||||
public static final String OBJECT_TYPE = "associatedObjectType";
|
public static final String OBJECT_TYPE = "associatedObjectType";
|
||||||
|
/** The name or title of the content type, e.g. "File Storage Item" */
|
||||||
public static final String LABEL = "label";
|
public static final String LABEL = "label";
|
||||||
|
/** A short description of the type, what is is meant to do / to use for. */
|
||||||
public static final String DESCRIPTION = "description";
|
public static final String DESCRIPTION = "description";
|
||||||
|
/** Fully qualified name of the (main) domain class (and main entry point)*/
|
||||||
public static final String CLASSNAME = "className";
|
public static final String CLASSNAME = "className";
|
||||||
public static final String MODE = "mode";
|
public static final String MODE = "mode";
|
||||||
public static final String AUTHORING_KIT = "authoringKit";
|
public static final String AUTHORING_KIT = "authoringKit";
|
||||||
|
|
|
||||||
|
|
@ -39,7 +39,7 @@ import java.util.StringTokenizer;
|
||||||
/**
|
/**
|
||||||
* Displays a list of label-value pairs, which represent the attributes
|
* Displays a list of label-value pairs, which represent the attributes
|
||||||
* of a domain object.
|
* of a domain object.
|
||||||
* <p>
|
*
|
||||||
* Typical usage is
|
* Typical usage is
|
||||||
* <blockquote><pre><code>
|
* <blockquote><pre><code>
|
||||||
* DomainObjectPropertySheet mySheet =
|
* DomainObjectPropertySheet mySheet =
|
||||||
|
|
@ -47,20 +47,22 @@ import java.util.StringTokenizer;
|
||||||
* mySheet.add("Name:", ContentPage.NAME);
|
* mySheet.add("Name:", ContentPage.NAME);
|
||||||
* mySheet.add("Title:", ContentPage.TITLE);
|
* mySheet.add("Title:", ContentPage.TITLE);
|
||||||
* </code></pre></blockquote>
|
* </code></pre></blockquote>
|
||||||
|
*
|
||||||
* The first argument is the visible label for the property, and
|
* The first argument is the visible label for the property, and
|
||||||
* the second argument is the name of the property as it appears in
|
* the second argument is the name of the property as it appears in
|
||||||
* the PDL file.
|
* the PDL file.
|
||||||
* <p>
|
*
|
||||||
* Instead of specifying the property directly, you may specify the "path"
|
* Instead of specifying the property directly, you may specify the "path"
|
||||||
* to the property. For example,
|
* to the property. For example,
|
||||||
* <blockquote><pre><code>
|
* <blockquote><pre><code>
|
||||||
* mySheet.add("Address Line 1:", "user.address.street");
|
* mySheet.add("Address Line 1:", "user.address.street");
|
||||||
* </code></pre></blockquote>
|
* </code></pre></blockquote>
|
||||||
|
*
|
||||||
* The code above tells the <code>DomainObjectPropertySheet</code> to look for
|
* The code above tells the <code>DomainObjectPropertySheet</code> to look for
|
||||||
* the child of the current object named "user"; then look for the child
|
* the child of the current object named "user"; then look for the child
|
||||||
* of the user named "address", and finally to return the property of
|
* of the user named "address", and finally to return the property of
|
||||||
* the address named "street".
|
* the address named "street".
|
||||||
* <p>
|
*
|
||||||
* Note that, by default, <code>DomainObjectPropertySheet</code> retrieves
|
* Note that, by default, <code>DomainObjectPropertySheet</code> retrieves
|
||||||
* the values for its properties directly from the underlying {@link DataObject}
|
* the values for its properties directly from the underlying {@link DataObject}
|
||||||
* of the {@link DomainObject}. This means that the Java <code>getXXX</code>
|
* of the {@link DomainObject}. This means that the Java <code>getXXX</code>
|
||||||
|
|
@ -69,8 +71,8 @@ import java.util.StringTokenizer;
|
||||||
* will call the appropriate methods.
|
* will call the appropriate methods.
|
||||||
*
|
*
|
||||||
* @author Stanislav Freidin
|
* @author Stanislav Freidin
|
||||||
|
* @author Peter Boy (localization)
|
||||||
* @version $Id: DomainObjectPropertySheet.java 287 2005-02-22 00:29:02Z sskracic $
|
* @version $Id: DomainObjectPropertySheet.java 287 2005-02-22 00:29:02Z sskracic $
|
||||||
*
|
|
||||||
*/
|
*/
|
||||||
public class DomainObjectPropertySheet extends PropertySheet {
|
public class DomainObjectPropertySheet extends PropertySheet {
|
||||||
|
|
||||||
|
|
@ -84,7 +86,6 @@ public class DomainObjectPropertySheet extends PropertySheet {
|
||||||
*
|
*
|
||||||
* @param objModel The selection model which feeds domain objects to this
|
* @param objModel The selection model which feeds domain objects to this
|
||||||
* property sheet.
|
* property sheet.
|
||||||
*
|
|
||||||
*/
|
*/
|
||||||
public DomainObjectPropertySheet(DomainObjectSelectionModel objModel) {
|
public DomainObjectPropertySheet(DomainObjectSelectionModel objModel) {
|
||||||
this(objModel, false);
|
this(objModel, false);
|
||||||
|
|
@ -97,10 +98,10 @@ public class DomainObjectPropertySheet extends PropertySheet {
|
||||||
* property sheet
|
* property sheet
|
||||||
* @param valueOutputEscape The value of the label-value pair(i.e.,
|
* @param valueOutputEscape The value of the label-value pair(i.e.,
|
||||||
* column[1])'s output-escaping
|
* column[1])'s output-escaping
|
||||||
*
|
|
||||||
*/
|
*/
|
||||||
public DomainObjectPropertySheet(
|
public DomainObjectPropertySheet( DomainObjectSelectionModel objModel,
|
||||||
DomainObjectSelectionModel objModel, boolean valueOutputEscape) {
|
boolean valueOutputEscape) {
|
||||||
|
|
||||||
super(new DomainObjectModelBuilder(), valueOutputEscape);
|
super(new DomainObjectModelBuilder(), valueOutputEscape);
|
||||||
|
|
||||||
m_objModel = objModel;
|
m_objModel = objModel;
|
||||||
|
|
@ -177,7 +178,8 @@ public class DomainObjectPropertySheet extends PropertySheet {
|
||||||
* PDL property)
|
* PDL property)
|
||||||
* @param formatter An instance of AttributeFormatter
|
* @param formatter An instance of AttributeFormatter
|
||||||
*/
|
*/
|
||||||
public void add(GlobalizedMessage label, String attribute,
|
public void add(GlobalizedMessage label,
|
||||||
|
String attribute,
|
||||||
AttributeFormatter f) {
|
AttributeFormatter f) {
|
||||||
m_props.add(new Property(label, attribute, f));
|
m_props.add(new Property(label, attribute, f));
|
||||||
}
|
}
|
||||||
|
|
@ -234,6 +236,13 @@ public class DomainObjectPropertySheet extends PropertySheet {
|
||||||
private String m_attr;
|
private String m_attr;
|
||||||
private AttributeFormatter m_formatter;
|
private AttributeFormatter m_formatter;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Constructor, takes the set of parameter to create a new Property.
|
||||||
|
*
|
||||||
|
* @param l the lebael for the attribute
|
||||||
|
* @param a the attribute (as String, i.e name of the property)
|
||||||
|
* @param f the formatter to convert the attribute a into a String
|
||||||
|
*/
|
||||||
public Property(GlobalizedMessage l, String a, AttributeFormatter f) {
|
public Property(GlobalizedMessage l, String a, AttributeFormatter f) {
|
||||||
m_label = l;
|
m_label = l;
|
||||||
m_attr = a;
|
m_attr = a;
|
||||||
|
|
@ -247,22 +256,38 @@ public class DomainObjectPropertySheet extends PropertySheet {
|
||||||
return m_label.getKey();
|
return m_label.getKey();
|
||||||
}
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Fetch the (globalizes) label of the property.
|
||||||
|
* @return
|
||||||
|
*/
|
||||||
public GlobalizedMessage getGlobalizedLabel() {
|
public GlobalizedMessage getGlobalizedLabel() {
|
||||||
return m_label;
|
return m_label;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Fetch the attribute.
|
||||||
|
*
|
||||||
|
* @return name of the attribute (a String)
|
||||||
|
*/
|
||||||
public String getAttribute() {
|
public String getAttribute() {
|
||||||
return m_attr;
|
return m_attr;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Fetch the formatter for the attribute
|
||||||
|
* @return
|
||||||
|
*/
|
||||||
public AttributeFormatter getFormatter() {
|
public AttributeFormatter getFormatter() {
|
||||||
return m_formatter;
|
return m_formatter;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
// Build up the object properties model from the iterator over all properties
|
/**
|
||||||
private static class DomainObjectPropertiesModel implements
|
* Build up the object properties model from the iterator over all
|
||||||
PropertySheetModel {
|
* properties.
|
||||||
|
*/
|
||||||
|
private static class DomainObjectPropertiesModel
|
||||||
|
implements PropertySheetModel {
|
||||||
|
|
||||||
private DomainObject m_obj;
|
private DomainObject m_obj;
|
||||||
private PageState m_state;
|
private PageState m_state;
|
||||||
|
|
@ -271,14 +296,25 @@ public class DomainObjectPropertySheet extends PropertySheet {
|
||||||
private static String ERROR =
|
private static String ERROR =
|
||||||
"No current property. Make sure that nextRow() was called at least once.";
|
"No current property. Make sure that nextRow() was called at least once.";
|
||||||
|
|
||||||
public DomainObjectPropertiesModel(
|
/**
|
||||||
DomainObject obj, Iterator props, PageState state) {
|
*
|
||||||
|
* @param obj
|
||||||
|
* @param props
|
||||||
|
* @param state
|
||||||
|
*/
|
||||||
|
public DomainObjectPropertiesModel( DomainObject obj,
|
||||||
|
Iterator props,
|
||||||
|
PageState state) {
|
||||||
m_obj = obj;
|
m_obj = obj;
|
||||||
m_props = props;
|
m_props = props;
|
||||||
m_state = state;
|
m_state = state;
|
||||||
m_current = null;
|
m_current = null;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
*
|
||||||
|
* @return
|
||||||
|
*/
|
||||||
public boolean nextRow() {
|
public boolean nextRow() {
|
||||||
if (!m_props.hasNext()) {
|
if (!m_props.hasNext()) {
|
||||||
return false;
|
return false;
|
||||||
|
|
@ -295,6 +331,10 @@ public class DomainObjectPropertySheet extends PropertySheet {
|
||||||
return getGlobalizedLabel().getKey();
|
return getGlobalizedLabel().getKey();
|
||||||
}
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
*
|
||||||
|
* @return
|
||||||
|
*/
|
||||||
public GlobalizedMessage getGlobalizedLabel() {
|
public GlobalizedMessage getGlobalizedLabel() {
|
||||||
if (m_current == null) {
|
if (m_current == null) {
|
||||||
throw new IllegalStateException(ERROR);
|
throw new IllegalStateException(ERROR);
|
||||||
|
|
@ -302,6 +342,10 @@ public class DomainObjectPropertySheet extends PropertySheet {
|
||||||
return m_current.getGlobalizedLabel();
|
return m_current.getGlobalizedLabel();
|
||||||
}
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
*
|
||||||
|
* @return
|
||||||
|
*/
|
||||||
public String getValue() {
|
public String getValue() {
|
||||||
if (m_current == null) {
|
if (m_current == null) {
|
||||||
throw new IllegalStateException(ERROR);
|
throw new IllegalStateException(ERROR);
|
||||||
|
|
@ -312,7 +356,9 @@ public class DomainObjectPropertySheet extends PropertySheet {
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
// Builds an DomainObjectPropertiesModel
|
/**
|
||||||
|
* Builds an DomainObjectPropertiesModel.
|
||||||
|
*/
|
||||||
private static class DomainObjectModelBuilder extends LockableImpl
|
private static class DomainObjectModelBuilder extends LockableImpl
|
||||||
implements PropertySheetModelBuilder {
|
implements PropertySheetModelBuilder {
|
||||||
|
|
||||||
|
|
@ -325,72 +371,128 @@ public class DomainObjectPropertySheet extends PropertySheet {
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
// Abstract formatter which maintains a "default" string
|
/**
|
||||||
|
* Abstract AttributeFormatter class which maintains a "default" value for
|
||||||
|
* the attribute. The default value is a GlobalizedMessage, which will be
|
||||||
|
* formatted to a String by the default format method.
|
||||||
|
*/
|
||||||
private static abstract class DefaultAttributeFormatter
|
private static abstract class DefaultAttributeFormatter
|
||||||
extends DomainService
|
extends DomainService
|
||||||
implements AttributeFormatter {
|
implements AttributeFormatter {
|
||||||
|
|
||||||
private String m_default;
|
private GlobalizedMessage m_default;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Default Constructor which creates a default GlobalizedMessage to
|
||||||
|
* be used as default value for an attribute.
|
||||||
|
*/
|
||||||
public DefaultAttributeFormatter() {
|
public DefaultAttributeFormatter() {
|
||||||
this((String)GlobalizationUtil.globalize("cms.ui.unknown").localize());
|
m_default = new GlobalizedMessage(
|
||||||
|
"toolbox.ui.na",
|
||||||
|
"com.arsdigita.toolbox.ui.ToolboxResources");
|
||||||
}
|
}
|
||||||
|
|
||||||
public DefaultAttributeFormatter(String def) {
|
/**
|
||||||
|
* Constructor which takes a custom GlobalizedMessage to be used as a
|
||||||
|
* default value.
|
||||||
|
*
|
||||||
|
* @param def GlobalizedMessage used as default value
|
||||||
|
*/
|
||||||
|
public DefaultAttributeFormatter(GlobalizedMessage def) {
|
||||||
m_default = def;
|
m_default = def;
|
||||||
}
|
}
|
||||||
|
|
||||||
public String getDefaultString() {
|
public GlobalizedMessage getDefaultValue() {
|
||||||
return m_default;
|
return m_default;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
// A simple attribute formatter that calls get on the object with the
|
/**
|
||||||
// specified attribute
|
* A simple attribute formatter that calls get on the object with the
|
||||||
|
* specified attribute.
|
||||||
|
*/
|
||||||
private static class SimpleAttributeFormatter
|
private static class SimpleAttributeFormatter
|
||||||
extends DefaultAttributeFormatter {
|
extends DefaultAttributeFormatter {
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Constructor, simply calls the super class. Uses a default value for
|
||||||
|
* empty attributes.
|
||||||
|
*/
|
||||||
public SimpleAttributeFormatter() {
|
public SimpleAttributeFormatter() {
|
||||||
super();
|
super();
|
||||||
}
|
}
|
||||||
|
|
||||||
public SimpleAttributeFormatter(String def) {
|
/**
|
||||||
|
* Constructor which takes a custom GlobalizedMessage to be used as a
|
||||||
|
* default value.
|
||||||
|
*
|
||||||
|
* @param def GlobalizedMessage used as default value
|
||||||
|
*/
|
||||||
|
public SimpleAttributeFormatter(GlobalizedMessage def) {
|
||||||
super(def);
|
super(def);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Formatter method, invoked at every page request!
|
||||||
|
*
|
||||||
|
* @param obj
|
||||||
|
* @param attribute
|
||||||
|
* @param state
|
||||||
|
* @return
|
||||||
|
*/
|
||||||
public String format(DomainObject obj, String attribute, PageState state) {
|
public String format(DomainObject obj, String attribute, PageState state) {
|
||||||
if (obj == null) {
|
|
||||||
return getDefaultString();
|
|
||||||
}
|
|
||||||
|
|
||||||
|
/* Determine the default value */
|
||||||
|
GlobalizedMessage defaultMsg = getDefaultValue();
|
||||||
Object value = get(obj, attribute);
|
Object value = get(obj, attribute);
|
||||||
|
|
||||||
if (value == null) {
|
if (value == null) {
|
||||||
return getDefaultString();
|
return (String)defaultMsg.localize();
|
||||||
} else {
|
} else {
|
||||||
return value.toString();
|
return value.toString();
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
// A more advanced attribute formatter. Folows the path to the value
|
/**
|
||||||
// by following the names in the attribute string. For example, if
|
* A more advanced attribute formatter. Follows the path to the value
|
||||||
// the string says "foo.bar.baz", the formatter will attempt to call
|
* by following the names in the attribute string. For example, if
|
||||||
// obj.get("foo").get("bar").get("baz");
|
* the string says "foo.bar.baz", the formatter will attempt to call
|
||||||
|
* obj.get("foo").get("bar").get("baz");
|
||||||
|
*/
|
||||||
private static class RecursiveAttributeFormatter
|
private static class RecursiveAttributeFormatter
|
||||||
extends DefaultAttributeFormatter {
|
extends DefaultAttributeFormatter {
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Constructor, simply calls the super class. Uses a default value for
|
||||||
|
* empty attributes.
|
||||||
|
*/
|
||||||
public RecursiveAttributeFormatter() {
|
public RecursiveAttributeFormatter() {
|
||||||
super();
|
super();
|
||||||
}
|
}
|
||||||
|
|
||||||
public RecursiveAttributeFormatter(String def) {
|
/**
|
||||||
|
* Constructor which takes a custom GlobalizedMessage to be used as a
|
||||||
|
* default value.
|
||||||
|
*
|
||||||
|
* @param def GlobalizedMessage used as default value
|
||||||
|
*/
|
||||||
|
public RecursiveAttributeFormatter(GlobalizedMessage def) {
|
||||||
super(def);
|
super(def);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Formatter method, invoked at every page request!
|
||||||
|
*
|
||||||
|
* @param obj
|
||||||
|
* @param attribute
|
||||||
|
* @param state
|
||||||
|
* @return
|
||||||
|
*/
|
||||||
public String format(DomainObject obj, String attribute, PageState state) {
|
public String format(DomainObject obj, String attribute, PageState state) {
|
||||||
|
|
||||||
if (obj == null) {
|
if (obj == null) {
|
||||||
return getDefaultString();
|
return (String)getDefaultValue().localize();
|
||||||
}
|
}
|
||||||
|
|
||||||
StringTokenizer tokenizer = new StringTokenizer(attribute, ".");
|
StringTokenizer tokenizer = new StringTokenizer(attribute, ".");
|
||||||
|
|
@ -402,13 +504,13 @@ public class DomainObjectPropertySheet extends PropertySheet {
|
||||||
// Null check
|
// Null check
|
||||||
value = ((DataObject) value).get(token);
|
value = ((DataObject) value).get(token);
|
||||||
if (value == null) {
|
if (value == null) {
|
||||||
return getDefaultString();
|
return (String)getDefaultValue().localize();
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
// Extract leaf value
|
// Extract leaf value
|
||||||
if (token == null || value == null) {
|
if (token == null || value == null) {
|
||||||
return getDefaultString();
|
return (String)getDefaultValue().localize();
|
||||||
}
|
}
|
||||||
|
|
||||||
return value.toString();
|
return value.toString();
|
||||||
|
|
|
||||||
|
|
@ -1,3 +1,2 @@
|
||||||
toolbox.ui.na=N/A
|
toolbox.ui.na=N/A
|
||||||
toolbox.ui.no_results=No Results.
|
toolbox.ui.no_results=No Results.
|
||||||
cms.ui.unknown=<em>unknown</em>
|
|
||||||
|
|
|
||||||
|
|
@ -1,3 +1,2 @@
|
||||||
toolbox.ui.na=N/A
|
toolbox.ui.na=(nicht eingetragen)
|
||||||
toolbox.ui.no_results=Keine Ergebnisse.
|
toolbox.ui.no_results=Keine Ergebnisse.
|
||||||
cms.ui.unknown=<em>unbekannt</em>
|
|
||||||
|
|
|
||||||
|
|
@ -1,3 +1,2 @@
|
||||||
toolbox.ui.na=N/A
|
toolbox.ui.na=N/A
|
||||||
toolbox.ui.no_results=Pas de r\u00e9sultats
|
toolbox.ui.no_results=Pas de r\u00e9sultats
|
||||||
cms.ui.unknown=
|
|
||||||
|
|
|
||||||
|
|
@ -29,3 +29,7 @@ london.contenttypes.ui.contact.phonetable.header_delete=Delete
|
||||||
london.contenttypes.ui.contact.phonetable.confirm_delete=Delete this Phone?
|
london.contenttypes.ui.contact.phonetable.confirm_delete=Delete this Phone?
|
||||||
london.contenttypes.ui.contact.phonetable.link_delete=delete
|
london.contenttypes.ui.contact.phonetable.link_delete=delete
|
||||||
london.contenttypes.ui.contact.phonetable.delete_confirmation=Delete this Phone?
|
london.contenttypes.ui.contact.phonetable.delete_confirmation=Delete this Phone?
|
||||||
|
london.contenttypes.ui.contact.remove_contact=Remove contact
|
||||||
|
london.contenttypes.ui.contact.search_contact_label=Search for Contact:
|
||||||
|
london.contenttypes.ui.contact.no_contacts_yet=This item does not have a contact.
|
||||||
|
london.contenttypes.ui.contact.add_contact=Add
|
||||||
|
|
|
||||||
|
|
@ -21,7 +21,7 @@ london.contenttypes.ui.contact.emails=E-Mail
|
||||||
com.arsdigita.london.contenttypes.contact_authoring_step_description=Kontakteintrag
|
com.arsdigita.london.contenttypes.contact_authoring_step_description=Kontakteintrag
|
||||||
com.arsdigita.london.contenttypes.contact_authoring_step_label=Kontakt
|
com.arsdigita.london.contenttypes.contact_authoring_step_label=Kontakt
|
||||||
com.arsdigita.london.contenttypes.ui.contact.select_contact=Einen Kontakt ausw\u00e4hlen
|
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.add_phone_button=Telefonnummer hinzuf\u00fcgen
|
||||||
london.contenttypes.ui.contact.phonetable.no_entries_msg=Es sind keine Telefonnummer mit diesem Kontakt verkn\u00fcpft.
|
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_type=Telefon Typ
|
||||||
london.contenttypes.ui.contact.phonetable.header_num=Telefonnummer
|
london.contenttypes.ui.contact.phonetable.header_num=Telefonnummer
|
||||||
|
|
@ -29,3 +29,7 @@ london.contenttypes.ui.contact.phonetable.header_delete=L\u00f6schen
|
||||||
london.contenttypes.ui.contact.phonetable.confirm_delete=Delete this Phone?
|
london.contenttypes.ui.contact.phonetable.confirm_delete=Delete this Phone?
|
||||||
london.contenttypes.ui.contact.phonetable.link_delete=l\u00f6schen
|
london.contenttypes.ui.contact.phonetable.link_delete=l\u00f6schen
|
||||||
london.contenttypes.ui.contact.phonetable.delete_confirmation=Diesen Eintrag l\u00f6schen?
|
london.contenttypes.ui.contact.phonetable.delete_confirmation=Diesen Eintrag l\u00f6schen?
|
||||||
|
london.contenttypes.ui.contact.remove_contact=Kontakt entfernen
|
||||||
|
london.contenttypes.ui.contact.search_contact_label=Nach Kontakt suchen:
|
||||||
|
london.contenttypes.ui.contact.no_contacts_yet=es ist kein Kontakt zugeordnet.
|
||||||
|
london.contenttypes.ui.contact.add_contact=Hinzuf\u00fcgen
|
||||||
|
|
|
||||||
|
|
@ -29,3 +29,7 @@ london.contenttypes.ui.contact.phonetable.header_delete=Delete
|
||||||
london.contenttypes.ui.contact.phonetable.confirm_delete=Delete this Phone?
|
london.contenttypes.ui.contact.phonetable.confirm_delete=Delete this Phone?
|
||||||
london.contenttypes.ui.contact.phonetable.link_delete=delete
|
london.contenttypes.ui.contact.phonetable.link_delete=delete
|
||||||
london.contenttypes.ui.contact.phonetable.delete_confirmation=Delete this Phone?
|
london.contenttypes.ui.contact.phonetable.delete_confirmation=Delete this Phone?
|
||||||
|
london.contenttypes.ui.contact.remove_contact=Remove contact
|
||||||
|
london.contenttypes.ui.contact.search_contact_label=Search for Contact:
|
||||||
|
london.contenttypes.ui.contact.no_contacts_yet=This item does not have a contact.
|
||||||
|
london.contenttypes.ui.contact.add_contact=Add
|
||||||
|
|
|
||||||
|
|
@ -109,7 +109,8 @@ public class ContactPropertiesAddStep extends ResettableContainer {
|
||||||
m_contact = new RequestLocal() {
|
m_contact = new RequestLocal() {
|
||||||
@Override
|
@Override
|
||||||
protected Object initialValue(PageState s) {
|
protected Object initialValue(PageState s) {
|
||||||
ContentItem item = (ContentItem) ((ItemSelectionModel) getSingleSelectionModel())
|
ContentItem item = (ContentItem) (
|
||||||
|
(ItemSelectionModel) getSingleSelectionModel())
|
||||||
.getSelectedObject(s);
|
.getSelectedObject(s);
|
||||||
Assert.exists(item);
|
Assert.exists(item);
|
||||||
return Contact.getContactForItem(item);
|
return Contact.getContactForItem(item);
|
||||||
|
|
@ -166,7 +167,8 @@ public class ContactPropertiesAddStep extends ResettableContainer {
|
||||||
|
|
||||||
private void addWidgets() {
|
private void addWidgets() {
|
||||||
m_contactPropertySheet = getContactPropertySheet(m_contactSelectionModel);
|
m_contactPropertySheet = getContactPropertySheet(m_contactSelectionModel);
|
||||||
m_noContact = new Label("This item does not have a contact.");
|
m_noContact = new Label(ContactGlobalizationUtil.globalize(
|
||||||
|
"london.contenttypes.ui.contact.no_contacts_yet"));
|
||||||
m_noContact.setFontWeight(Label.ITALIC);
|
m_noContact.setFontWeight(Label.ITALIC);
|
||||||
add(m_contactPropertySheet);
|
add(m_contactPropertySheet);
|
||||||
add(m_noContact);
|
add(m_noContact);
|
||||||
|
|
@ -188,60 +190,63 @@ public class ContactPropertiesAddStep extends ResettableContainer {
|
||||||
private Component getContactPropertySheet(ItemSelectionModel itemModel) {
|
private Component getContactPropertySheet(ItemSelectionModel itemModel) {
|
||||||
DomainObjectPropertySheet sheet = new DomainObjectPropertySheet(
|
DomainObjectPropertySheet sheet = new DomainObjectPropertySheet(
|
||||||
itemModel);
|
itemModel);
|
||||||
sheet.add(ContactGlobalizationUtil
|
sheet.add(ContactGlobalizationUtil.globalize(
|
||||||
.globalize("com.arsdigita.london.contenttypes.ui.name"),
|
"com.arsdigita.london.contenttypes.ui.name"),
|
||||||
Contact.NAME);
|
Contact.NAME);
|
||||||
|
|
||||||
sheet.add(ContactGlobalizationUtil
|
sheet.add(ContactGlobalizationUtil.globalize(
|
||||||
.globalize("com.arsdigita.london.contenttypes.ui.title"),
|
"com.arsdigita.london.contenttypes.ui.title"),
|
||||||
Contact.TITLE);
|
Contact.TITLE);
|
||||||
|
|
||||||
sheet.add(ContactGlobalizationUtil
|
sheet.add(ContactGlobalizationUtil.globalize(
|
||||||
.globalize("com.arsdigita.london.contenttypes.ui.contact_givenname"),
|
"com.arsdigita.london.contenttypes.ui.contact_givenname"),
|
||||||
Contact.GIVEN_NAME);
|
Contact.GIVEN_NAME);
|
||||||
|
|
||||||
sheet.add(ContactGlobalizationUtil
|
sheet.add(ContactGlobalizationUtil.globalize(
|
||||||
.globalize("com.arsdigita.london.contenttypes.ui.contact_familyname"),
|
"com.arsdigita.london.contenttypes.ui.contact_familyname"),
|
||||||
Contact.FAMILY_NAME);
|
Contact.FAMILY_NAME);
|
||||||
|
|
||||||
sheet.add(ContactGlobalizationUtil
|
sheet.add(ContactGlobalizationUtil.globalize(
|
||||||
.globalize("com.arsdigita.london.contenttypes.ui.contact_type"),
|
"com.arsdigita.london.contenttypes.ui.contact_type"),
|
||||||
Contact.CONTACT_TYPE,
|
Contact.CONTACT_TYPE,
|
||||||
new DomainObjectPropertySheet.AttributeFormatter() {
|
new DomainObjectPropertySheet.AttributeFormatter() {
|
||||||
public String format(DomainObject item,
|
public String format(DomainObject item,
|
||||||
String attribute, PageState state) {
|
String attribute,
|
||||||
|
PageState state) {
|
||||||
Contact contact = (Contact) item;
|
Contact contact = (Contact) item;
|
||||||
if (contact != null
|
if (contact != null
|
||||||
&& contact.getContactType() != null) {
|
&& contact.getContactType() != null) {
|
||||||
return contact.getContactTypeName();
|
return contact.getContactTypeName();
|
||||||
} else {
|
} else {
|
||||||
return "unknown";
|
return (String)GlobalizationUtil
|
||||||
|
.globalize("cms.ui.unknown")
|
||||||
|
.localize();
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
});
|
});
|
||||||
|
|
||||||
sheet.add(ContactGlobalizationUtil
|
sheet.add(ContactGlobalizationUtil.globalize(
|
||||||
.globalize("com.arsdigita.london.contenttypes.ui.description"),
|
"com.arsdigita.london.contenttypes.ui.description"),
|
||||||
Contact.DESCRIPTION);
|
Contact.DESCRIPTION);
|
||||||
|
|
||||||
sheet.add(ContactGlobalizationUtil
|
sheet.add(ContactGlobalizationUtil.globalize(
|
||||||
.globalize("com.arsdigita.london.contenttypes.ui.contact_emails"),
|
"com.arsdigita.london.contenttypes.ui.contact_emails"),
|
||||||
Contact.EMAILS);
|
Contact.EMAILS);
|
||||||
|
|
||||||
sheet.add(ContactGlobalizationUtil
|
sheet.add(ContactGlobalizationUtil.globalize(
|
||||||
.globalize("com.arsdigita.london.contenttypes.ui.contact_suffix"),
|
"com.arsdigita.london.contenttypes.ui.contact_suffix"),
|
||||||
Contact.SUFFIX);
|
Contact.SUFFIX);
|
||||||
|
|
||||||
sheet.add(ContactGlobalizationUtil
|
sheet.add(ContactGlobalizationUtil.globalize(
|
||||||
.globalize("com.arsdigita.london.contenttypes.ui.contact_orgname"),
|
"com.arsdigita.london.contenttypes.ui.contact_orgname"),
|
||||||
Contact.ORG_NAME);
|
Contact.ORG_NAME);
|
||||||
|
|
||||||
sheet.add(ContactGlobalizationUtil
|
sheet.add(ContactGlobalizationUtil.globalize(
|
||||||
.globalize("com.arsdigita.london.contenttypes.ui.contact_deptname"),
|
"com.arsdigita.london.contenttypes.ui.contact_deptname"),
|
||||||
Contact.DEPT_NAME);
|
Contact.DEPT_NAME);
|
||||||
|
|
||||||
sheet.add(ContactGlobalizationUtil
|
sheet.add(ContactGlobalizationUtil.globalize(
|
||||||
.globalize("com.arsdigita.london.contenttypes.ui.contact_role"),
|
"com.arsdigita.london.contenttypes.ui.contact_role"),
|
||||||
Contact.ROLE);
|
Contact.ROLE);
|
||||||
return sheet;
|
return sheet;
|
||||||
}
|
}
|
||||||
|
|
|
||||||
|
|
@ -38,32 +38,37 @@ import com.arsdigita.cms.ui.authoring.BasicPageForm;
|
||||||
import com.arsdigita.cms.util.GlobalizationUtil;
|
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
|
||||||
* <code>ContactPropertiesStep</code> authoring kit step.
|
* <code>ContactPropertiesStep</code> authoring kit step.
|
||||||
*
|
*
|
||||||
* @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: ContactPropertyForm.java 287 2005-02-22 00:29:02Z sskracic $
|
* @version $Id: ContactPropertyForm.java 287 2005-02-22 00:29:02Z sskracic $
|
||||||
*/
|
*/
|
||||||
public class ContactPropertyForm extends BasicPageForm {
|
public class ContactPropertyForm extends BasicPageForm {
|
||||||
|
|
||||||
/** Name of this form */
|
/**
|
||||||
|
* Name of this form
|
||||||
|
*/
|
||||||
public static final String ID = "Contact_edit";
|
public static final String ID = "Contact_edit";
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Creates a new form to edit the Contact object specified by the item
|
* Creates a new form to edit the Contact object specified by the item
|
||||||
* selection model passed in.
|
* selection model passed in.
|
||||||
*
|
*
|
||||||
* @param itemModel
|
* @param itemModel The ItemSelectionModel to use to obtain the Contact to
|
||||||
* The ItemSelectionModel to use to obtain the Contact to work on
|
* work on
|
||||||
*/
|
*/
|
||||||
public ContactPropertyForm(ItemSelectionModel itemModel) {
|
public ContactPropertyForm(ItemSelectionModel itemModel) {
|
||||||
super(ID, itemModel);
|
super(ID, itemModel);
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Adds widgets to the form. This has been cut into small methods
|
* Adds widgets to the form. This has been cut into small methods so that
|
||||||
* so that subclasses can pick and choose.
|
* subclasses can pick and choose.
|
||||||
*/
|
*/
|
||||||
|
@Override
|
||||||
protected void addWidgets() {
|
protected void addWidgets() {
|
||||||
addBasicPageFormWidgets();
|
addBasicPageFormWidgets();
|
||||||
addGivenNameWidget();
|
addGivenNameWidget();
|
||||||
|
|
|
||||||
|
|
@ -21,6 +21,7 @@ import com.arsdigita.cms.ItemSelectionModel;
|
||||||
import com.arsdigita.london.contenttypes.Contact;
|
import com.arsdigita.london.contenttypes.Contact;
|
||||||
import com.arsdigita.cms.ui.ItemSearchWidget;
|
import com.arsdigita.cms.ui.ItemSearchWidget;
|
||||||
import com.arsdigita.cms.ui.authoring.AuthoringKitWizard;
|
import com.arsdigita.cms.ui.authoring.AuthoringKitWizard;
|
||||||
|
import com.arsdigita.london.contenttypes.util.ContactGlobalizationUtil;
|
||||||
|
|
||||||
public class ContactToItemAddForm extends FormSection implements
|
public class ContactToItemAddForm extends FormSection implements
|
||||||
FormInitListener, FormValidationListener, FormProcessListener,
|
FormInitListener, FormValidationListener, FormProcessListener,
|
||||||
|
|
@ -44,8 +45,8 @@ public class ContactToItemAddForm extends FormSection implements
|
||||||
|
|
||||||
private AuthoringKitWizard m_parent;
|
private AuthoringKitWizard m_parent;
|
||||||
|
|
||||||
private Label m_removeLinkText = new Label(GlobalizationUtil
|
private Label m_removeLinkText = new Label(ContactGlobalizationUtil
|
||||||
.globalize("Remove contact"));
|
.globalize("london.contenttypes.ui.contact.remove_contact"));
|
||||||
|
|
||||||
private ActionLink m_removeLink;
|
private ActionLink m_removeLink;
|
||||||
|
|
||||||
|
|
@ -87,7 +88,8 @@ public class ContactToItemAddForm extends FormSection implements
|
||||||
|
|
||||||
add(m_removeLink, ColumnPanel.FULL_WIDTH);
|
add(m_removeLink, ColumnPanel.FULL_WIDTH);
|
||||||
|
|
||||||
m_searchFormLabel = new Label("Search for Contact:");
|
m_searchFormLabel = new Label(ContactGlobalizationUtil.globalize(
|
||||||
|
"london.contenttypes.ui.contact.search_contact_label"));
|
||||||
add(m_searchFormLabel);
|
add(m_searchFormLabel);
|
||||||
m_itemSearch = new ItemSearchWidget(CONTACT_SEARCH,
|
m_itemSearch = new ItemSearchWidget(CONTACT_SEARCH,
|
||||||
Contact.BASE_DATA_OBJECT_TYPE);
|
Contact.BASE_DATA_OBJECT_TYPE);
|
||||||
|
|
@ -101,7 +103,9 @@ public class ContactToItemAddForm extends FormSection implements
|
||||||
/** Adds the saveCancelSection */
|
/** Adds the saveCancelSection */
|
||||||
public void addSaveCancelSection() {
|
public void addSaveCancelSection() {
|
||||||
m_saveCancelSection = new SaveCancelSection();
|
m_saveCancelSection = new SaveCancelSection();
|
||||||
m_saveCancelSection.getSaveButton().setButtonLabel("Add");
|
m_saveCancelSection.getSaveButton()
|
||||||
|
.setButtonLabel(ContactGlobalizationUtil.globalize(
|
||||||
|
"london.contenttypes.ui.contact.add_contact"));
|
||||||
add(m_saveCancelSection, ColumnPanel.FULL_WIDTH);
|
add(m_saveCancelSection, ColumnPanel.FULL_WIDTH);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
||||||
Loading…
Reference in New Issue