Weitere Korrekturen und Ergänzungen an der GUI für verschiedene Contenttypen (DateFormatter, etc.)
git-svn-id: https://svn.libreccm.org/ccm/trunk@845 8810af33-2d31-482b-a856-94f89814c4dfmaster
parent
64191ad918
commit
1a45df3f7f
|
|
@ -85,27 +85,26 @@ public class GenericPersonPropertiesStep extends SimpleEditStep {
|
|||
DomainObjectPropertySheet sheet = new DomainObjectPropertySheet(
|
||||
itemModel);
|
||||
|
||||
sheet.add((String) ContenttypesGlobalizationUtil.globalize(
|
||||
"cms.contenttypes.ui.person.surname").localize(),
|
||||
sheet.add(ContenttypesGlobalizationUtil.globalize(
|
||||
"cms.contenttypes.ui.person.surname"),
|
||||
GenericPerson.SURNAME);
|
||||
sheet.add((String) ContenttypesGlobalizationUtil.globalize(
|
||||
"cms.contenttypes.ui.person.givenname").localize(),
|
||||
sheet.add(ContenttypesGlobalizationUtil.globalize(
|
||||
"cms.contenttypes.ui.person.givenname"),
|
||||
GenericPerson.GIVENNAME);
|
||||
sheet.add((String) ContenttypesGlobalizationUtil.globalize(
|
||||
"cms.contenttypes.ui.person.titlepre").localize(),
|
||||
sheet.add(ContenttypesGlobalizationUtil.globalize(
|
||||
"cms.contenttypes.ui.person.titlepre"),
|
||||
GenericPerson.TITLEPRE);
|
||||
sheet.add((String) ContenttypesGlobalizationUtil.globalize(
|
||||
"cms.contenttypes.ui.person.titlepost").localize(),
|
||||
sheet.add(ContenttypesGlobalizationUtil.globalize(
|
||||
"cms.contenttypes.ui.person.titlepost"),
|
||||
GenericPerson.TITLEPOST);
|
||||
sheet.add((String) ContenttypesGlobalizationUtil.globalize(
|
||||
"cms.contenttypes.ui.person.birthdate").localize(),
|
||||
sheet.add(ContenttypesGlobalizationUtil.globalize(
|
||||
"cms.contenttypes.ui.person.birthdate"),
|
||||
GenericPerson.BIRTHDATE,
|
||||
new DomainObjectPropertySheet.AttributeFormatter() {
|
||||
|
||||
public String format(DomainObject item,
|
||||
String attribute,
|
||||
PageState state) {
|
||||
//ContentPage page = (ContentPage) item;
|
||||
GenericPerson person = (GenericPerson) item;
|
||||
if (person.getBirthdate() != null) {
|
||||
return DateFormat.getDateInstance(DateFormat.LONG).format(person.
|
||||
|
|
@ -117,8 +116,8 @@ public class GenericPersonPropertiesStep extends SimpleEditStep {
|
|||
}
|
||||
});
|
||||
|
||||
sheet.add((String) ContenttypesGlobalizationUtil.globalize(
|
||||
"cms.contenttypes.ui.person.gender").localize(),
|
||||
sheet.add(ContenttypesGlobalizationUtil.globalize(
|
||||
"cms.contenttypes.ui.person.gender"),
|
||||
GenericPerson.GENDER,
|
||||
new DomainObjectPropertySheet.AttributeFormatter() {
|
||||
|
||||
|
|
@ -138,8 +137,8 @@ public class GenericPersonPropertiesStep extends SimpleEditStep {
|
|||
});
|
||||
|
||||
if (!ContentSection.getConfig().getHideLaunchDate()) {
|
||||
sheet.add((String) ContenttypesGlobalizationUtil.globalize(
|
||||
"cms.ui.authoring.page_launch_date").localize(),
|
||||
sheet.add(ContenttypesGlobalizationUtil.globalize(
|
||||
"cms.ui.authoring.page_launch_date"),
|
||||
ContentPage.LAUNCH_DATE,
|
||||
new DomainObjectPropertySheet.AttributeFormatter() {
|
||||
|
||||
|
|
@ -158,8 +157,8 @@ public class GenericPersonPropertiesStep extends SimpleEditStep {
|
|||
});
|
||||
}
|
||||
|
||||
sheet.add((String) ContenttypesGlobalizationUtil.globalize(
|
||||
"cms.contenttypes.ui.person.description").localize(),
|
||||
sheet.add(ContenttypesGlobalizationUtil.globalize(
|
||||
"cms.contenttypes.ui.person.description"),
|
||||
GenericPerson.DESCRIPTION);
|
||||
return sheet;
|
||||
}
|
||||
|
|
|
|||
|
|
@ -24,6 +24,7 @@ import com.arsdigita.bebop.Label;
|
|||
import com.arsdigita.bebop.PageState;
|
||||
import com.arsdigita.cms.ItemSelectionModel;
|
||||
import com.arsdigita.cms.contenttypes.ArticleInJournal;
|
||||
import com.arsdigita.cms.contenttypes.util.ContenttypesGlobalizationUtil;
|
||||
import com.arsdigita.cms.ui.authoring.AuthoringKitWizard;
|
||||
import com.arsdigita.cms.ui.authoring.BasicPageForm;
|
||||
import com.arsdigita.cms.ui.authoring.SimpleEditStep;
|
||||
|
|
@ -31,6 +32,7 @@ import com.arsdigita.cms.ui.workflow.WorkflowLockedComponentAccess;
|
|||
import com.arsdigita.domain.DomainObject;
|
||||
import com.arsdigita.domain.DomainService;
|
||||
import com.arsdigita.toolbox.ui.DomainObjectPropertySheet;
|
||||
import java.text.DateFormat;
|
||||
|
||||
/**
|
||||
*
|
||||
|
|
@ -66,9 +68,26 @@ public class ArticleInJournalPropertiesStep extends PublicationPropertiesStep {
|
|||
|
||||
sheet.add(PublicationGlobalizationUtil.globalize(
|
||||
"publications.ui.articleinjournal.publication_date"),
|
||||
ArticleInJournal.PUBLICATION_DATE);
|
||||
ArticleInJournal.PUBLICATION_DATE,
|
||||
new DomainObjectPropertySheet.AttributeFormatter() {
|
||||
|
||||
sheet.add(PublicationGlobalizationUtil.globalize(
|
||||
public String format(DomainObject obj,
|
||||
String attribute,
|
||||
PageState state) {
|
||||
|
||||
ArticleInJournal article = (ArticleInJournal) obj;
|
||||
|
||||
if (article.getPublicationDate() != null) {
|
||||
return DateFormat.getDateInstance(DateFormat.LONG).format(
|
||||
article.getPublicationDate());
|
||||
} else {
|
||||
return (String) ContenttypesGlobalizationUtil.globalize(
|
||||
"cms.ui.unknown").localize();
|
||||
}
|
||||
}
|
||||
});
|
||||
|
||||
sheet.add(PublicationGlobalizationUtil.globalize(
|
||||
"publications.ui.articleinjournal.reviewed"),
|
||||
ArticleInJournal.REVIEWED, new ReviewedFormatter());
|
||||
|
||||
|
|
@ -114,7 +133,7 @@ public class ArticleInJournalPropertiesStep extends PublicationPropertiesStep {
|
|||
|
||||
}
|
||||
|
||||
private static class ReviewedFormatter
|
||||
private static class ReviewedFormatter
|
||||
extends DomainService
|
||||
implements DomainObjectPropertySheet.AttributeFormatter {
|
||||
|
||||
|
|
@ -127,7 +146,8 @@ public class ArticleInJournalPropertiesStep extends PublicationPropertiesStep {
|
|||
&& (get(obj, attribute) instanceof Boolean)
|
||||
&& ((Boolean) get(obj, attribute) == true)) {
|
||||
return (String) PublicationGlobalizationUtil.globalize(
|
||||
"publications.ui.articleinjournal.reviewed.yes").localize();
|
||||
"publications.ui.articleinjournal.reviewed.yes").
|
||||
localize();
|
||||
} else {
|
||||
return (String) PublicationGlobalizationUtil.globalize(
|
||||
"publications.ui.articleinjournal.reviewed.no").localize();
|
||||
|
|
|
|||
|
|
@ -45,7 +45,7 @@ public class ExpertiseOrdererSheet
|
|||
"publications.ui.expertise.orderer").localize(),
|
||||
TABLE_COL_EDIT));
|
||||
columnModel.add(new TableColumn(
|
||||
0,
|
||||
1,
|
||||
PublicationGlobalizationUtil.globalize(
|
||||
"publications.ui.expertise.orderer.remove").localize(),
|
||||
TABLE_COL_DEL));
|
||||
|
|
|
|||
|
|
@ -21,13 +21,17 @@ package com.arsdigita.cms.contenttypes.ui;
|
|||
|
||||
import com.arsdigita.bebop.Component;
|
||||
import com.arsdigita.bebop.Label;
|
||||
import com.arsdigita.bebop.PageState;
|
||||
import com.arsdigita.cms.ItemSelectionModel;
|
||||
import com.arsdigita.cms.contenttypes.Proceedings;
|
||||
import com.arsdigita.cms.contenttypes.util.ContenttypesGlobalizationUtil;
|
||||
import com.arsdigita.cms.ui.authoring.AuthoringKitWizard;
|
||||
import com.arsdigita.cms.ui.authoring.BasicPageForm;
|
||||
import com.arsdigita.cms.ui.authoring.SimpleEditStep;
|
||||
import com.arsdigita.cms.ui.workflow.WorkflowLockedComponentAccess;
|
||||
import com.arsdigita.domain.DomainObject;
|
||||
import com.arsdigita.toolbox.ui.DomainObjectPropertySheet;
|
||||
import java.text.DateFormat;
|
||||
|
||||
/**
|
||||
*
|
||||
|
|
@ -57,11 +61,41 @@ public class ProceedingsPropertiesStep
|
|||
|
||||
sheet.add(PublicationGlobalizationUtil.globalize(
|
||||
"publications.ui.proceedings.date_from_of_conference"),
|
||||
Proceedings.DATE_FROM_OF_CONFERENCE);
|
||||
Proceedings.DATE_FROM_OF_CONFERENCE,
|
||||
new DomainObjectPropertySheet.AttributeFormatter() {
|
||||
|
||||
public String format(DomainObject item,
|
||||
String attribute,
|
||||
PageState state) {
|
||||
Proceedings proceedings = (Proceedings) item;
|
||||
if (proceedings.getDateFromOfConference() != null) {
|
||||
return DateFormat.getDateInstance(DateFormat.LONG).format(proceedings.
|
||||
getDateFromOfConference());
|
||||
} else {
|
||||
return (String) ContenttypesGlobalizationUtil.globalize(
|
||||
"cms.ui.unknown").localize();
|
||||
}
|
||||
}
|
||||
});
|
||||
|
||||
sheet.add(PublicationGlobalizationUtil.globalize(
|
||||
"publications.ui.proceedings.date_to_of_conference"),
|
||||
Proceedings.DATE_TO_OF_CONFERENCE);
|
||||
Proceedings.DATE_TO_OF_CONFERENCE,
|
||||
new DomainObjectPropertySheet.AttributeFormatter() {
|
||||
|
||||
public String format(DomainObject item,
|
||||
String attribute,
|
||||
PageState state) {
|
||||
Proceedings proceedings = (Proceedings) item;
|
||||
if (proceedings.getDateToOfConference() != null) {
|
||||
return DateFormat.getDateInstance(DateFormat.LONG).format(proceedings.
|
||||
getDateToOfConference());
|
||||
} else {
|
||||
return (String) ContenttypesGlobalizationUtil.globalize(
|
||||
"cms.ui.unknown").localize();
|
||||
}
|
||||
}
|
||||
});
|
||||
|
||||
return sheet;
|
||||
}
|
||||
|
|
|
|||
|
|
@ -36,10 +36,14 @@ import com.arsdigita.cms.SecurityManager;
|
|||
import com.arsdigita.cms.contenttypes.EditshipCollection;
|
||||
import com.arsdigita.cms.contenttypes.GenericPerson;
|
||||
import com.arsdigita.cms.contenttypes.Series;
|
||||
import com.arsdigita.cms.contenttypes.util.ContenttypesGlobalizationUtil;
|
||||
import com.arsdigita.cms.dispatcher.Utilities;
|
||||
import com.arsdigita.cms.ui.authoring.SimpleEditStep;
|
||||
import com.arsdigita.domain.DomainObject;
|
||||
import com.arsdigita.toolbox.ui.DomainObjectPropertySheet;
|
||||
import com.arsdigita.util.LockableImpl;
|
||||
import java.math.BigDecimal;
|
||||
import java.text.DateFormat;
|
||||
import org.apache.log4j.Logger;
|
||||
|
||||
/**
|
||||
|
|
@ -62,7 +66,7 @@ public class SeriesEditshipTable extends Table implements TableActionListener {
|
|||
SimpleEditStep editStep) {
|
||||
super();
|
||||
m_itemModel = itemModel;
|
||||
this.editStep = (SeriesEditshipStep)editStep;
|
||||
this.editStep = (SeriesEditshipStep) editStep;
|
||||
|
||||
setEmptyView(
|
||||
new Label(PublicationGlobalizationUtil.globalize(
|
||||
|
|
@ -174,9 +178,23 @@ public class SeriesEditshipTable extends Table implements TableActionListener {
|
|||
case 0:
|
||||
return m_editor.getFullName();
|
||||
case 1:
|
||||
return m_editshipCollection.getFrom();
|
||||
if (m_editshipCollection.getFrom() == null) {
|
||||
return ContenttypesGlobalizationUtil.globalize(
|
||||
"cms.ui.unknown").localize();
|
||||
} else {
|
||||
return DateFormat.getDateInstance(DateFormat.LONG).
|
||||
format(
|
||||
m_editshipCollection.getFrom());
|
||||
}
|
||||
case 2:
|
||||
return m_editshipCollection.getTo();
|
||||
if (m_editshipCollection.getTo() == null) {
|
||||
return ContenttypesGlobalizationUtil.globalize(
|
||||
"cms.ui.unknown").localize();
|
||||
} else {
|
||||
return DateFormat.getDateInstance(DateFormat.LONG).
|
||||
format(
|
||||
m_editshipCollection.getTo());
|
||||
}
|
||||
case 3:
|
||||
return PublicationGlobalizationUtil.globalize(
|
||||
"publications.ui.series.editship.edit").localize();
|
||||
|
|
@ -240,8 +258,7 @@ public class SeriesEditshipTable extends Table implements TableActionListener {
|
|||
int col) {
|
||||
SecurityManager securityManager =
|
||||
Utilities.getSecurityManager(state);
|
||||
Series series = (Series) m_itemModel.
|
||||
getSelectedObject(state);
|
||||
Series series = (Series) m_itemModel.getSelectedObject(state);
|
||||
|
||||
boolean canEdit = securityManager.canAccess(
|
||||
state.getRequest(),
|
||||
|
|
@ -365,9 +382,10 @@ public class SeriesEditshipTable extends Table implements TableActionListener {
|
|||
TableColumn column = getColumnModel().get(event.getColumn().intValue());
|
||||
|
||||
if (TABLE_COL_EDIT.equals(column.getHeaderKey().toString())) {
|
||||
} else if(TABLE_COL_EDIT_EDITSHIP.equals(column.getHeaderKey().toString())) {
|
||||
while(editors.next()) {
|
||||
if(editors.getEditor().equals(editor)) {
|
||||
} else if (TABLE_COL_EDIT_EDITSHIP.equals(column.getHeaderKey().
|
||||
toString())) {
|
||||
while (editors.next()) {
|
||||
if (editors.getEditor().equals(editor)) {
|
||||
break;
|
||||
}
|
||||
}
|
||||
|
|
@ -378,7 +396,8 @@ public class SeriesEditshipTable extends Table implements TableActionListener {
|
|||
|
||||
editors.close();
|
||||
|
||||
editStep.showComponent(state, SeriesEditshipStep.ADD_EDITOR_SHEET_NAME);
|
||||
editStep.showComponent(state,
|
||||
SeriesEditshipStep.ADD_EDITOR_SHEET_NAME);
|
||||
} else if (TABLE_COL_DEL.equals(column.getHeaderKey().toString())) {
|
||||
series.removeEditor(editor);
|
||||
}
|
||||
|
|
|
|||
|
|
@ -21,16 +21,20 @@ package com.arsdigita.cms.contenttypes.ui;
|
|||
|
||||
import com.arsdigita.bebop.Component;
|
||||
import com.arsdigita.bebop.Label;
|
||||
import com.arsdigita.bebop.PageState;
|
||||
import com.arsdigita.cms.ContentType;
|
||||
import com.arsdigita.cms.ContentTypeCollection;
|
||||
import com.arsdigita.cms.ItemSelectionModel;
|
||||
import com.arsdigita.cms.contenttypes.SciOrganizationConfig;
|
||||
import com.arsdigita.cms.contenttypes.SciProject;
|
||||
import com.arsdigita.cms.contenttypes.util.ContenttypesGlobalizationUtil;
|
||||
import com.arsdigita.cms.ui.authoring.AuthoringKitWizard;
|
||||
import com.arsdigita.cms.ui.authoring.BasicPageForm;
|
||||
import com.arsdigita.cms.ui.authoring.SimpleEditStep;
|
||||
import com.arsdigita.cms.ui.workflow.WorkflowLockedComponentAccess;
|
||||
import com.arsdigita.domain.DomainObject;
|
||||
import com.arsdigita.toolbox.ui.DomainObjectPropertySheet;
|
||||
import java.text.DateFormat;
|
||||
|
||||
/**
|
||||
* Step for editing the basic properties of a {@link SciProject}.
|
||||
|
|
@ -53,10 +57,40 @@ public class SciProjectPropertiesStep
|
|||
|
||||
sheet.add(SciOrganizationGlobalizationUtil.globalize(
|
||||
"sciorganization.ui.project.begin"),
|
||||
SciProject.BEGIN);
|
||||
SciProject.BEGIN,
|
||||
new DomainObjectPropertySheet.AttributeFormatter() {
|
||||
|
||||
public String format(DomainObject obj,
|
||||
String attribute,
|
||||
PageState state) {
|
||||
SciProject project = (SciProject) obj;
|
||||
if (project.getBegin() == null) {
|
||||
return (String) ContenttypesGlobalizationUtil.globalize(
|
||||
"cms.ui.unknown").localize();
|
||||
} else {
|
||||
return DateFormat.getDateInstance(DateFormat.LONG).format(
|
||||
project.getBegin());
|
||||
}
|
||||
}
|
||||
});
|
||||
sheet.add(SciOrganizationGlobalizationUtil.globalize(
|
||||
"sciorganization.ui.project.end"),
|
||||
SciProject.END);
|
||||
SciProject.END,
|
||||
new DomainObjectPropertySheet.AttributeFormatter() {
|
||||
|
||||
public String format(DomainObject obj,
|
||||
String attribute,
|
||||
PageState state) {
|
||||
SciProject project = (SciProject) obj;
|
||||
if (project.getEnd() == null) {
|
||||
return (String) ContenttypesGlobalizationUtil.globalize(
|
||||
"cms.ui.unknown").localize();
|
||||
} else {
|
||||
return DateFormat.getDateInstance(DateFormat.LONG).format(
|
||||
project.getEnd());
|
||||
}
|
||||
}
|
||||
});
|
||||
sheet.add(SciOrganizationGlobalizationUtil.globalize(
|
||||
"sciorganization.ui.project.shortdesc"),
|
||||
SciProject.PROJECT_SHORT_DESCRIPTION);
|
||||
|
|
|
|||
Loading…
Reference in New Issue