Last part of adaptation to setLabel attribute in widgets.

git-svn-id: https://svn.libreccm.org/ccm/trunk@2744 8810af33-2d31-482b-a856-94f89814c4df
master
pb 2014-07-09 09:09:20 +00:00
parent c5cf1f9e93
commit a2d02f8a0a
78 changed files with 603 additions and 546 deletions

View File

@ -56,9 +56,8 @@ import org.apache.log4j.Logger;
public class GenericOrganizationalUnitSubordinateOrgaUnitsTable public class GenericOrganizationalUnitSubordinateOrgaUnitsTable
extends Table { extends Table {
private final Logger logger = private final Logger logger = Logger.getLogger(
Logger.getLogger( GenericOrganizationalUnitSubordinateOrgaUnitsTable.class);
GenericOrganizationalUnitSubordinateOrgaUnitsTable.class);
private final String TABLE_COL_EDIT = "table_col_edit"; private final String TABLE_COL_EDIT = "table_col_edit";
private final String TABLE_COL_DEL = "table_col_del"; private final String TABLE_COL_DEL = "table_col_del";
private final String TABLE_COL_UP = "table_col_up"; private final String TABLE_COL_UP = "table_col_up";
@ -69,7 +68,9 @@ public class GenericOrganizationalUnitSubordinateOrgaUnitsTable
public GenericOrganizationalUnitSubordinateOrgaUnitsTable( public GenericOrganizationalUnitSubordinateOrgaUnitsTable(
final ItemSelectionModel itemModel, final ItemSelectionModel itemModel,
final GenericOrgaUnitSubordinateOrgaUnitsTableCustomizer customizer) { final GenericOrgaUnitSubordinateOrgaUnitsTableCustomizer customizer) {
super(); super();
this.itemModel = itemModel; this.itemModel = itemModel;
this.customizer = customizer; this.customizer = customizer;

View File

@ -50,14 +50,18 @@ public class SciPublicationsMovieDirectorForm extends BasicItemForm implements F
@Override @Override
public void addWidgets() { public void addWidgets() {
final SciPublicationsDramaticArtsGlobalisationUtil globalisationUtil final SciPublicationsDramaticArtsGlobalisationUtil globalisationUtil
= new SciPublicationsDramaticArtsGlobalisationUtil(); = new SciPublicationsDramaticArtsGlobalisationUtil();
add(new Label(globalisationUtil.globalize("publications.dramaticarts.ui.movie.director")));
itemSearch = new ItemSearchWidget( itemSearch = new ItemSearchWidget(
ITEM_SEARCH, ContentType.findByAssociatedObjectType( ITEM_SEARCH, ContentType.findByAssociatedObjectType(
GenericPerson.BASE_DATA_OBJECT_TYPE)); GenericPerson.BASE_DATA_OBJECT_TYPE));
itemSearch.setEditAfterCreate(false); itemSearch.setEditAfterCreate(false);
itemSearch.setLabel(globalisationUtil.globalize(
"publications.dramaticarts.ui.movie.director"));
add(itemSearch); add(itemSearch);
} }
@Override @Override
@ -89,7 +93,7 @@ public class SciPublicationsMovieDirectorForm extends BasicItemForm implements F
//final PageState state = event.getPageState(); //final PageState state = event.getPageState();
final FormData data = event.getFormData(); final FormData data = event.getFormData();
final SciPublicationsDramaticArtsGlobalisationUtil globalisationUtil final SciPublicationsDramaticArtsGlobalisationUtil globalisationUtil
= new SciPublicationsDramaticArtsGlobalisationUtil(); = new SciPublicationsDramaticArtsGlobalisationUtil();
if (data.get(ITEM_SEARCH) == null) { if (data.get(ITEM_SEARCH) == null) {
data.addError(globalisationUtil.globalize( data.addError(globalisationUtil.globalize(

View File

@ -62,6 +62,7 @@ public class SciPublicationsMovieExtraXMLGenerator implements ExtraXMLGenerator
} }
} }
@Override
public void addGlobalStateParams(final Page page) { public void addGlobalStateParams(final Page page) {
//nothing //nothing
} }

View File

@ -55,13 +55,14 @@ public class SciPublicationsMovieProductionCompanyForm
@Override @Override
public void addWidgets() { public void addWidgets() {
final SciPublicationsDramaticArtsGlobalisationUtil globalisationUtil final SciPublicationsDramaticArtsGlobalisationUtil globalisationUtil
= new SciPublicationsDramaticArtsGlobalisationUtil(); = new SciPublicationsDramaticArtsGlobalisationUtil();
add(new Label(globalisationUtil.globalize(
"publications.dramaticarts.ui.movie.production_company")));
itemSearch = new ItemSearchWidget( itemSearch = new ItemSearchWidget(
ITEM_SEARCH, ContentType.findByAssociatedObjectType( ITEM_SEARCH, ContentType.findByAssociatedObjectType(
GenericOrganizationalUnit.BASE_DATA_OBJECT_TYPE)); GenericOrganizationalUnit.BASE_DATA_OBJECT_TYPE));
itemSearch.setEditAfterCreate(false); itemSearch.setEditAfterCreate(false);
itemSearch.setLabel(globalisationUtil.globalize(
"publications.dramaticarts.ui.movie.production_company"));
add(itemSearch); add(itemSearch);
} }
@ -81,8 +82,8 @@ public class SciPublicationsMovieProductionCompanyForm
.getSelectedObject(state); .getSelectedObject(state);
if (getSaveCancelSection().getSaveButton().isSelected(state)) { if (getSaveCancelSection().getSaveButton().isSelected(state)) {
final GenericOrganizationalUnit productionCompany = (GenericOrganizationalUnit) data final GenericOrganizationalUnit productionCompany
.get(ITEM_SEARCH); = (GenericOrganizationalUnit) data.get(ITEM_SEARCH);
movie.setProductionCompany(productionCompany); movie.setProductionCompany(productionCompany);
itemSearch.publishCreatedItem(data, productionCompany); itemSearch.publishCreatedItem(data, productionCompany);
} }
@ -95,7 +96,7 @@ public class SciPublicationsMovieProductionCompanyForm
//final PageState state = event.getPageState(); //final PageState state = event.getPageState();
final FormData data = event.getFormData(); final FormData data = event.getFormData();
final SciPublicationsDramaticArtsGlobalisationUtil globalisationUtil final SciPublicationsDramaticArtsGlobalisationUtil globalisationUtil
= new SciPublicationsDramaticArtsGlobalisationUtil(); = new SciPublicationsDramaticArtsGlobalisationUtil();
if (data.get(ITEM_SEARCH) == null) { if (data.get(ITEM_SEARCH) == null) {
data.addError(globalisationUtil.globalize( data.addError(globalisationUtil.globalize(

View File

@ -54,8 +54,7 @@ public class SciPublicationsMovieProductionCompanyStep extends SimpleEditStep {
setProductionCompanyForm.getSaveCancelSection().getCancelButton()); setProductionCompanyForm.getSaveCancelSection().getCancelButton());
final SciPublicationsMovieProductionCompanySheet sheet final SciPublicationsMovieProductionCompanySheet sheet
= new SciPublicationsMovieProductionCompanySheet( = new SciPublicationsMovieProductionCompanySheet(itemModel);
itemModel);
setDisplayComponent(sheet); setDisplayComponent(sheet);
} }

View File

@ -55,13 +55,16 @@ public class SciPublicationsPlayProductionTheaterForm
@Override @Override
public void addWidgets() { public void addWidgets() {
final SciPublicationsDramaticArtsGlobalisationUtil globalisationUtil final SciPublicationsDramaticArtsGlobalisationUtil globalisationUtil
= new SciPublicationsDramaticArtsGlobalisationUtil(); = new SciPublicationsDramaticArtsGlobalisationUtil();
add(new Label(globalisationUtil.globalize(
"publications.dramaticarts.play.ui.productiontheater")));
itemSearch = new ItemSearchWidget( itemSearch = new ItemSearchWidget(
ITEM_SEARCH, ContentType.findByAssociatedObjectType( ITEM_SEARCH,
GenericOrganizationalUnit.BASE_DATA_OBJECT_TYPE)); ContentType.findByAssociatedObjectType(
GenericOrganizationalUnit.BASE_DATA_OBJECT_TYPE)
);
itemSearch.setEditAfterCreate(false); itemSearch.setEditAfterCreate(false);
itemSearch.setLabel(globalisationUtil.globalize(
"publications.dramaticarts.play.ui.productiontheater"));
add(itemSearch); add(itemSearch);
} }
@ -95,7 +98,7 @@ public class SciPublicationsPlayProductionTheaterForm
//final PageState state = event.getPageState(); //final PageState state = event.getPageState();
final FormData data = event.getFormData(); final FormData data = event.getFormData();
final SciPublicationsDramaticArtsGlobalisationUtil globalisationUtil final SciPublicationsDramaticArtsGlobalisationUtil globalisationUtil
= new SciPublicationsDramaticArtsGlobalisationUtil(); = new SciPublicationsDramaticArtsGlobalisationUtil();
if (data.get(ITEM_SEARCH) == null) { if (data.get(ITEM_SEARCH) == null) {
data.addError(globalisationUtil.globalize( data.addError(globalisationUtil.globalize(

View File

@ -54,8 +54,7 @@ public class SciPublicationsPlayProductionTheaterStep extends SimpleEditStep {
setProductionTheaterForm.getSaveCancelSection().getCancelButton()); setProductionTheaterForm.getSaveCancelSection().getCancelButton());
final SciPublicationsPlayProductionTheaterSheet sheet final SciPublicationsPlayProductionTheaterSheet sheet
= new SciPublicationsPlayProductionTheaterSheet( = new SciPublicationsPlayProductionTheaterSheet(itemModel);
itemModel);
setDisplayComponent(sheet); setDisplayComponent(sheet);
} }

View File

@ -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.Label;
import com.arsdigita.bebop.event.FormInitListener; import com.arsdigita.bebop.event.FormInitListener;
import com.arsdigita.bebop.event.FormProcessListener; import com.arsdigita.bebop.event.FormProcessListener;
import com.arsdigita.bebop.event.FormSectionEvent; import com.arsdigita.bebop.event.FormSectionEvent;
@ -65,7 +64,7 @@ public class SciPublicationsPlayPropertyForm
final TextField firstProdYear = new TextField(firstProdYearParam); final TextField firstProdYear = new TextField(firstProdYearParam);
firstProdYear.setMaxLength(4); firstProdYear.setMaxLength(4);
firstProdYear.setLabel(globalisationUtil.globalize("publications.dramaticarts.ui.play.first_production_year")); firstProdYear.setLabel(globalisationUtil.globalize("publications.dramaticarts.ui.play.first_production_year"));
add(new Label(globalisationUtil.globalize("publications.dramaticarts.ui.play.first_production_year"))); // add(new Label(globalisationUtil.globalize("publications.dramaticarts.ui.play.first_production_year")));
add(firstProdYear); add(firstProdYear);
} }

View File

@ -46,23 +46,26 @@ public class ResearchReportPropertiesStep extends UnPublishedPropertiesStep {
} }
@Override @Override
protected void addBasicProperties(final ItemSelectionModel itemModel, final AuthoringKitWizard parent) { protected void addBasicProperties(final ItemSelectionModel itemModel,
final SimpleEditStep basicProperties = new SimpleEditStep(itemModel, parent, EDIT_SHEET_NAME); final AuthoringKitWizard parent) {
final SimpleEditStep basicProperties = new SimpleEditStep(itemModel,
parent,
EDIT_SHEET_NAME);
final BasicPageForm editBasicSheet = new ResearchReportPropertyForm(itemModel, this); final BasicPageForm editBasicSheet = new ResearchReportPropertyForm(itemModel, this);
basicProperties.add( basicProperties.add(
EDIT_SHEET_NAME, EDIT_SHEET_NAME,
(String) PublicationGlobalizationUtil.globalize("publications.ui.publication.edit_basic_sheet"). PublicationGlobalizationUtil.globalize(
localize(), "publications.ui.publication.edit_basic_sheet"),
new WorkflowLockedComponentAccess(editBasicSheet, itemModel), new WorkflowLockedComponentAccess(editBasicSheet, itemModel),
editBasicSheet.getSaveCancelSection().getCancelButton()); editBasicSheet.getSaveCancelSection().getCancelButton());
basicProperties.setDisplayComponent(getResearchReportPropertiesSheet(itemModel)); basicProperties.setDisplayComponent(getResearchReportPropertiesSheet(itemModel));
getSegmentedPanel().addSegment( getSegmentedPanel().addSegment(
new Label((String) PublicationGlobalizationUtil. new Label(PublicationGlobalizationUtil.
globalize("publications.ui.publication.basic_properties").localize()), globalize("publications.ui.publication.basic_properties")),
basicProperties); basicProperties);
} }

View File

@ -19,10 +19,8 @@
*/ */
package com.arsdigita.cms.contenttypes.ui; package com.arsdigita.cms.contenttypes.ui;
import com.arsdigita.bebop.FormProcessException;
import com.arsdigita.bebop.event.FormInitListener; import com.arsdigita.bebop.event.FormInitListener;
import com.arsdigita.bebop.event.FormProcessListener; import com.arsdigita.bebop.event.FormProcessListener;
import com.arsdigita.bebop.event.FormSectionEvent;
import com.arsdigita.bebop.event.FormSubmissionListener; import com.arsdigita.bebop.event.FormSubmissionListener;
import com.arsdigita.cms.ItemSelectionModel; import com.arsdigita.cms.ItemSelectionModel;
@ -30,9 +28,10 @@ import com.arsdigita.cms.ItemSelectionModel;
* *
* @author Jens Pelzetter <jens@jp-digital.de> * @author Jens Pelzetter <jens@jp-digital.de>
*/ */
public class ResearchReportPropertyForm extends UnPublishedPropertyForm implements FormInitListener, public class ResearchReportPropertyForm extends UnPublishedPropertyForm
FormProcessListener, implements FormInitListener,
FormSubmissionListener{ FormProcessListener,
FormSubmissionListener{
public static final String ID = "ResearchReportEdit"; public static final String ID = "ResearchReportEdit";
@ -40,7 +39,8 @@ public class ResearchReportPropertyForm extends UnPublishedPropertyForm implemen
this(itemModel, null); this(itemModel, null);
} }
public ResearchReportPropertyForm(final ItemSelectionModel itemModel, ResearchReportPropertiesStep step) { public ResearchReportPropertyForm(final ItemSelectionModel itemModel,
ResearchReportPropertiesStep step) {
super(itemModel, step); super(itemModel, step);
addSubmissionListener(this); addSubmissionListener(this);
} }

View File

@ -165,9 +165,8 @@ public class CollectedVolumeArticlesTable
case 0: case 0:
return m_article.getTitle(); return m_article.getTitle();
case 1: case 1:
return PublicationGlobalizationUtil.globalize( return new Label(PublicationGlobalizationUtil.globalize(
"publications.ui.collected_volume.article.remove"). "publications.ui.collected_volume.article.remove"));
localize();
default: default:
return null; return null;
} }

View File

@ -134,18 +134,20 @@ public class ExpertiseOrdererSheet
return ret; return ret;
} }
@Override
public Object getElementAt(final int columnIndex) { public Object getElementAt(final int columnIndex) {
switch (columnIndex) { switch (columnIndex) {
case 0: case 0:
return orga.getTitle(); return orga.getTitle();
case 1: case 1:
return PublicationGlobalizationUtil.globalize( return new Label(PublicationGlobalizationUtil.globalize(
"publications.ui.expertise.orderer.remove").localize(); "publications.ui.expertise.orderer.remove"));
default: default:
return null; return null;
} }
} }
@Override
public Object getKeyAt(final int columnIndex) { public Object getKeyAt(final int columnIndex) {
return orga.getID(); return orga.getID();
} }

View File

@ -134,19 +134,20 @@ public class ExpertiseOrganizationSheet
return ret; return ret;
} }
@Override
public Object getElementAt(final int columnIndex) { public Object getElementAt(final int columnIndex) {
switch (columnIndex) { switch (columnIndex) {
case 0: case 0:
return orga.getTitle(); return orga.getTitle();
case 1: case 1:
return PublicationGlobalizationUtil.globalize( return new Label(PublicationGlobalizationUtil.globalize(
"publications.ui.expertise.organization.remove"). "publications.ui.expertise.organization.remove"));
localize();
default: default:
return null; return null;
} }
} }
@Override
public Object getKeyAt(final int columnIndex) { public Object getKeyAt(final int columnIndex) {
return orga.getID(); return orga.getID();
} }

View File

@ -54,12 +54,15 @@ public class PublicationGenericOrganizationalUnitAddForm
@Override @Override
public void addWidgets() { public void addWidgets() {
add(new Label(PublicationGlobalizationUtil.globalize("publications.ui.orgaunit.select")));
itemSearch = new ItemSearchWidget(ITEM_SEARCH, ContentType. itemSearch = new ItemSearchWidget(ITEM_SEARCH, ContentType.
findByAssociatedObjectType(GenericOrganizationalUnit.class. findByAssociatedObjectType(GenericOrganizationalUnit.class.
getName())); getName()));
itemSearch.setDisableCreatePane(true); itemSearch.setDisableCreatePane(true);
itemSearch.setLabel(PublicationGlobalizationUtil.globalize(
"publications.ui.orgaunit.select"));
add(itemSearch); add(itemSearch);
} }
@Override @Override

View File

@ -65,13 +65,13 @@ public class PublicationGenericOrganizationalUnitsTable extends Table {
final TableColumnModel columnModel = getColumnModel(); final TableColumnModel columnModel = getColumnModel();
columnModel.add(new TableColumn( columnModel.add(new TableColumn(
0, 0,
PublicationGlobalizationUtil.globalize( new Label(PublicationGlobalizationUtil.globalize(
"publications.ui.orgaunits.columns.name").localize(), "publications.ui.orgaunits.columns.name")),
TABLE_COL_EDIT)); TABLE_COL_EDIT));
columnModel.add(new TableColumn( columnModel.add(new TableColumn(
1, 1,
PublicationGlobalizationUtil.globalize( new Label(PublicationGlobalizationUtil.globalize(
"publications.ui.orgaunits.columns.remove").localize(), "publications.ui.orgaunits.columns.remove")),
TABLE_COL_DEL)); TABLE_COL_DEL));
setModelBuilder(new ModelBuilder(itemModel)); setModelBuilder(new ModelBuilder(itemModel));
@ -92,6 +92,7 @@ public class PublicationGenericOrganizationalUnitsTable extends Table {
this.itemModel = itemModel; this.itemModel = itemModel;
} }
@Override
public TableModel makeModel(final Table table, public TableModel makeModel(final Table table,
final PageState state) { final PageState state) {
table.getRowSelectionModel().clearSelection(state); table.getRowSelectionModel().clearSelection(state);
@ -115,10 +116,12 @@ public class PublicationGenericOrganizationalUnitsTable extends Table {
orgaunits = publication.getOrganizationalUnits(); orgaunits = publication.getOrganizationalUnits();
} }
@Override
public int getColumnCount() { public int getColumnCount() {
return table.getColumnModel().size(); return table.getColumnModel().size();
} }
@Override
public boolean nextRow() { public boolean nextRow() {
boolean ret; boolean ret;
@ -131,18 +134,20 @@ public class PublicationGenericOrganizationalUnitsTable extends Table {
return ret; return ret;
} }
@Override
public Object getElementAt(final int columnIndex) { public Object getElementAt(final int columnIndex) {
switch (columnIndex) { switch (columnIndex) {
case 0: case 0:
return orgaunits.getTitle(); return orgaunits.getTitle();
case 1: case 1:
return PublicationGlobalizationUtil.globalize( return new Label(PublicationGlobalizationUtil.globalize(
"publications.ui.orgaunits.remove").localize(); "publications.ui.orgaunits.remove"));
default: default:
return null; return null;
} }
} }
@Override
public Object getKeyAt(final int columnIndex) { public Object getKeyAt(final int columnIndex) {
return orgaunits.getID(); return orgaunits.getID();
} }
@ -217,9 +222,8 @@ public class PublicationGenericOrganizationalUnitsTable extends Table {
if (canEdit) { if (canEdit) {
final ControlLink link = new ControlLink(value.toString()); final ControlLink link = new ControlLink(value.toString());
link.setConfirmation((String) PublicationGlobalizationUtil. link.setConfirmation(PublicationGlobalizationUtil.globalize(
globalize("publications.ui.orgaunits.remove.confirm"). "publications.ui.orgaunits.remove.confirm"));
localize());
return link; return link;
} else { } else {
final Label label = new Label(""); final Label label = new Label("");

View File

@ -79,32 +79,31 @@ public class PublicationPropertyForm
@Override @Override
protected void addWidgets() { protected void addWidgets() {
super.addWidgets(); super.addWidgets();
add(new Label(PublicationGlobalizationUtil.globalize(
"publications.ui.publication.year_of_publication")));
final ParameterModel yearOfPublicationParam = new IntegerParameter( final ParameterModel yearOfPublicationParam = new IntegerParameter(
Publication.YEAR_OF_PUBLICATION); Publication.YEAR_OF_PUBLICATION);
final TextField yearOfPublication = new TextField(yearOfPublicationParam); final TextField yearOfPublication = new TextField(yearOfPublicationParam);
yearOfPublication.setMaxLength(4); yearOfPublication.setMaxLength(4);
//yearOfPublication.addValidationListener(new NotNullValidationListener()); //yearOfPublication.addValidationListener(new NotNullValidationListener());
//yearOfPublication.addValidationListener(new NotEmptyValidationListener()); //yearOfPublication.addValidationListener(new NotEmptyValidationListener());
yearOfPublication.setLabel(PublicationGlobalizationUtil.globalize(
"publications.ui.publication.year_of_publication"));
add(yearOfPublication); add(yearOfPublication);
add(new Label(PublicationGlobalizationUtil.globalize(
"publications.ui.publication.first_published")));
final ParameterModel firstPublishedParam = new IntegerParameter(Publication.FIRST_PUBLISHED); final ParameterModel firstPublishedParam = new IntegerParameter(Publication.FIRST_PUBLISHED);
final TextField firstPublished = new TextField(firstPublishedParam); final TextField firstPublished = new TextField(firstPublishedParam);
firstPublished.setLabel(PublicationGlobalizationUtil.globalize(
"publications.ui.publication.first_published"));
add(firstPublished); add(firstPublished);
add(new Label(PublicationGlobalizationUtil.globalize("publications.ui.publication.language")));
final ParameterModel langParam = new StringParameter(Publication.LANG); final ParameterModel langParam = new StringParameter(Publication.LANG);
//final TextField lang = new TextField(langParam);
final SingleSelect lang = new SingleSelect(langParam); final SingleSelect lang = new SingleSelect(langParam);
final Locale[] locales = Locale.getAvailableLocales(); final Locale[] locales = Locale.getAvailableLocales();
lang.addOption(new Option("", "")); lang.addOption(new Option("", ""));
Arrays.sort(locales, new Comparator<Locale>() { Arrays.sort(locales, new Comparator<Locale>() {
@Override
public int compare(final Locale locale1, final Locale locale2) { public int compare(final Locale locale1, final Locale locale2) {
return locale1.getDisplayName().compareTo(locale2.getDisplayName()); return locale1.getDisplayName().compareTo(locale2.getDisplayName());
} }
@ -125,10 +124,10 @@ public class PublicationPropertyForm
}); });
lang.addOption(new Option(locale.toString(), optionLabel)); lang.addOption(new Option(locale.toString(), optionLabel));
} }
lang.setLabel(PublicationGlobalizationUtil.globalize(
"publications.ui.publication.language"));
add(lang); add(lang);
add(new Label(PublicationGlobalizationUtil.globalize(
"publications.ui.publication.abstract")));
ParameterModel abstractParam = new StringParameter(Publication.ABSTRACT); ParameterModel abstractParam = new StringParameter(Publication.ABSTRACT);
TextArea abstractArea; TextArea abstractArea;
if (config.getEnableAbstractHTML()) { if (config.getEnableAbstractHTML()) {
@ -138,10 +137,10 @@ public class PublicationPropertyForm
} }
abstractArea.setCols(60); abstractArea.setCols(60);
abstractArea.setRows(18); abstractArea.setRows(18);
abstractArea.setLabel(PublicationGlobalizationUtil.globalize(
"publications.ui.publication.abstract"));
add(abstractArea); add(abstractArea);
add(new Label(PublicationGlobalizationUtil.globalize(
"publications.ui.publication.misc")));
ParameterModel miscParam = new StringParameter(Publication.MISC); ParameterModel miscParam = new StringParameter(Publication.MISC);
TextArea misc; TextArea misc;
if (config.getEnableMiscHTML()) { if (config.getEnableMiscHTML()) {
@ -149,6 +148,8 @@ public class PublicationPropertyForm
} else { } else {
misc = new TextArea(miscParam); misc = new TextArea(miscParam);
} }
misc.setLabel(PublicationGlobalizationUtil.globalize(
"publications.ui.publication.misc"));
misc.setCols(60); misc.setCols(60);
misc.setRows(18); misc.setRows(18);
add(misc); add(misc);

View File

@ -29,7 +29,6 @@ import com.arsdigita.bebop.form.TextField;
import com.arsdigita.bebop.parameters.StringParameter; import com.arsdigita.bebop.parameters.StringParameter;
import com.arsdigita.bebop.parameters.ParameterModel; import com.arsdigita.bebop.parameters.ParameterModel;
import com.arsdigita.cms.ContentType; import com.arsdigita.cms.ContentType;
import com.arsdigita.cms.Folder;
import com.arsdigita.cms.ItemSelectionModel; import com.arsdigita.cms.ItemSelectionModel;
import com.arsdigita.cms.contenttypes.Publication; import com.arsdigita.cms.contenttypes.Publication;
import com.arsdigita.cms.contenttypes.PublicationsConfig; import com.arsdigita.cms.contenttypes.PublicationsConfig;
@ -72,19 +71,20 @@ public class PublicationSeriesAddForm
@Override @Override
protected void addWidgets() { protected void addWidgets() {
add(new Label((String) PublicationGlobalizationUtil.globalize(
"publications.ui.series.select_series").localize()));
m_itemSearch = new ItemSearchWidget( m_itemSearch = new ItemSearchWidget(
ITEM_SEARCH, ITEM_SEARCH,
ContentType.findByAssociatedObjectType(Series.class.getName())); ContentType.findByAssociatedObjectType(Series.class.getName()));
m_itemSearch.setDefaultCreationFolder(config.getDefaultSeriesFolder()); m_itemSearch.setDefaultCreationFolder(config.getDefaultSeriesFolder());
m_itemSearch.setLabel(PublicationGlobalizationUtil.globalize(
"publications.ui.series.select_series"));
add(m_itemSearch); add(m_itemSearch);
add(new Label((String) PublicationGlobalizationUtil.globalize(
"publications.ui.series.volume_of_series").localize()));
ParameterModel volumeOfSeriesParam = new StringParameter( ParameterModel volumeOfSeriesParam = new StringParameter(
VolumeInSeriesCollection.VOLUME_OF_SERIES); VolumeInSeriesCollection.VOLUME_OF_SERIES);
volumeOfSeries = new TextField(volumeOfSeriesParam); volumeOfSeries = new TextField(volumeOfSeriesParam);
volumeOfSeries.setLabel(PublicationGlobalizationUtil.globalize(
"publications.ui.series.volume_of_series"));
add(volumeOfSeries); add(volumeOfSeries);
} }

View File

@ -44,8 +44,8 @@ public class PublicationSeriesPropertyStep extends SimpleEditStep {
BasicItemForm addSeriesSheet = new PublicationSeriesAddForm(itemModel); BasicItemForm addSeriesSheet = new PublicationSeriesAddForm(itemModel);
add(ADD_SERIES_SHEET_NAME, add(ADD_SERIES_SHEET_NAME,
(String) PublicationGlobalizationUtil.globalize( PublicationGlobalizationUtil.globalize(
"publications.ui.series.add_series").localize(), "publications.ui.series.add_series"),
new WorkflowLockedComponentAccess(addSeriesSheet, itemModel), new WorkflowLockedComponentAccess(addSeriesSheet, itemModel),
addSeriesSheet.getSaveCancelSection().getCancelButton()); addSeriesSheet.getSaveCancelSection().getCancelButton());

View File

@ -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.ContentSection; import com.arsdigita.cms.ContentSection;
import com.arsdigita.cms.ItemSelectionModel; import com.arsdigita.cms.ItemSelectionModel;
import com.arsdigita.cms.SecurityManager; import com.arsdigita.cms.SecurityManager;
@ -43,7 +42,7 @@ import com.arsdigita.cms.dispatcher.Utilities;
import com.arsdigita.dispatcher.ObjectNotFoundException; import com.arsdigita.dispatcher.ObjectNotFoundException;
import com.arsdigita.util.LockableImpl; import com.arsdigita.util.LockableImpl;
import java.math.BigDecimal; import java.math.BigDecimal;
import java.util.Iterator;
import org.apache.log4j.Logger; import org.apache.log4j.Logger;
/** /**
@ -69,15 +68,18 @@ public class PublicationSeriesTable
final TableColumnModel colModel = getColumnModel(); final TableColumnModel colModel = getColumnModel();
colModel.add(new TableColumn( colModel.add(new TableColumn(
0, 0,
PublicationGlobalizationUtil.globalize("publications.ui.series.title").localize(), new Label(PublicationGlobalizationUtil.globalize(
"publications.ui.series.title")),
TABLE_COL_EDIT)); TABLE_COL_EDIT));
colModel.add(new TableColumn( colModel.add(new TableColumn(
1, 1,
PublicationGlobalizationUtil.globalize("publications.ui.series.number").localize(), new Label(PublicationGlobalizationUtil.globalize(
"publications.ui.series.number")),
TABLE_COL_NUMBER)); TABLE_COL_NUMBER));
colModel.add(new TableColumn( colModel.add(new TableColumn(
2, 2,
PublicationGlobalizationUtil.globalize("publications.ui.series.remove").localize(), new Label(PublicationGlobalizationUtil.globalize(
"publications.ui.series.remove")),
TABLE_COL_DEL)); TABLE_COL_DEL));
setModelBuilder( setModelBuilder(
@ -153,8 +155,8 @@ public class PublicationSeriesTable
case 1: case 1:
return m_series.getTitle(); return m_series.getTitle();
case 2: case 2:
return PublicationGlobalizationUtil.globalize( return new Label(PublicationGlobalizationUtil.globalize(
"publications.ui.series.remove").localize(); "publications.ui.series.remove"));
default: default:
return null; return null;
} }
@ -256,7 +258,7 @@ public class PublicationSeriesTable
seriesCol.close(); seriesCol.close();
if (volumeOfSeries == null) { if (volumeOfSeries == null) {
return new Label(""); return new Label();
} else { } else {
return new Label(volumeOfSeries); return new Label(volumeOfSeries);
} }
@ -288,10 +290,8 @@ public class PublicationSeriesTable
if (canDelete) { if (canDelete) {
ControlLink link = new ControlLink(value.toString()); ControlLink link = new ControlLink(value.toString());
link.setConfirmation((String) PublicationGlobalizationUtil. link.setConfirmation(PublicationGlobalizationUtil.globalize(
globalize( "publications.ui.series.confirm_remove"));
"publications.ui.series.confirm_remove").
localize());
return link; return link;
} else { } else {
Label label = new Label(value.toString()); Label label = new Label(value.toString());

View File

@ -80,22 +80,21 @@ public class PublicationWithPublisherPropertiesStep
BasicPageForm editBasicSheet = BasicPageForm editBasicSheet =
new PublicationWithPublisherPropertyForm(itemModel, this); new PublicationWithPublisherPropertyForm(itemModel, this);
basicProperties.add(EDIT_SHEET_NAME, basicProperties.add(
(String) PublicationGlobalizationUtil.globalize( EDIT_SHEET_NAME,
"publications.ui.publication.edit_basic_sheet"). PublicationGlobalizationUtil.globalize(
localize(), new WorkflowLockedComponentAccess(editBasicSheet, "publications.ui.publication.edit_basic_sheet"),
itemModel), new WorkflowLockedComponentAccess(editBasicSheet,itemModel),
editBasicSheet.getSaveCancelSection(). editBasicSheet.getSaveCancelSection().getCancelButton());
getCancelButton());
basicProperties.setDisplayComponent( basicProperties.setDisplayComponent(
getPublicationWithPublisherPropertySheet( getPublicationWithPublisherPropertySheet(
itemModel)); itemModel));
getSegmentedPanel().addSegment( getSegmentedPanel().addSegment(
new Label((String) PublicationGlobalizationUtil.globalize( new Label(PublicationGlobalizationUtil.globalize(
"publications.ui.publication.basic_properties"). "publications.ui.publication.basic_properties")),
localize()), basicProperties); basicProperties);
} }
@Override @Override
@ -104,6 +103,7 @@ public class PublicationWithPublisherPropertiesStep
super.addSteps(itemModel, parent); super.addSteps(itemModel, parent);
addStep(new PublicationWithPublisherSetPublisherStep(itemModel, parent), addStep(new PublicationWithPublisherSetPublisherStep(itemModel, parent),
"publications.ui.with_publisher.publisher"); PublicationGlobalizationUtil.globalize(
"publications.ui.with_publisher.publisher"));
} }
} }

View File

@ -69,10 +69,9 @@ public class PublicationWithPublisherPropertyForm
@Override @Override
protected void addWidgets() { protected void addWidgets() {
super.addWidgets(); super.addWidgets();
add(new Label((String) PublicationGlobalizationUtil.globalize(
"publications.ui.with_publisher.isbn").localize()));
ParameterModel isbnParam = new StringParameter( ParameterModel isbnParam = new StringParameter(
PublicationWithPublisher.ISBN); PublicationWithPublisher.ISBN);
TextField isbn = new TextField(isbnParam); TextField isbn = new TextField(isbnParam);
@ -105,38 +104,36 @@ public class PublicationWithPublisherPropertyForm
} }
} }
}); });
isbn.setLabel(PublicationGlobalizationUtil.globalize(
"publications.ui.with_publisher.isbn"));
add(isbn); add(isbn);
add(new Label((String) PublicationGlobalizationUtil.globalize(
"publications.ui.collected_volume.volume").localize()));
ParameterModel volumeParam = new IntegerParameter( ParameterModel volumeParam = new IntegerParameter(
PublicationWithPublisher.VOLUME); PublicationWithPublisher.VOLUME);
TextField volume = new TextField(volumeParam); TextField volume = new TextField(volumeParam);
volume.setLabel(PublicationGlobalizationUtil.globalize(
"publications.ui.collected_volume.volume"));
add(volume); add(volume);
add(new Label((String) PublicationGlobalizationUtil.globalize( ParameterModel numberOfVolumesParam = new IntegerParameter(
"publications.ui.collected_volume.number_of_volumes"). PublicationWithPublisher.NUMBER_OF_VOLUMES);
localize()));
ParameterModel numberOfVolumesParam =
new IntegerParameter(
PublicationWithPublisher.NUMBER_OF_VOLUMES);
TextField numberOfVolumes = new TextField(numberOfVolumesParam); TextField numberOfVolumes = new TextField(numberOfVolumesParam);
numberOfVolumes.setLabel(PublicationGlobalizationUtil.globalize(
"publications.ui.collected_volume.number_of_volumes"));
add(numberOfVolumes); add(numberOfVolumes);
add(new Label((String) PublicationGlobalizationUtil.globalize(
"publications.ui.collected_volume.number_of_pages").
localize()));
ParameterModel numberOfPagesParam = new IntegerParameter( ParameterModel numberOfPagesParam = new IntegerParameter(
PublicationWithPublisher.NUMBER_OF_PAGES); PublicationWithPublisher.NUMBER_OF_PAGES);
TextField numberOfPages = new TextField(numberOfPagesParam); TextField numberOfPages = new TextField(numberOfPagesParam);
numberOfPages.setLabel(PublicationGlobalizationUtil.globalize(
"publications.ui.collected_volume.number_of_pages"));
add(numberOfPages); add(numberOfPages);
add(new Label((String) PublicationGlobalizationUtil.globalize(
"publications.ui.collected_volume.edition").
localize()));
ParameterModel editionModel = new StringParameter( ParameterModel editionModel = new StringParameter(
PublicationWithPublisher.EDITION); PublicationWithPublisher.EDITION);
TextField edition = new TextField(editionModel); TextField edition = new TextField(editionModel);
edition.setLabel(PublicationGlobalizationUtil.globalize(
"publications.ui.collected_volume.edition"));
add(edition); add(edition);
} }

View File

@ -26,7 +26,6 @@ import com.arsdigita.bebop.event.FormInitListener;
import com.arsdigita.bebop.event.FormProcessListener; import com.arsdigita.bebop.event.FormProcessListener;
import com.arsdigita.bebop.event.FormSectionEvent; import com.arsdigita.bebop.event.FormSectionEvent;
import com.arsdigita.cms.ContentType; import com.arsdigita.cms.ContentType;
import com.arsdigita.cms.Folder;
import com.arsdigita.cms.ItemSelectionModel; import com.arsdigita.cms.ItemSelectionModel;
import com.arsdigita.cms.contenttypes.PublicationWithPublisher; import com.arsdigita.cms.contenttypes.PublicationWithPublisher;
import com.arsdigita.cms.contenttypes.PublicationsConfig; import com.arsdigita.cms.contenttypes.PublicationsConfig;
@ -34,7 +33,7 @@ import com.arsdigita.cms.contenttypes.Publisher;
import com.arsdigita.cms.ui.ItemSearchWidget; import com.arsdigita.cms.ui.ItemSearchWidget;
import com.arsdigita.cms.ui.authoring.BasicItemForm; import com.arsdigita.cms.ui.authoring.BasicItemForm;
import com.arsdigita.kernel.Kernel; import com.arsdigita.kernel.Kernel;
import java.math.BigDecimal;
/** /**
* *
@ -61,13 +60,14 @@ public class PublicationWithPublisherSetPublisherForm
@Override @Override
public void addWidgets() { public void addWidgets() {
add(new Label(PublicationGlobalizationUtil.globalize(
"publications.ui.with_publisher.publisher"))); itemSearch = new ItemSearchWidget(ITEM_SEARCH,
itemSearch = ContentType.findByAssociatedObjectType(
new ItemSearchWidget(ITEM_SEARCH, ContentType.findByAssociatedObjectType(Publisher.class. Publisher.class.getName()));
getName()));
itemSearch.setDefaultCreationFolder(config.getDefaultPublisherFolder()); itemSearch.setDefaultCreationFolder(config.getDefaultPublisherFolder());
itemSearch.setEditAfterCreate(false); itemSearch.setEditAfterCreate(false);
itemSearch.setLabel(PublicationGlobalizationUtil.globalize(
"publications.ui.with_publisher.publisher"));
add(itemSearch); add(itemSearch);
} }

View File

@ -64,13 +64,13 @@ public class PublicationWithPublisherSetPublisherSheet
TableColumnModel columnModel = getColumnModel(); TableColumnModel columnModel = getColumnModel();
columnModel.add(new TableColumn( columnModel.add(new TableColumn(
0, 0,
PublicationGlobalizationUtil.globalize( new Label(PublicationGlobalizationUtil.globalize(
"publications.ui.with_publisher.publisher").localize(), "publications.ui.with_publisher.publisher")),
TABLE_COL_EDIT)); TABLE_COL_EDIT));
columnModel.add(new TableColumn( columnModel.add(new TableColumn(
1, 1,
PublicationGlobalizationUtil.globalize( new Label(PublicationGlobalizationUtil.globalize(
"publications.ui.with_publisher.publisher.remove").localize(), "publications.ui.with_publisher.publisher.remove")),
TABLE_COL_DEL)); TABLE_COL_DEL));
setModelBuilder(new PublicationWithPublisherSetPublisherSheetModelBuilder( setModelBuilder(new PublicationWithPublisherSetPublisherSheetModelBuilder(
@ -107,8 +107,8 @@ public class PublicationWithPublisherSetPublisherSheet
private class PublicationWithPublisherSetPublisherSheetModel private class PublicationWithPublisherSetPublisherSheetModel
implements TableModel { implements TableModel {
private Table table; private final Table table;
private Publisher publisher; private final Publisher publisher;
private boolean m_done; private boolean m_done;
public PublicationWithPublisherSetPublisherSheetModel(final Table table, public PublicationWithPublisherSetPublisherSheetModel(final Table table,
@ -123,10 +123,12 @@ public class PublicationWithPublisherSetPublisherSheet
} }
} }
@Override
public int getColumnCount() { public int getColumnCount() {
return table.getColumnModel().size(); return table.getColumnModel().size();
} }
@Override
public boolean nextRow() { public boolean nextRow() {
boolean ret; boolean ret;
@ -140,19 +142,20 @@ public class PublicationWithPublisherSetPublisherSheet
return ret; return ret;
} }
@Override
public Object getElementAt(final int columnIndex) { public Object getElementAt(final int columnIndex) {
switch (columnIndex) { switch (columnIndex) {
case 0: case 0:
return publisher.getTitle(); return publisher.getTitle();
case 1: case 1:
return PublicationGlobalizationUtil.globalize( return new Label(PublicationGlobalizationUtil.globalize(
"publications.ui.with_publisher.publisher.remove"). "publications.ui.with_publisher.publisher.remove"));
localize();
default: default:
return null; return null;
} }
} }
@Override
public Object getKeyAt(final int columnIndex) { public Object getKeyAt(final int columnIndex) {
return publisher.getID(); return publisher.getID();
} }
@ -239,10 +242,8 @@ public class PublicationWithPublisherSetPublisherSheet
if (canEdit) { if (canEdit) {
ControlLink link = new ControlLink(value.toString()); ControlLink link = new ControlLink(value.toString());
link.setConfirmation((String) PublicationGlobalizationUtil. link.setConfirmation(PublicationGlobalizationUtil.globalize(
globalize( "publications.ui.with_publisher.publisher.remove.confirm"));
"publications.ui.with_publisher.publisher.remove.confirm").
localize());
return link; return link;
} else { } else {
Label label = new Label(value.toString()); Label label = new Label(value.toString());
@ -251,6 +252,7 @@ public class PublicationWithPublisherSetPublisherSheet
} }
} }
@Override
public void cellSelected(final TableActionEvent event) { public void cellSelected(final TableActionEvent event) {
PageState state = event.getPageState(); PageState state = event.getPageState();
@ -267,6 +269,7 @@ public class PublicationWithPublisherSetPublisherSheet
} }
@Override
public void headSelected(final TableActionEvent event) { public void headSelected(final TableActionEvent event) {
//Nothing to do //Nothing to do
} }

View File

@ -46,8 +46,8 @@ public class PublicationWithPublisherSetPublisherStep extends SimpleEditStep {
BasicItemForm setPublisherForm = new PublicationWithPublisherSetPublisherForm( BasicItemForm setPublisherForm = new PublicationWithPublisherSetPublisherForm(
itemModel); itemModel);
add(SET_PUBLICATION_PUBLISHER_STEP, add(SET_PUBLICATION_PUBLISHER_STEP,
(String) PublicationGlobalizationUtil.globalize( PublicationGlobalizationUtil.globalize(
"publications.ui.with_publisher.setPublisher").localize(), "publications.ui.with_publisher.setPublisher"),
new WorkflowLockedComponentAccess(setPublisherForm, itemModel), new WorkflowLockedComponentAccess(setPublisherForm, itemModel),
setPublisherForm.getSaveCancelSection().getCancelButton()); setPublisherForm.getSaveCancelSection().getCancelButton());

View File

@ -58,6 +58,7 @@ public class PublisherCreate extends PageCreate {
@Override @Override
protected void addWidgets() { protected void addWidgets() {
ContentType type = getItemSelectionModel().getContentType(); ContentType type = getItemSelectionModel().getContentType();
m_workflowSection = new ApplyWorkflowFormSection(type); m_workflowSection = new ApplyWorkflowFormSection(type);
add(m_workflowSection, ColumnPanel.INSERT); add(m_workflowSection, ColumnPanel.INSERT);
@ -70,8 +71,6 @@ public class PublisherCreate extends PageCreate {
PublisherPropertyForm.addMandatoryFieldWidgets(this); PublisherPropertyForm.addMandatoryFieldWidgets(this);
if (!ContentSection.getConfig().getHideLaunchDate()) { if (!ContentSection.getConfig().getHideLaunchDate()) {
add(new Label(GlobalizationUtil.globalize(
"cms.ui.authoring.page_launch_date")));
ParameterModel launchDateParam = new DateParameter(LAUNCH_DATE); ParameterModel launchDateParam = new DateParameter(LAUNCH_DATE);
com.arsdigita.bebop.form.Date launchDate = com.arsdigita.bebop.form.Date launchDate =
new com.arsdigita.bebop.form.Date( new com.arsdigita.bebop.form.Date(
@ -82,13 +81,16 @@ public class PublisherCreate extends PageCreate {
// if launch date is required, help user by suggesting today's date // if launch date is required, help user by suggesting today's date
launchDateParam.setDefaultValue(new Date()); launchDateParam.setDefaultValue(new Date());
} }
launchDate.setLabel(GlobalizationUtil.globalize(
"cms.ui.authoring.page_launch_date"));
add(launchDate); add(launchDate);
} }
} }
@Override @Override
public void validate(FormSectionEvent fse) throws FormProcessException { public void validate(FormSectionEvent fse) throws FormProcessException {
//We don't call super.validate(fse); here because the name (URL fragment) of a publisher is generated in a different manner //We don't call super.validate(fse); here because the name
//(URL fragment) of a publisher is generated in a different manner
//than the name (URL fragment) of other content items. //than the name (URL fragment) of other content items.
Folder folder = m_parent.getFolder(fse.getPageState()); Folder folder = m_parent.getFolder(fse.getPageState());
Assert.exists(folder); Assert.exists(folder);

View File

@ -43,8 +43,8 @@ public class PublisherPropertiesStep
public static Component getPublisherPropertySheet( public static Component getPublisherPropertySheet(
ItemSelectionModel itemModel) { ItemSelectionModel itemModel) {
DomainObjectPropertySheet sheet = (DomainObjectPropertySheet) getGenericOrganizationalUnitPropertySheet( DomainObjectPropertySheet sheet = (DomainObjectPropertySheet)
itemModel); getGenericOrganizationalUnitPropertySheet(itemModel);
sheet.add(PublicationGlobalizationUtil.globalize( sheet.add(PublicationGlobalizationUtil.globalize(
"publications.ui.publisher.name"), "publications.ui.publisher.name"),
@ -65,20 +65,19 @@ public class PublisherPropertiesStep
EDIT_SHEET_NAME); EDIT_SHEET_NAME);
BasicPageForm editBasicSheet = new PublisherPropertyForm(itemModel, BasicPageForm editBasicSheet = new PublisherPropertyForm(itemModel,
this); this);
basicProperties.add(EDIT_SHEET_NAME, basicProperties.add(
(String) PublicationGlobalizationUtil.globalize( EDIT_SHEET_NAME,
"publications.ui.publisher.edit_basic_properties").localize(), PublicationGlobalizationUtil.globalize(
new WorkflowLockedComponentAccess(editBasicSheet, "publications.ui.publisher.edit_basic_properties"),
itemModel), new WorkflowLockedComponentAccess(editBasicSheet,itemModel),
editBasicSheet.getSaveCancelSection(). editBasicSheet.getSaveCancelSection().getCancelButton());
getCancelButton());
basicProperties.setDisplayComponent( basicProperties.setDisplayComponent(
getPublisherPropertySheet(itemModel)); getPublisherPropertySheet(itemModel));
getSegmentedPanel().addSegment( getSegmentedPanel().addSegment(
new Label((String) PublicationGlobalizationUtil.globalize( new Label(PublicationGlobalizationUtil.globalize(
"publications.ui.publisher.basic_properties").localize()), "publications.ui.publisher.basic_properties")),
basicProperties); basicProperties);
} }
} }

View File

@ -69,19 +69,21 @@ public class PublisherPropertyForm
} }
public static void addMandatoryFieldWidgets(FormSection form) { public static void addMandatoryFieldWidgets(FormSection form) {
form.add(new Label((String) PublicationGlobalizationUtil.globalize(
"publications.ui.publisher.name").localize()));
ParameterModel nameParam = new StringParameter(PUBLISHER_NAME); ParameterModel nameParam = new StringParameter(PUBLISHER_NAME);
TextField name = new TextField(nameParam); TextField name = new TextField(nameParam);
name.setLabel(PublicationGlobalizationUtil.globalize(
"publications.ui.publisher.name"));
name.addValidationListener(new NotNullValidationListener()); name.addValidationListener(new NotNullValidationListener());
name.addValidationListener(new NotEmptyValidationListener()); name.addValidationListener(new NotEmptyValidationListener());
form.add(name); form.add(name);
form.add(new Label((String) PublicationGlobalizationUtil.globalize(
"publications.ui.publisher.place").localize()));
ParameterModel placeParam = new StringParameter(PLACE); ParameterModel placeParam = new StringParameter(PLACE);
TextField place = new TextField(placeParam); TextField place = new TextField(placeParam);
place.setLabel(PublicationGlobalizationUtil.globalize(
"publications.ui.publisher.place"));
form.add(place); form.add(place);
} }
@Override @Override

View File

@ -29,7 +29,8 @@ import com.arsdigita.cms.ui.authoring.SimpleEditStep;
*/ */
public class PublisherPublicationsStep extends SimpleEditStep { public class PublisherPublicationsStep extends SimpleEditStep {
public PublisherPublicationsStep(final ItemSelectionModel itemModel, final AuthoringKitWizard parent) { public PublisherPublicationsStep(final ItemSelectionModel itemModel,
final AuthoringKitWizard parent) {
this(itemModel, parent, null); this(itemModel, parent, null);
} }
@ -38,7 +39,8 @@ public class PublisherPublicationsStep extends SimpleEditStep {
final String prefix) { final String prefix) {
super(itemModel, parent, prefix); super(itemModel, parent, prefix);
final PublisherPublicationsTable publicationsTable = new PublisherPublicationsTable(itemModel); final PublisherPublicationsTable publicationsTable =
new PublisherPublicationsTable(itemModel);
setDisplayComponent(publicationsTable); setDisplayComponent(publicationsTable);
} }

View File

@ -56,20 +56,24 @@ public class PublisherPublicationsTable extends Table {
this.itemModel = itemModel; this.itemModel = itemModel;
setEmptyView(new Label(PublicationGlobalizationUtil.globalize("publisher.ui.publications.none"))); setEmptyView(new Label(PublicationGlobalizationUtil.globalize(
"publisher.ui.publications.none")));
final TableColumnModel columnModel = getColumnModel(); final TableColumnModel columnModel = getColumnModel();
columnModel.add(new TableColumn( columnModel.add(new TableColumn(
0, 0,
PublicationGlobalizationUtil.globalize("publisher.ui.publications.name").localize(), new Label(PublicationGlobalizationUtil.globalize(
"publisher.ui.publications.name")),
TABLE_COL_EDIT)); TABLE_COL_EDIT));
columnModel.add(new TableColumn( columnModel.add(new TableColumn(
1, 1,
PublicationGlobalizationUtil.globalize("publisher.ui.publications.columns.year").localize(), new Label(PublicationGlobalizationUtil.globalize(
"publisher.ui.publications.columns.year")),
TABLE_COL_YEAR)); TABLE_COL_YEAR));
columnModel.add(new TableColumn( columnModel.add(new TableColumn(
2, 2,
PublicationGlobalizationUtil.globalize("publisher.ui.publications.columns.type").localize(), new Label(PublicationGlobalizationUtil.globalize(
"publisher.ui.publications.columns.type")),
TABLE_COL_TYPE)); TABLE_COL_TYPE));
setModelBuilder(new ModelBuilder(itemModel)); setModelBuilder(new ModelBuilder(itemModel));
@ -85,6 +89,7 @@ public class PublisherPublicationsTable extends Table {
this.itemModel = itemModel; this.itemModel = itemModel;
} }
@Override
public TableModel makeModel(final Table table, final PageState state) { public TableModel makeModel(final Table table, final PageState state) {
table.getRowSelectionModel().clearSelection(state); table.getRowSelectionModel().clearSelection(state);
@ -97,8 +102,8 @@ public class PublisherPublicationsTable extends Table {
private class Model implements TableModel { private class Model implements TableModel {
private Table table; private final Table table;
private PublicationBundleCollection publications; private final PublicationBundleCollection publications;
public Model(final Table table, final PageState state, final Publisher publisher) { public Model(final Table table, final PageState state, final Publisher publisher) {
this.table = table; this.table = table;
@ -110,6 +115,7 @@ public class PublisherPublicationsTable extends Table {
return table.getColumnModel().size(); return table.getColumnModel().size();
} }
@Override
public boolean nextRow() { public boolean nextRow() {
boolean ret; boolean ret;
@ -145,6 +151,7 @@ public class PublisherPublicationsTable extends Table {
private class EditCellRenderer extends LockableImpl implements TableCellRenderer { private class EditCellRenderer extends LockableImpl implements TableCellRenderer {
@Override
public Component getComponent(final Table table, public Component getComponent(final Table table,
final PageState state, final PageState state,
final Object value, final Object value,

View File

@ -98,21 +98,20 @@ public class ReviewPropertiesStep extends ArticleInJournalPropertiesStep {
BasicPageForm editBasicSheet = BasicPageForm editBasicSheet =
new ReviewPropertyForm(itemModel, this); new ReviewPropertyForm(itemModel, this);
basicProperties.add(EDIT_SHEET_NAME, basicProperties.add(
(String) PublicationGlobalizationUtil.globalize( EDIT_SHEET_NAME,
"publications.ui.review.edit_basic_sheet"). PublicationGlobalizationUtil.globalize(
localize(), new WorkflowLockedComponentAccess(editBasicSheet, "publications.ui.review.edit_basic_sheet"),
itemModel), new WorkflowLockedComponentAccess(editBasicSheet,itemModel),
editBasicSheet.getSaveCancelSection(). editBasicSheet.getSaveCancelSection().getCancelButton());
getCancelButton());
basicProperties.setDisplayComponent( basicProperties.setDisplayComponent(
getReviewPropertySheet(itemModel)); getReviewPropertySheet(itemModel));
getSegmentedPanel().addSegment( getSegmentedPanel().addSegment(
new Label((String) PublicationGlobalizationUtil.globalize( new Label(PublicationGlobalizationUtil.globalize(
"publications.ui.publication.basic_properties"). "publications.ui.publication.basic_properties")),
localize()), basicProperties); basicProperties);
} }
} }

View File

@ -43,8 +43,8 @@ public class SciAuthorPropertiesStep extends SimpleEditStep {
BasicPageForm editSheet; BasicPageForm editSheet;
editSheet = new SciAuthorPropertyForm(itemModel, this); editSheet = new SciAuthorPropertyForm(itemModel, this);
add(EDIT_SHEET_NAME, add(EDIT_SHEET_NAME,
(String) PublicationGlobalizationUtil.globalize( PublicationGlobalizationUtil.globalize(
"sciauthor.ui.edit_basic_properties").localize(), "sciauthor.ui.edit_basic_properties"),
new WorkflowLockedComponentAccess(editSheet, itemModel), new WorkflowLockedComponentAccess(editSheet, itemModel),
editSheet.getSaveCancelSection().getCancelButton()); editSheet.getSaveCancelSection().getCancelButton());

View File

@ -80,17 +80,18 @@ public class SeriesEditshipAddForm
@Override @Override
protected void addWidgets() { protected void addWidgets() {
add(new Label(PublicationGlobalizationUtil.globalize(
"publications.ui.series.editship.selectEditors")));
m_itemSearch = new ItemSearchWidget( m_itemSearch = new ItemSearchWidget(
ITEM_SEARCH, ITEM_SEARCH,
ContentType.findByAssociatedObjectType(GenericPerson.class. ContentType.findByAssociatedObjectType(GenericPerson.class.
getName())); getName()));
m_itemSearch.setDefaultCreationFolder(config.getDefaultAuthorsFolder()); m_itemSearch.setDefaultCreationFolder(config.getDefaultAuthorsFolder());
m_itemSearch.setEditAfterCreate(false); m_itemSearch.setEditAfterCreate(false);
m_itemSearch.setLabel(PublicationGlobalizationUtil.globalize(
"publications.ui.series.editship.selectEditors"));
add(m_itemSearch); add(m_itemSearch);
selectedEditorLabel = new Label(""); selectedEditorLabel = new Label();
add(selectedEditorLabel); add(selectedEditorLabel);
final ParameterModel fromSkipMonthParam = final ParameterModel fromSkipMonthParam =
@ -105,8 +106,6 @@ public class SeriesEditshipAddForm
Hidden fromSkipDay = new Hidden(fromSkipDayParam); Hidden fromSkipDay = new Hidden(fromSkipDayParam);
add(fromSkipDay); add(fromSkipDay);
add(new Label((String) PublicationGlobalizationUtil.globalize(
"publications.ui.series.editship.from").localize()));
IncompleteDateParameter fromParam = IncompleteDateParameter fromParam =
new IncompleteDateParameter( new IncompleteDateParameter(
EditshipCollection.FROM); EditshipCollection.FROM);
@ -116,6 +115,8 @@ public class SeriesEditshipAddForm
fromParam); fromParam);
Calendar today = new GregorianCalendar(); Calendar today = new GregorianCalendar();
from.setYearRange(1900, today.get(Calendar.YEAR)); from.setYearRange(1900, today.get(Calendar.YEAR));
from.setLabel(PublicationGlobalizationUtil.globalize(
"publications.ui.series.editship.from"));
add(from); add(from);
final ParameterModel toSkipMonthParam = final ParameterModel toSkipMonthParam =
@ -129,8 +130,6 @@ public class SeriesEditshipAddForm
Hidden toSkipDay = new Hidden(toSkipDayParam); Hidden toSkipDay = new Hidden(toSkipDayParam);
add(toSkipDay); add(toSkipDay);
add(new Label((String) PublicationGlobalizationUtil.globalize(
"publications.ui.series.editship.to").localize()));
IncompleteDateParameter toParam = IncompleteDateParameter toParam =
new IncompleteDateParameter( new IncompleteDateParameter(
EditshipCollection.TO); EditshipCollection.TO);
@ -139,6 +138,8 @@ public class SeriesEditshipAddForm
com.arsdigita.bebop.form.Date to = new com.arsdigita.bebop.form.Date( com.arsdigita.bebop.form.Date to = new com.arsdigita.bebop.form.Date(
toParam); toParam);
to.setYearRange(1900, today.get(Calendar.YEAR)); to.setYearRange(1900, today.get(Calendar.YEAR));
to.setLabel(PublicationGlobalizationUtil.globalize(
"publications.ui.series.editship.to"));
add(to); add(to);
} }

View File

@ -51,8 +51,8 @@ public class SeriesEditshipStep extends SimpleEditStep {
BasicItemForm addEditorSheet = new SeriesEditshipAddForm(itemModel, BasicItemForm addEditorSheet = new SeriesEditshipAddForm(itemModel,
this); this);
add(ADD_EDITOR_SHEET_NAME, add(ADD_EDITOR_SHEET_NAME,
(String) PublicationGlobalizationUtil.globalize( PublicationGlobalizationUtil.globalize(
"publications.ui.series.add_editship").localize(), "publications.ui.series.add_editship"),
new WorkflowLockedComponentAccess(addEditorSheet, itemModel), new WorkflowLockedComponentAccess(addEditorSheet, itemModel),
addEditorSheet.getSaveCancelSection().getCancelButton()); addEditorSheet.getSaveCancelSection().getCancelButton());

View File

@ -77,26 +77,26 @@ public class SeriesEditshipTable extends Table implements TableActionListener {
TableColumnModel colModel = getColumnModel(); TableColumnModel colModel = getColumnModel();
colModel.add(new TableColumn( colModel.add(new TableColumn(
0, 0,
PublicationGlobalizationUtil.globalize( new Label(PublicationGlobalizationUtil.globalize(
"publications.ui.series.editship.name").localize(), "publications.ui.series.editship.name")),
TABLE_COL_EDIT)); TABLE_COL_EDIT));
colModel.add(new TableColumn( colModel.add(new TableColumn(
1, 1,
PublicationGlobalizationUtil.globalize( new Label(PublicationGlobalizationUtil.globalize(
"publications.ui.series.editship.from").localize())); "publications.ui.series.editship.from"))));
colModel.add(new TableColumn( colModel.add(new TableColumn(
2, 2,
PublicationGlobalizationUtil.globalize( new Label(PublicationGlobalizationUtil.globalize(
"publications.ui.series.editship.to").localize())); "publications.ui.series.editship.to"))));
colModel.add(new TableColumn( colModel.add(new TableColumn(
3, 3,
PublicationGlobalizationUtil.globalize( new Label(PublicationGlobalizationUtil.globalize(
"publications.ui.series.editship.edit").localize(), "publications.ui.series.editship.edit")),
TABLE_COL_EDIT_EDITSHIP)); TABLE_COL_EDIT_EDITSHIP));
colModel.add(new TableColumn( colModel.add(new TableColumn(
4, 4,
PublicationGlobalizationUtil.globalize( new Label(PublicationGlobalizationUtil.globalize(
"publications.ui.series.editship.remove").localize(), "publications.ui.series.editship.remove")),
TABLE_COL_DEL)); TABLE_COL_DEL));
/* Just in the case someone want's to sort editships manually..." */ /* Just in the case someone want's to sort editships manually..." */
/* colModel.add(new TableColumn( /* colModel.add(new TableColumn(
@ -198,12 +198,11 @@ public class SeriesEditshipTable extends Table implements TableActionListener {
m_editshipCollection.getTo()); m_editshipCollection.getTo());
} }
case 3: case 3:
return PublicationGlobalizationUtil.globalize( return new Label(PublicationGlobalizationUtil.globalize(
"publications.ui.series.editship.edit").localize(); "publications.ui.series.editship.edit"));
case 4: case 4:
return PublicationGlobalizationUtil.globalize( return new Label(PublicationGlobalizationUtil.globalize(
"publications.ui.series.editship.remove"). "publications.ui.series.editship.remove"));
localize();
default: default:
return null; return null;
} }
@ -331,10 +330,8 @@ public class SeriesEditshipTable extends Table implements TableActionListener {
if (canDelete) { if (canDelete) {
ControlLink link = new ControlLink(value.toString()); ControlLink link = new ControlLink(value.toString());
link.setConfirmation((String) PublicationGlobalizationUtil. link.setConfirmation(PublicationGlobalizationUtil.globalize(
globalize( "publications.ui.series.editship.remove.confirm"));
"publications.ui.series.editship.remove.confirm").
localize());
return link; return link;
} else { } else {
Label label = new Label(value.toString()); Label label = new Label(value.toString());

View File

@ -108,16 +108,15 @@ public class SeriesPropertiesStep extends SimpleEditStep {
basicProperties.add( basicProperties.add(
EDIT_SHEET_NAME, EDIT_SHEET_NAME,
(String) PublicationGlobalizationUtil.globalize( PublicationGlobalizationUtil.globalize(
"publications.ui.series.edit_basic_sheet").localize(), "publications.ui.series.edit_basic_sheet"),
new WorkflowLockedComponentAccess(editBasicSheet, new WorkflowLockedComponentAccess(editBasicSheet,itemModel),
itemModel),
editBasicSheet.getSaveCancelSection().getCancelButton()); editBasicSheet.getSaveCancelSection().getCancelButton());
basicProperties.setDisplayComponent(getSeriesPropertySheet(itemModel)); basicProperties.setDisplayComponent(getSeriesPropertySheet(itemModel));
segmentedPanel.addSegment(new Label((String) PublicationGlobalizationUtil. segmentedPanel.addSegment(new Label(PublicationGlobalizationUtil.
globalize("publications.ui.series.basic_properties").localize()), globalize("publications.ui.series.basic_properties")),
basicProperties); basicProperties);
} }

View File

@ -64,10 +64,10 @@ public class SeriesPropertyForm
protected void addWidgets() { protected void addWidgets() {
super.addWidgets(); super.addWidgets();
add(new Label((String) PublicationGlobalizationUtil.globalize(
"publications.ui.series.abstract").localize()));
ParameterModel abstractParam = new StringParameter(Series.ABSTRACT); ParameterModel abstractParam = new StringParameter(Series.ABSTRACT);
TextArea abstractArea = new TextArea(abstractParam); TextArea abstractArea = new TextArea(abstractParam);
abstractArea.setLabel(PublicationGlobalizationUtil.globalize(
"publications.ui.series.abstract"));
abstractArea.setCols(60); abstractArea.setCols(60);
abstractArea.setRows(18); abstractArea.setRows(18);
add(abstractArea); add(abstractArea);

View File

@ -62,16 +62,17 @@ public class SeriesVolumeAddForm extends BasicItemForm {
@Override @Override
protected void addWidgets() { protected void addWidgets() {
add(new Label(PublicationGlobalizationUtil.globalize(
"publications.ui.series.volumes.select_publication")));
itemSearch = new ItemSearchWidget( itemSearch = new ItemSearchWidget(
ITEM_SEARCH, ITEM_SEARCH,
ContentType.findByAssociatedObjectType( ContentType.findByAssociatedObjectType(
Publication.class.getName())); Publication.class.getName()));
itemSearch.setDisableCreatePane(true); itemSearch.setDisableCreatePane(true);
itemSearch.setLabel(PublicationGlobalizationUtil.globalize(
"publications.ui.series.volumes.select_publication"));
add(itemSearch); add(itemSearch);
selectedVolumeLabel = new Label(""); selectedVolumeLabel = new Label();
selectedVolumeLabel.addPrintListener(new PrintListener() { selectedVolumeLabel.addPrintListener(new PrintListener() {
@Override @Override
@ -84,9 +85,10 @@ public class SeriesVolumeAddForm extends BasicItemForm {
}); });
add(selectedVolumeLabel); add(selectedVolumeLabel);
add(new Label(PublicationGlobalizationUtil.globalize("publications.ui.series.volume_of_series")));
ParameterModel volumeOfSeriesParam = new StringParameter(VolumeInSeriesCollection.VOLUME_OF_SERIES); ParameterModel volumeOfSeriesParam = new StringParameter(VolumeInSeriesCollection.VOLUME_OF_SERIES);
volumeOfSeries = new TextField(volumeOfSeriesParam); volumeOfSeries = new TextField(volumeOfSeriesParam);
volumeOfSeries.setLabel(PublicationGlobalizationUtil.globalize(
"publications.ui.series.volume_of_series"));
add(volumeOfSeries); add(volumeOfSeries);
} }

View File

@ -72,22 +72,22 @@ public class SeriesVolumesTable extends Table {
final TableColumnModel colModel = getColumnModel(); final TableColumnModel colModel = getColumnModel();
colModel.add(new TableColumn( colModel.add(new TableColumn(
0, 0,
PublicationGlobalizationUtil.globalize( new Label(PublicationGlobalizationUtil.globalize(
"publications.ui.series.volumes.name").localize(), "publications.ui.series.volumes.name")),
TABLE_COL_EDIT)); TABLE_COL_EDIT));
colModel.add(new TableColumn( colModel.add(new TableColumn(
1, 1,
PublicationGlobalizationUtil.globalize( new Label(PublicationGlobalizationUtil.globalize(
"publications.ui.series.volumes.volume_of_series").localize())); "publications.ui.series.volumes.volume_of_series"))));
colModel.add(new TableColumn( colModel.add(new TableColumn(
2, 2,
PublicationGlobalizationUtil.globalize( new Label(PublicationGlobalizationUtil.globalize(
"publications.ui.series.volumes.edit_assoc").localize(), "publications.ui.series.volumes.edit_assoc")),
TABLE_COL_EDIT_ASSOC)); TABLE_COL_EDIT_ASSOC));
colModel.add(new TableColumn( colModel.add(new TableColumn(
3, 3,
PublicationGlobalizationUtil.globalize( new Label(PublicationGlobalizationUtil.globalize(
"publications.ui.series.volumes.remove").localize(), "publications.ui.series.volumes.remove")),
TABLE_COL_DEL)); TABLE_COL_DEL));
setModelBuilder(new SeriesVolumesTableModelBuilder(itemModel)); setModelBuilder(new SeriesVolumesTableModelBuilder(itemModel));
@ -154,11 +154,11 @@ public class SeriesVolumesTable extends Table {
case 1: case 1:
return volumesCollection.getVolumeOfSeries(); return volumesCollection.getVolumeOfSeries();
case 2: case 2:
return PublicationGlobalizationUtil.globalize( return new Label(PublicationGlobalizationUtil.globalize(
"publications.ui.series.volumes.edit_assoc").localize(); "publications.ui.series.volumes.edit_assoc"));
case 3: case 3:
return PublicationGlobalizationUtil.globalize( return new Label(PublicationGlobalizationUtil.globalize(
"publication.ui.series.volumes.remove").localize(); "publication.ui.series.volumes.remove"));
default: default:
return null; return null;
} }
@ -285,10 +285,8 @@ public class SeriesVolumesTable extends Table {
if (canDelete) { if (canDelete) {
final ControlLink link = new ControlLink(value.toString()); final ControlLink link = new ControlLink(value.toString());
link.setConfirmation((String) PublicationGlobalizationUtil. link.setConfirmation(PublicationGlobalizationUtil.globalize(
globalize( "publications.ui.series.volumes.remove.confirm"));
"publications.ui.series.volumes.remove.confirm").
localize());
return link; return link;
} else { } else {
final Label label = new Label(value.toString()); final Label label = new Label(value.toString());

View File

@ -26,7 +26,6 @@ import com.arsdigita.bebop.event.FormInitListener;
import com.arsdigita.bebop.event.FormProcessListener; import com.arsdigita.bebop.event.FormProcessListener;
import com.arsdigita.bebop.event.FormSectionEvent; import com.arsdigita.bebop.event.FormSectionEvent;
import com.arsdigita.cms.ContentType; import com.arsdigita.cms.ContentType;
import com.arsdigita.cms.Folder;
import com.arsdigita.cms.ItemSelectionModel; import com.arsdigita.cms.ItemSelectionModel;
import com.arsdigita.cms.contenttypes.GenericOrganizationalUnit; import com.arsdigita.cms.contenttypes.GenericOrganizationalUnit;
import com.arsdigita.cms.contenttypes.PublicationsConfig; import com.arsdigita.cms.contenttypes.PublicationsConfig;
@ -34,7 +33,7 @@ import com.arsdigita.cms.contenttypes.UnPublished;
import com.arsdigita.cms.ui.ItemSearchWidget; import com.arsdigita.cms.ui.ItemSearchWidget;
import com.arsdigita.cms.ui.authoring.BasicItemForm; import com.arsdigita.cms.ui.authoring.BasicItemForm;
import com.arsdigita.kernel.Kernel; import com.arsdigita.kernel.Kernel;
import java.math.BigDecimal;
/** /**
* *
@ -60,14 +59,16 @@ public class UnPublishedOrganizationForm
@Override @Override
public void addWidgets() { public void addWidgets() {
add(new Label((String) PublicationGlobalizationUtil.globalize(
"publications.ui.unpublished.organization").localize()));
itemSearch = new ItemSearchWidget(ITEM_SEARCH, itemSearch = new ItemSearchWidget(ITEM_SEARCH,
ContentType.findByAssociatedObjectType( ContentType.findByAssociatedObjectType(
GenericOrganizationalUnit.class.getName())); GenericOrganizationalUnit.class.getName()));
itemSearch.setDefaultCreationFolder(config.getDefaultOrganizationsFolder()); itemSearch.setDefaultCreationFolder(config.getDefaultOrganizationsFolder());
itemSearch.setEditAfterCreate(false); itemSearch.setEditAfterCreate(false);
itemSearch.setLabel(PublicationGlobalizationUtil.globalize(
"publications.ui.unpublished.organization"));
add(itemSearch); add(itemSearch);
} }
@Override @Override

View File

@ -64,13 +64,13 @@ public class UnPublishedOrganizationSheet
TableColumnModel columnModel = getColumnModel(); TableColumnModel columnModel = getColumnModel();
columnModel.add(new TableColumn( columnModel.add(new TableColumn(
0, 0,
PublicationGlobalizationUtil.globalize( new Label(PublicationGlobalizationUtil.globalize(
"publications.ui.unpublished.organization").localize(), "publications.ui.unpublished.organization")),
TABLE_COL_EDIT)); TABLE_COL_EDIT));
columnModel.add(new TableColumn( columnModel.add(new TableColumn(
1, 1,
PublicationGlobalizationUtil.globalize( new Label(PublicationGlobalizationUtil.globalize(
"publications.ui.unpublished.organization.remove").localize(), "publications.ui.unpublished.organization.remove")),
TABLE_COL_DELETE)); TABLE_COL_DELETE));
setModelBuilder(new UnPublishedOrganizationSheetModelBuilder(itemModel)); setModelBuilder(new UnPublishedOrganizationSheetModelBuilder(itemModel));
@ -141,14 +141,14 @@ public class UnPublishedOrganizationSheet
case 0: case 0:
return orga.getTitle(); return orga.getTitle();
case 1: case 1:
return PublicationGlobalizationUtil.globalize( return new Label(PublicationGlobalizationUtil.globalize(
"publications.ui.unpublished.organization.remove"). "publications.ui.unpublished.organization.remove"));
localize();
default: default:
return null; return null;
} }
} }
@Override
public Object getKeyAt(int columnIndex) { public Object getKeyAt(int columnIndex) {
return orga.getID(); return orga.getID();
} }
@ -235,10 +235,8 @@ public class UnPublishedOrganizationSheet
if (canEdit) { if (canEdit) {
ControlLink link = new ControlLink(value.toString()); ControlLink link = new ControlLink(value.toString());
link.setConfirmation((String) PublicationGlobalizationUtil. link.setConfirmation(PublicationGlobalizationUtil.globalize(
globalize( "publications.ui.unpublished.organization.confirm_remove"));
"publications.ui.unpublished.organization.confirm_remove").
localize());
return link; return link;
} else { } else {
Label label = new Label(value.toString()); Label label = new Label(value.toString());
@ -247,6 +245,7 @@ public class UnPublishedOrganizationSheet
} }
} }
@Override
public void cellSelected(final TableActionEvent event) { public void cellSelected(final TableActionEvent event) {
PageState state = event.getPageState(); PageState state = event.getPageState();
@ -260,6 +259,7 @@ public class UnPublishedOrganizationSheet
} }
} }
@Override
public void headSelected(final TableActionEvent event) { public void headSelected(final TableActionEvent event) {
//Nothing to do //Nothing to do
} }

View File

@ -45,8 +45,8 @@ public class UnPublishedOrganizationStep extends SimpleEditStep {
BasicItemForm setOrgaForm = new UnPublishedOrganizationForm(itemModel); BasicItemForm setOrgaForm = new UnPublishedOrganizationForm(itemModel);
add(SET_UNPUBLISHED_ORGANIZATION_STEP, add(SET_UNPUBLISHED_ORGANIZATION_STEP,
(String) PublicationGlobalizationUtil.globalize( PublicationGlobalizationUtil.globalize(
"publications.ui.unpublished.setOrganization").localize(), "publications.ui.unpublished.setOrganization"),
new WorkflowLockedComponentAccess(setOrgaForm, itemModel), new WorkflowLockedComponentAccess(setOrgaForm, itemModel),
setOrgaForm.getSaveCancelSection().getCancelButton()); setOrgaForm.getSaveCancelSection().getCancelButton());

View File

@ -71,21 +71,20 @@ public class UnPublishedPropertiesStep extends PublicationPropertiesStep {
BasicPageForm editBasicSheet = new UnPublishedPropertyForm(itemModel, BasicPageForm editBasicSheet = new UnPublishedPropertyForm(itemModel,
this); this);
basicProperties.add(EDIT_SHEET_NAME, basicProperties.add(
(String) PublicationGlobalizationUtil.globalize( EDIT_SHEET_NAME,
"publications.ui.unpublished.edit_basic_sheet"). PublicationGlobalizationUtil.globalize(
localize(), new WorkflowLockedComponentAccess(editBasicSheet, "publications.ui.unpublished.edit_basic_sheet"),
itemModel), new WorkflowLockedComponentAccess(editBasicSheet,itemModel),
editBasicSheet.getSaveCancelSection(). editBasicSheet.getSaveCancelSection().getCancelButton());
getCancelButton());
basicProperties.setDisplayComponent( basicProperties.setDisplayComponent(
getUnPublishedPropertySheet(itemModel)); getUnPublishedPropertySheet(itemModel));
getSegmentedPanel().addSegment( getSegmentedPanel().addSegment(
new Label((String) PublicationGlobalizationUtil.globalize( new Label(PublicationGlobalizationUtil.globalize(
"publications.ui.publication.basic_properties"). "publications.ui.publication.basic_properties")),
localize()), basicProperties); basicProperties);
} }
@Override @Override
@ -93,8 +92,8 @@ public class UnPublishedPropertiesStep extends PublicationPropertiesStep {
AuthoringKitWizard parent) { AuthoringKitWizard parent) {
super.addSteps(itemModel, parent); super.addSteps(itemModel, parent);
addStep(new UnPublishedOrganizationStep(itemModel, addStep(new UnPublishedOrganizationStep(itemModel,parent),
parent), PublicationGlobalizationUtil.globalize(
"publications.ui.unpublished.organization"); "publications.ui.unpublished.organization"));
} }
} }

View File

@ -62,28 +62,30 @@ public class UnPublishedPropertyForm
@Override @Override
protected void addWidgets() { protected void addWidgets() {
super.addWidgets(); super.addWidgets();
add(new Label((String) PublicationGlobalizationUtil.globalize(
"publications.ui.unpublished.place").localize()));
ParameterModel placeParam = ParameterModel placeParam =
new StringParameter(InternetArticle.PLACE); new StringParameter(InternetArticle.PLACE);
TextField place = new TextField(placeParam); TextField place = new TextField(placeParam);
place.setLabel(PublicationGlobalizationUtil.globalize(
"publications.ui.unpublished.place"));
add(place); add(place);
add(new Label((String) PublicationGlobalizationUtil.globalize(
"publications.ui.unpublished.number").localize()));
ParameterModel numberParam = ParameterModel numberParam =
new StringParameter(UnPublished.NUMBER); new StringParameter(UnPublished.NUMBER);
TextField number = new TextField(numberParam); TextField number = new TextField(numberParam);
number.setLabel(PublicationGlobalizationUtil.globalize(
"publications.ui.unpublished.number"));
add(number); add(number);
add(new Label((String) PublicationGlobalizationUtil.globalize(
"publications.ui.unpublished.number_of_pages").localize()));
ParameterModel numberOfPagesParam = ParameterModel numberOfPagesParam =
new IntegerParameter(UnPublished.NUMBER_OF_PAGES); new IntegerParameter(UnPublished.NUMBER_OF_PAGES);
TextField numberOfPages = new TextField(numberOfPagesParam); TextField numberOfPages = new TextField(numberOfPagesParam);
numberOfPages.setLabel(PublicationGlobalizationUtil.globalize(
"publications.ui.unpublished.number_of_pages"));
add(numberOfPages); add(numberOfPages);
} }
@Override @Override

View File

@ -66,21 +66,20 @@ public class WorkingPaperPropertiesStep extends UnPublishedPropertiesStep {
BasicPageForm editBasicSheet = BasicPageForm editBasicSheet =
new WorkingPaperPropertyForm(itemModel, this); new WorkingPaperPropertyForm(itemModel, this);
basicProperties.add(EDIT_SHEET_NAME, basicProperties.add(
(String) PublicationGlobalizationUtil.globalize( EDIT_SHEET_NAME,
"publications.ui.workingpaper.edit_basic_sheet"). PublicationGlobalizationUtil.globalize(
localize(), new WorkflowLockedComponentAccess(editBasicSheet, "publications.ui.workingpaper.edit_basic_sheet"),
itemModel), new WorkflowLockedComponentAccess(editBasicSheet,itemModel),
editBasicSheet.getSaveCancelSection(). editBasicSheet.getSaveCancelSection().getCancelButton());
getCancelButton());
basicProperties.setDisplayComponent( basicProperties.setDisplayComponent(
getWorkingPaperPropertySheet(itemModel)); getWorkingPaperPropertySheet(itemModel));
getSegmentedPanel().addSegment( getSegmentedPanel().addSegment(
new Label((String) PublicationGlobalizationUtil.globalize( new Label(PublicationGlobalizationUtil.globalize(
"publications.ui.publication.basic_properties"). "publications.ui.publication.basic_properties")),
localize()), basicProperties); basicProperties);
} }
private static class ReviewedFormatter private static class ReviewedFormatter
@ -91,6 +90,7 @@ public class WorkingPaperPropertiesStep extends UnPublishedPropertiesStep {
super(); super();
} }
@Override
public String format(DomainObject obj, String attribute, PageState state) { public String format(DomainObject obj, String attribute, PageState state) {
if ((get(obj, attribute) != null) if ((get(obj, attribute) != null)
&& (get(obj, attribute) instanceof Boolean) && (get(obj, attribute) instanceof Boolean)

View File

@ -59,12 +59,13 @@ public class WorkingPaperPropertyForm
@Override @Override
protected void addWidgets() { protected void addWidgets() {
super.addWidgets(); super.addWidgets();
add(new Label(PublicationGlobalizationUtil.globalize(
"publications.ui.workingpaper.reviewed")));
reviewed = new CheckboxGroup("reviewedGroup"); reviewed = new CheckboxGroup("reviewedGroup");
reviewed.addOption(new Option(REVIEWED, "")); reviewed.addOption(new Option(REVIEWED, ""));
reviewed.setLabel(PublicationGlobalizationUtil.globalize(
"publications.ui.workingpaper.reviewed"));
add(reviewed); add(reviewed);
} }

View File

@ -53,8 +53,7 @@ public class SciDepartmentDescriptionEditForm
@Override @Override
public void addWidgets() { public void addWidgets() {
add(new Label(SciDepartmentGlobalizationUtil.globalize(
"scidepartment.ui.description")));
final ParameterModel descParam = new StringParameter( final ParameterModel descParam = new StringParameter(
SciDepartment.DEPARTMENT_DESCRIPTION); SciDepartment.DEPARTMENT_DESCRIPTION);
final TextArea desc; final TextArea desc;
@ -63,9 +62,12 @@ public class SciDepartmentDescriptionEditForm
} else { } else {
desc = new TextArea(descParam); desc = new TextArea(descParam);
} }
desc.setLabel(SciDepartmentGlobalizationUtil.globalize(
"scidepartment.ui.description"));
desc.setCols(75); desc.setCols(75);
desc.setRows(25); desc.setRows(25);
add(desc); add(desc);
} }
@Override @Override

View File

@ -51,17 +51,16 @@ public class SciDepartmentDescriptionStep extends SimpleEditStep {
final BasicItemForm editDescFrom = new SciDepartmentDescriptionEditForm( final BasicItemForm editDescFrom = new SciDepartmentDescriptionEditForm(
itemModel); itemModel);
add(EDIT_DEPARTMENT_DESC_SHEET_NAME, add(EDIT_DEPARTMENT_DESC_SHEET_NAME,
(String) SciDepartmentGlobalizationUtil.globalize( SciDepartmentGlobalizationUtil.globalize(
"scidepartment.ui.desc.edit").localize(), "scidepartment.ui.desc.edit"),
new WorkflowLockedComponentAccess(editDescFrom, itemModel), new WorkflowLockedComponentAccess(editDescFrom, itemModel),
editDescFrom.getSaveCancelSection().getCancelButton()); editDescFrom.getSaveCancelSection().getCancelButton());
final SciDepartmentDescriptionUploadForm updateDescForm = final SciDepartmentDescriptionUploadForm updateDescForm =
new SciDepartmentDescriptionUploadForm( new SciDepartmentDescriptionUploadForm(itemModel);
itemModel);
add(UPDATE_DEPARTMENT_DESC_SHEET_NAME, add(UPDATE_DEPARTMENT_DESC_SHEET_NAME,
(String) SciDepartmentGlobalizationUtil.globalize( SciDepartmentGlobalizationUtil.globalize(
"scidepartment.ui.desc.upload").localize(), "scidepartment.ui.desc.upload"),
new WorkflowLockedComponentAccess(updateDescForm, itemModel), new WorkflowLockedComponentAccess(updateDescForm, itemModel),
updateDescForm.getSaveCancelSection().getCancelButton()); updateDescForm.getSaveCancelSection().getCancelButton());

View File

@ -23,8 +23,8 @@ import com.arsdigita.cms.contenttypes.SciDepartment;
/** /**
* Table displaying the members of an SciDepartment. Based on the * Table displaying the members of an SciDepartment. Based on the
* {@link GenericOrganizationalUnitPersonsTable} it overwrites only the methods provided by the * {@link GenericOrganizationalUnitPersonsTable} it overwrites only the methods
* superclass for customising the form. * provided by the superclass for customising the form.
* *
* @author Jens Pelzetter * @author Jens Pelzetter
* @version $Id$ * @version $Id$

View File

@ -46,41 +46,48 @@ public class SciDepartmentProjectsStep extends SimpleEditStep {
super(itemModel, parent, prefix); super(itemModel, parent, prefix);
final BasicItemForm addProjectSheet = final BasicItemForm addProjectSheet =
new GenericOrganizationalUnitSubordinateOrgaUnitAddForm( new GenericOrganizationalUnitSubordinateOrgaUnitAddForm(
itemModel, itemModel,
new GenericOrgaUnitSubordinateOrgaUnitAddFormCustomizer() { new GenericOrgaUnitSubordinateOrgaUnitAddFormCustomizer() {
@Override
public String getSelectSubordinateOrgaUnitLabel() { public String getSelectSubordinateOrgaUnitLabel() {
return (String) SciDepartmentGlobalizationUtil.globalize( return (String) SciDepartmentGlobalizationUtil.globalize(
"scidepartment.ui.projects.select").localize(); "scidepartment.ui.projects.select").localize();
} }
@Override
public String getSubordinateOrgaUnitType() { public String getSubordinateOrgaUnitType() {
return "com.arsdigita.cms.contenttypes.SciProject"; return "com.arsdigita.cms.contenttypes.SciProject";
} }
@Override
public String getAssocType() { public String getAssocType() {
return ASSOC_TYPE; return ASSOC_TYPE;
} }
@Override
public String getNothingSelectedMessage() { public String getNothingSelectedMessage() {
return (String) SciDepartmentGlobalizationUtil.globalize( return (String) SciDepartmentGlobalizationUtil.globalize(
"scidepartment.ui.projects.select.nothing"). "scidepartment.ui.projects.select.nothing").
localize(); localize();
} }
@Override
public String getNoSuitableLanguageVariantMessage() { public String getNoSuitableLanguageVariantMessage() {
return (String) SciDepartmentGlobalizationUtil.globalize( return (String) SciDepartmentGlobalizationUtil.globalize(
"scidepartment.ui.projects.no_suitable_language_variant"). "scidepartment.ui.projects.no_suitable_language_variant").
localize(); localize();
} }
@Override
public String getAddingToItselfMessage() { public String getAddingToItselfMessage() {
return (String) SciDepartmentGlobalizationUtil.globalize( return (String) SciDepartmentGlobalizationUtil.globalize(
"scidepartment.ui.projects.adding_to_itself"). "scidepartment.ui.projects.adding_to_itself").
localize(); localize();
} }
@Override
public String getAlreadyAddedMessage() { public String getAlreadyAddedMessage() {
return (String) SciDepartmentGlobalizationUtil.globalize( return (String) SciDepartmentGlobalizationUtil.globalize(
"scidepartment.ui.projects.already_added"). "scidepartment.ui.projects.already_added").
@ -88,15 +95,15 @@ public class SciDepartmentProjectsStep extends SimpleEditStep {
} }
}); });
add(ADD_PROJECT_SHEET_NAME, add(ADD_PROJECT_SHEET_NAME,
(String) SciDepartmentGlobalizationUtil.globalize( SciDepartmentGlobalizationUtil.globalize(
"scidepartment.ui.projects.add").localize(), "scidepartment.ui.projects.add"),
new WorkflowLockedComponentAccess(addProjectSheet, itemModel), new WorkflowLockedComponentAccess(addProjectSheet, itemModel),
addProjectSheet.getSaveCancelSection().getCancelButton()); addProjectSheet.getSaveCancelSection().getCancelButton());
final GenericOrganizationalUnitSubordinateOrgaUnitsTable projectsTable = final GenericOrganizationalUnitSubordinateOrgaUnitsTable projectsTable =
new GenericOrganizationalUnitSubordinateOrgaUnitsTable( new GenericOrganizationalUnitSubordinateOrgaUnitsTable(
itemModel, itemModel,
new GenericOrgaUnitSubordinateOrgaUnitsTableCustomizer() { new GenericOrgaUnitSubordinateOrgaUnitsTableCustomizer() {
public String getEmptyViewLabel() { public String getEmptyViewLabel() {
return (String) SciDepartmentGlobalizationUtil.globalize( return (String) SciDepartmentGlobalizationUtil.globalize(

View File

@ -68,20 +68,19 @@ public class SciDepartmentPropertiesStep
final BasicPageForm editBasicSheet = new SciDepartmentPropertyForm( final BasicPageForm editBasicSheet = new SciDepartmentPropertyForm(
itemModel, this); itemModel, this);
basicProperties.add(EDIT_SHEET_NAME, basicProperties.add(
(String) SciDepartmentGlobalizationUtil.globalize( EDIT_SHEET_NAME,
"scidepartment.ui.edit_basic_sheet").localize(), SciDepartmentGlobalizationUtil.globalize(
new WorkflowLockedComponentAccess(editBasicSheet, "scidepartment.ui.edit_basic_sheet"),
itemModel), new WorkflowLockedComponentAccess(editBasicSheet,itemModel),
editBasicSheet.getSaveCancelSection(). editBasicSheet.getSaveCancelSection().getCancelButton());
getCancelButton());
basicProperties.setDisplayComponent(getSciDepartmentPropertySheet( basicProperties.setDisplayComponent(getSciDepartmentPropertySheet(
itemModel)); itemModel));
getSegmentedPanel().addSegment( getSegmentedPanel().addSegment(
new Label((String) SciDepartmentGlobalizationUtil.globalize( new Label(SciDepartmentGlobalizationUtil.globalize(
"scidepartment.ui.edit_basic_properties").localize()), "scidepartment.ui.edit_basic_properties")),
basicProperties); basicProperties);
} }

View File

@ -62,16 +62,17 @@ public class SciDepartmentPropertyForm
@Override @Override
public void addWidgets() { public void addWidgets() {
super.addWidgets(); super.addWidgets();
add(new Label(SciDepartmentGlobalizationUtil.globalize(
"scidepartment.ui.shortdesc")));
ParameterModel shortDescParam = new StringParameter( ParameterModel shortDescParam = new StringParameter(
SciDepartment.DEPARTMENT_SHORT_DESCRIPTION); SciDepartment.DEPARTMENT_SHORT_DESCRIPTION);
TextArea shortDesc = new TextArea(shortDescParam); TextArea shortDesc = new TextArea(shortDescParam);
shortDesc.addValidationListener( shortDesc.addValidationListener(new StringInRangeValidationListener(
new StringInRangeValidationListener(0, 0,
config.getShortDescMaxLength())); config.getShortDescMaxLength()));
shortDesc.setLabel(SciDepartmentGlobalizationUtil.globalize(
"scidepartment.ui.shortdesc"));
shortDesc.setCols(75); shortDesc.setCols(75);
shortDesc.setRows(5); shortDesc.setRows(5);
add(shortDesc); add(shortDesc);

View File

@ -91,9 +91,9 @@ public class SciDepartmentSubDepartmentsStep extends SimpleEditStep {
} }
}); });
add(ADD_SUBDEPARTMENT_SHEET_NAME, add(ADD_SUBDEPARTMENT_SHEET_NAME,
(String) SciDepartmentGlobalizationUtil.globalize( SciDepartmentGlobalizationUtil.globalize(
"scidepartment.ui.subdepartment.add").localize(), "scidepartment.ui.subdepartment.add"),
new WorkflowLockedComponentAccess(addSubDepartmentSheet, itemModel), new WorkflowLockedComponentAccess(addSubDepartmentSheet,itemModel),
addSubDepartmentSheet.getSaveCancelSection().getCancelButton()); addSubDepartmentSheet.getSaveCancelSection().getCancelButton());
final GenericOrganizationalUnitSubordinateOrgaUnitsTable subDepartmentTable = final GenericOrganizationalUnitSubordinateOrgaUnitsTable subDepartmentTable =

View File

@ -91,9 +91,9 @@ public class SciDepartmentSuperDepartmentsStep extends SimpleEditStep {
} }
}); });
add(ADD_SUPER_DEPARTMENT_SHEET_NAME, add(ADD_SUPER_DEPARTMENT_SHEET_NAME,
(String) SciDepartmentGlobalizationUtil.globalize( SciDepartmentGlobalizationUtil.globalize(
"scidepartment.ui.superdepartment.add").localize(), "scidepartment.ui.superdepartment.add"),
new WorkflowLockedComponentAccess(addSuperDepartmentSheet, itemModel), new WorkflowLockedComponentAccess(addSuperDepartmentSheet,itemModel),
addSuperDepartmentSheet.getSaveCancelSection().getCancelButton()); addSuperDepartmentSheet.getSaveCancelSection().getCancelButton());
final GenericOrganizationalUnitSuperiorOrgaUnitsTable superDeparmentsTable = final GenericOrganizationalUnitSuperiorOrgaUnitsTable superDeparmentsTable =

View File

@ -87,8 +87,8 @@ public class SciProjectDepartmentsStep extends SimpleEditStep {
}); });
add(ADD_DEPARTMENT_SHEET_NAME, add(ADD_DEPARTMENT_SHEET_NAME,
(String) SciDepartmentGlobalizationUtil.globalize( SciDepartmentGlobalizationUtil.globalize(
"sciproject.ui.department.add").localize(), "sciproject.ui.department.add"),
new WorkflowLockedComponentAccess(addDepartmentSheet, itemModel), new WorkflowLockedComponentAccess(addDepartmentSheet, itemModel),
addDepartmentSheet.getSaveCancelSection().getCancelButton()); addDepartmentSheet.getSaveCancelSection().getCancelButton());

View File

@ -78,8 +78,8 @@ public class SciDepartmentInstitutesStep extends SimpleEditStep {
}); });
add(ADD_INSTITUTE_SHEET_NAME, add(ADD_INSTITUTE_SHEET_NAME,
(String) SciInstituteGlobalizationUtil.globalize( SciInstituteGlobalizationUtil.globalize(
"scidepartment.ui.institute.add").localize(), "scidepartment.ui.institute.add"),
new WorkflowLockedComponentAccess(addInstituteSheet, itemModel), new WorkflowLockedComponentAccess(addInstituteSheet, itemModel),
addInstituteSheet.getSaveCancelSection().getCancelButton()); addInstituteSheet.getSaveCancelSection().getCancelButton());

View File

@ -73,8 +73,8 @@ public class SciInstituteDepartmentsStep extends SimpleEditStep {
}); });
add(ADD_DEPARTMENT_SHEET_NAME, add(ADD_DEPARTMENT_SHEET_NAME,
(String) SciInstituteGlobalizationUtil.globalize( SciInstituteGlobalizationUtil.globalize(
"sciinstitute.ui.departments.add").localize(), "sciinstitute.ui.departments.add"),
new WorkflowLockedComponentAccess(addDepartmentSheet, itemModel), new WorkflowLockedComponentAccess(addDepartmentSheet, itemModel),
addDepartmentSheet.getSaveCancelSection().getCancelButton()); addDepartmentSheet.getSaveCancelSection().getCancelButton());

View File

@ -34,8 +34,7 @@ public class SciInstituteDescriptionEditForm
@Override @Override
public void addWidgets() { public void addWidgets() {
add(new Label(SciInstituteGlobalizationUtil.globalize(
"sciinstitute.ui.description")));
final ParameterModel descParam = new StringParameter( final ParameterModel descParam = new StringParameter(
SciInstitute.INSTITUTE_DESCRIPTION); SciInstitute.INSTITUTE_DESCRIPTION);
final TextArea desc; final TextArea desc;
@ -44,9 +43,12 @@ public class SciInstituteDescriptionEditForm
} else { } else {
desc = new TextArea(descParam); desc = new TextArea(descParam);
} }
desc.setLabel(SciInstituteGlobalizationUtil.globalize(
"sciinstitute.ui.description"));
desc.setCols(75); desc.setCols(75);
desc.setRows(25); desc.setRows(25);
add(desc); add(desc);
} }
@Override @Override

View File

@ -33,8 +33,8 @@ public class SciInstituteDescriptionStep extends SimpleEditStep {
final BasicItemForm editDescFrom = new SciInstituteDescriptionEditForm( final BasicItemForm editDescFrom = new SciInstituteDescriptionEditForm(
itemModel); itemModel);
add(EDIT_INSTITUTE_DESC_SHEET_NAME, add(EDIT_INSTITUTE_DESC_SHEET_NAME,
(String) SciInstituteGlobalizationUtil.globalize( SciInstituteGlobalizationUtil.globalize(
"sciinstitute.ui.desc.edit").localize(), "sciinstitute.ui.desc.edit"),
new WorkflowLockedComponentAccess(editDescFrom, itemModel), new WorkflowLockedComponentAccess(editDescFrom, itemModel),
editDescFrom.getSaveCancelSection().getCancelButton()); editDescFrom.getSaveCancelSection().getCancelButton());
@ -42,8 +42,8 @@ public class SciInstituteDescriptionStep extends SimpleEditStep {
new SciInstituteDescriptionUploadForm( new SciInstituteDescriptionUploadForm(
itemModel); itemModel);
add(UPDATE_INSTITUTE_DESC_SHEET_NAME, add(UPDATE_INSTITUTE_DESC_SHEET_NAME,
(String) SciInstituteGlobalizationUtil.globalize( SciInstituteGlobalizationUtil.globalize(
"sciinstitute.ui.desc.upload").localize(), "sciinstitute.ui.desc.upload"),
new WorkflowLockedComponentAccess(updateDescForm, itemModel), new WorkflowLockedComponentAccess(updateDescForm, itemModel),
updateDescForm.getSaveCancelSection().getCancelButton()); updateDescForm.getSaveCancelSection().getCancelButton());

View File

@ -36,9 +36,9 @@ public class SciInstituteMembersStep
final BasicItemForm addMemberSheet = new SciInstituteMemberAddForm( final BasicItemForm addMemberSheet = new SciInstituteMemberAddForm(
itemModel, this); itemModel, this);
add(ADD_INSTITUTE_MEMBER_STEP, add(ADD_INSTITUTE_MEMBER_STEP,
(String) SciInstituteGlobalizationUtil.globalize( SciInstituteGlobalizationUtil.globalize(
"sciinstitute.ui.members.add").localize(), "sciinstitute.ui.members.add"),
new WorkflowLockedComponentAccess(addMemberSheet, itemModel), new WorkflowLockedComponentAccess(addMemberSheet,itemModel),
addMemberSheet.getSaveCancelSection().getCancelButton()); addMemberSheet.getSaveCancelSection().getCancelButton());
final SciInstituteMembersTable memberTable = final SciInstituteMembersTable memberTable =
@ -47,30 +47,37 @@ public class SciInstituteMembersStep
setDisplayComponent(memberTable); setDisplayComponent(memberTable);
} }
@Override
public GenericPerson getSelectedPerson() { public GenericPerson getSelectedPerson() {
return selectedPerson; return selectedPerson;
} }
@Override
public void setSelectedPerson(final GenericPerson selectedPerson) { public void setSelectedPerson(final GenericPerson selectedPerson) {
this.selectedPerson = selectedPerson; this.selectedPerson = selectedPerson;
} }
@Override
public String getSelectedPersonRole() { public String getSelectedPersonRole() {
return selectedPersonRole; return selectedPersonRole;
} }
@Override
public void setSelectedPersonRole(final String selectedPersonRole) { public void setSelectedPersonRole(final String selectedPersonRole) {
this.selectedPersonRole = selectedPersonRole; this.selectedPersonRole = selectedPersonRole;
} }
@Override
public String getSelectedPersonStatus() { public String getSelectedPersonStatus() {
return selectedPersonStatus; return selectedPersonStatus;
} }
@Override
public void setSelectedPersonStatus(final String selectedPersonStatus) { public void setSelectedPersonStatus(final String selectedPersonStatus) {
this.selectedPersonStatus = selectedPersonStatus; this.selectedPersonStatus = selectedPersonStatus;
} }
@Override
public void showEditComponent(final PageState state) { public void showEditComponent(final PageState state) {
showComponent(state, ADD_INSTITUTE_MEMBER_STEP); showComponent(state, ADD_INSTITUTE_MEMBER_STEP);
} }

View File

@ -72,8 +72,8 @@ public class SciInstituteProjectsStep extends SimpleEditStep {
} }
}); });
add(ADD_INSTITUTE_SHEET_NAME, add(ADD_INSTITUTE_SHEET_NAME,
(String) SciInstituteGlobalizationUtil.globalize( SciInstituteGlobalizationUtil.globalize(
"sciinstitute.ui.projects.add").localize(), "sciinstitute.ui.projects.add"),
new WorkflowLockedComponentAccess(addProjectSheet, itemModel), new WorkflowLockedComponentAccess(addProjectSheet, itemModel),
addProjectSheet.getSaveCancelSection().getCancelButton()); addProjectSheet.getSaveCancelSection().getCancelButton());

View File

@ -50,19 +50,17 @@ public class SciInstitutePropertiesStep
itemModel, this); itemModel, this);
basicProperties.add(EDIT_SHEET_NAME, basicProperties.add(EDIT_SHEET_NAME,
(String) SciInstituteGlobalizationUtil.globalize( SciInstituteGlobalizationUtil.globalize(
"sciinstitute.ui.edit_basic_sheet").localize(), "sciinstitute.ui.edit_basic_sheet"),
new WorkflowLockedComponentAccess(editBasicSheet, new WorkflowLockedComponentAccess(editBasicSheet,itemModel),
itemModel), editBasicSheet.getSaveCancelSection().getCancelButton());
editBasicSheet.getSaveCancelSection().
getCancelButton());
basicProperties.setDisplayComponent(getSciInstitutePropertySheet( basicProperties.setDisplayComponent(getSciInstitutePropertySheet(
itemModel)); itemModel));
getSegmentedPanel().addSegment( getSegmentedPanel().addSegment(
new Label((String) SciInstituteGlobalizationUtil.globalize( new Label(SciInstituteGlobalizationUtil.globalize(
"sciinstitute.ui.edit_basic_properties").localize()), "sciinstitute.ui.edit_basic_properties")),
basicProperties); basicProperties);
} }

View File

@ -43,16 +43,17 @@ public class SciInstitutePropertyForm
@Override @Override
public void addWidgets() { public void addWidgets() {
super.addWidgets(); super.addWidgets();
add(new Label(SciInstituteGlobalizationUtil.globalize(
"sciinstitute.ui.shortdesc")));
ParameterModel shortDescParam = new StringParameter( ParameterModel shortDescParam = new StringParameter(
SciInstitute.INSTITUTE_SHORT_DESCRIPTION); SciInstitute.INSTITUTE_SHORT_DESCRIPTION);
TextArea shortDesc = new TextArea(shortDescParam); TextArea shortDesc = new TextArea(shortDescParam);
shortDesc.addValidationListener( shortDesc.addValidationListener(
new StringInRangeValidationListener(0, new StringInRangeValidationListener(0,
config.getShortDescMaxLength())); config.getShortDescMaxLength()));
shortDesc.setLabel(SciInstituteGlobalizationUtil.globalize(
"sciinstitute.ui.shortdesc"));
shortDesc.setCols(75); shortDesc.setCols(75);
shortDesc.setRows(5); shortDesc.setRows(5);
add(shortDesc); add(shortDesc);

View File

@ -75,8 +75,8 @@ public class SciProjectInstitutesStep extends SimpleEditStep {
}); });
add(ADD_INSTITUTE_SHEET_NAME, add(ADD_INSTITUTE_SHEET_NAME,
(String) SciInstituteGlobalizationUtil.globalize( SciInstituteGlobalizationUtil.globalize(
"sciproject.ui.institut.add").localize(), "sciproject.ui.institut.add"),
new WorkflowLockedComponentAccess(addInstitutesSheet, itemModel), new WorkflowLockedComponentAccess(addInstitutesSheet, itemModel),
addInstitutesSheet.getSaveCancelSection().getCancelButton()); addInstitutesSheet.getSaveCancelSection().getCancelButton());

View File

@ -49,8 +49,7 @@ public class SciProjectDescriptionEditForm
@Override @Override
protected void addWidgets() { protected void addWidgets() {
add(new Label(SciProjectGlobalizationUtil.globalize(
"sciproject.ui.description")));
final ParameterModel descParam = new StringParameter( final ParameterModel descParam = new StringParameter(
SciProject.PROJECT_DESCRIPTION); SciProject.PROJECT_DESCRIPTION);
final TextArea desc; final TextArea desc;
@ -59,6 +58,8 @@ public class SciProjectDescriptionEditForm
} else { } else {
desc = new TextArea(descParam); desc = new TextArea(descParam);
} }
desc.setLabel(SciProjectGlobalizationUtil.globalize(
"sciproject.ui.description"));
desc.setCols(75); desc.setCols(75);
desc.setRows(25); desc.setRows(25);
add(desc); add(desc);
@ -88,9 +89,11 @@ public class SciProjectDescriptionEditForm
}); });
add(sponsorLabel); add(sponsorLabel);
add(new Label(SciProjectGlobalizationUtil.globalize("sciproject.ui.choose_sponsor"))); //add(new Label(SciProjectGlobalizationUtil.globalize("sciproject.ui.choose_sponsor")));
sponsorSearch = new ItemSearchWidget(SPONSOR_SEARCH, ContentType. sponsorSearch = new ItemSearchWidget(SPONSOR_SEARCH, ContentType.
findByAssociatedObjectType(CONFIG.getSponsorType())); findByAssociatedObjectType(CONFIG.getSponsorType()));
sponsorSearch.setLabel(SciProjectGlobalizationUtil.globalize(
"sciproject.ui.choose_sponsor"));
add(sponsorSearch); add(sponsorSearch);
} }

View File

@ -32,8 +32,7 @@ public class SciProjectDescriptionTextEditForm extends BasicItemForm implements
@Override @Override
public void addWidgets() { public void addWidgets() {
add(new Label(SciProjectGlobalizationUtil.globalize(
"sciproject.ui.description")));
final ParameterModel descParam = new StringParameter( final ParameterModel descParam = new StringParameter(
SciProject.PROJECT_DESCRIPTION); SciProject.PROJECT_DESCRIPTION);
final TextArea desc; final TextArea desc;
@ -42,9 +41,12 @@ public class SciProjectDescriptionTextEditForm extends BasicItemForm implements
} else { } else {
desc = new TextArea(descParam); desc = new TextArea(descParam);
} }
desc.setLabel(SciProjectGlobalizationUtil.globalize(
"sciproject.ui.description"));
desc.setCols(75); desc.setCols(75);
desc.setRows(25); desc.setRows(25);
add(desc); add(desc);
} }
@Override @Override

View File

@ -54,8 +54,6 @@ public class SciProjectFundingEditForm extends BasicItemForm implements FormProc
public void addWidgets() { public void addWidgets() {
if (CONFIG.getEnableFunding()) { if (CONFIG.getEnableFunding()) {
add(new Label(SciProjectGlobalizationUtil.globalize(
"sciproject.ui.funding")));
final ParameterModel fundingParam = new StringParameter( final ParameterModel fundingParam = new StringParameter(
SciProject.FUNDING); SciProject.FUNDING);
final TextArea funding; final TextArea funding;
@ -64,20 +62,22 @@ public class SciProjectFundingEditForm extends BasicItemForm implements FormProc
} else { } else {
funding = new TextArea(fundingParam); funding = new TextArea(fundingParam);
} }
funding.setLabel(SciProjectGlobalizationUtil.globalize(
"sciproject.ui.funding"));
funding.setCols(75); funding.setCols(75);
funding.setRows(8); funding.setRows(8);
add(funding); add(funding);
} }
if (CONFIG.getEnableFundingVolume()) { if (CONFIG.getEnableFundingVolume()) {
add(new Label(SciProjectGlobalizationUtil.globalize(
"sciproject.ui.funding.volume")));
final ParameterModel fundingVolumeParam = new StringParameter( final ParameterModel fundingVolumeParam = new StringParameter(
SciProject.FUNDING_VOLUME); SciProject.FUNDING_VOLUME);
final TextField fundingVolume = new TextField(fundingVolumeParam); final TextField fundingVolume = new TextField(fundingVolumeParam);
fundingVolume.addValidationListener(new StringInRangeValidationListener( fundingVolume.addValidationListener(new StringInRangeValidationListener(
0, 0,
CONFIG.getFundingVolumeLength())); CONFIG.getFundingVolumeLength()));
fundingVolume.setLabel(SciProjectGlobalizationUtil.globalize(
"sciproject.ui.funding.volume"));
add(fundingVolume); add(fundingVolume);
} }
} }

View File

@ -73,7 +73,7 @@ public class SciProjectInvolvedOrganizationsStep extends SimpleEditStep {
} }
}); });
add(ADD_INVOLVED_ORGANIZATION_STEP, add(ADD_INVOLVED_ORGANIZATION_STEP,
(String) SciProjectGlobalizationUtil.globalize("sciproject.ui.involved_orgas.add").localize(), SciProjectGlobalizationUtil.globalize("sciproject.ui.involved_orgas.add"),
new WorkflowLockedComponentAccess(addInvolvedOrgaSheet, itemModel), new WorkflowLockedComponentAccess(addInvolvedOrgaSheet, itemModel),
addInvolvedOrgaSheet.getSaveCancelSection().getCancelButton()); addInvolvedOrgaSheet.getSaveCancelSection().getCancelButton());

View File

@ -38,7 +38,7 @@ implements GenericOrganizationalUnitPersonSelector{
final BasicItemForm addMemberSheet = new SciProjectMemberAddForm( final BasicItemForm addMemberSheet = new SciProjectMemberAddForm(
itemModel, this); itemModel, this);
add(ADD_PROJECT_MEMBER_SHEET_NAME, add(ADD_PROJECT_MEMBER_SHEET_NAME,
(String) SciProjectGlobalizationUtil.globalize("sciproject.ui.members.add").localize(), SciProjectGlobalizationUtil.globalize("sciproject.ui.members.add"),
new WorkflowLockedComponentAccess(addMemberSheet, itemModel), new WorkflowLockedComponentAccess(addMemberSheet, itemModel),
addMemberSheet.getSaveCancelSection().getCancelButton()); addMemberSheet.getSaveCancelSection().getCancelButton());
@ -47,30 +47,37 @@ implements GenericOrganizationalUnitPersonSelector{
setDisplayComponent(memberTable); setDisplayComponent(memberTable);
} }
@Override
public GenericPerson getSelectedPerson() { public GenericPerson getSelectedPerson() {
return selectedPerson; return selectedPerson;
} }
@Override
public void setSelectedPerson(final GenericPerson selectedPerson) { public void setSelectedPerson(final GenericPerson selectedPerson) {
this.selectedPerson = selectedPerson; this.selectedPerson = selectedPerson;
} }
@Override
public String getSelectedPersonRole() { public String getSelectedPersonRole() {
return selectedPersonRole; return selectedPersonRole;
} }
@Override
public void setSelectedPersonRole(final String selectedPersonRole) { public void setSelectedPersonRole(final String selectedPersonRole) {
this.selectedPersonRole = selectedPersonRole; this.selectedPersonRole = selectedPersonRole;
} }
@Override
public String getSelectedPersonStatus() { public String getSelectedPersonStatus() {
return selectedPersonStatus; return selectedPersonStatus;
} }
@Override
public void setSelectedPersonStatus(final String selectedPersonStatus) { public void setSelectedPersonStatus(final String selectedPersonStatus) {
this.selectedPersonStatus = selectedPersonStatus; this.selectedPersonStatus = selectedPersonStatus;
} }
@Override
public void showEditComponent(final PageState state) { public void showEditComponent(final PageState state) {
showComponent(state, ADD_PROJECT_MEMBER_SHEET_NAME); showComponent(state, ADD_PROJECT_MEMBER_SHEET_NAME);
} }

View File

@ -133,21 +133,19 @@ public class SciProjectPropertiesStep
itemModel, itemModel,
this); this);
basicProperties.add(EDIT_SHEET_NAME, basicProperties.add(
(String) SciProjectGlobalizationUtil.globalize( EDIT_SHEET_NAME,
"sciproject.ui.edit_basic_sheet").localize(), SciProjectGlobalizationUtil.globalize(
new WorkflowLockedComponentAccess(editBasicSheet, "sciproject.ui.edit_basic_sheet"),
itemModel), new WorkflowLockedComponentAccess(editBasicSheet,itemModel),
editBasicSheet.getSaveCancelSection(). editBasicSheet.getSaveCancelSection().getCancelButton());
getCancelButton());
basicProperties.setDisplayComponent( basicProperties.setDisplayComponent(
getSciProjectPropertySheet(itemModel)); getSciProjectPropertySheet(itemModel));
getSegmentedPanel().addSegment( getSegmentedPanel().addSegment(
new Label((String) SciProjectGlobalizationUtil.globalize( new Label(SciProjectGlobalizationUtil.globalize(
"sciproject.ui.edit_basic_properties"). "sciproject.ui.edit_basic_properties")),
localize()),
basicProperties); basicProperties);
} }

View File

@ -49,6 +49,7 @@ public class SciProjectPropertyForm
@Override @Override
public void addWidgets() { public void addWidgets() {
super.addWidgets(); super.addWidgets();
final ParameterModel beginSkipMonthParam = final ParameterModel beginSkipMonthParam =
@ -61,14 +62,14 @@ public class SciProjectPropertyForm
final Hidden beginSkipDay = new Hidden(beginSkipDayParam); final Hidden beginSkipDay = new Hidden(beginSkipDayParam);
add(beginSkipDay); add(beginSkipDay);
add(new Label(SciProjectGlobalizationUtil.globalize(
"sciproject.ui.begin")));
final IncompleteDateParameter beginParam = final IncompleteDateParameter beginParam =
new IncompleteDateParameter(SciProject.BEGIN); new IncompleteDateParameter(SciProject.BEGIN);
beginParam.allowSkipMonth(true); beginParam.allowSkipMonth(true);
beginParam.allowSkipDay(true); beginParam.allowSkipDay(true);
final Calendar today = new GregorianCalendar(); final Calendar today = new GregorianCalendar();
final Date begin = new Date(beginParam); final Date begin = new Date(beginParam);
begin.setLabel(SciProjectGlobalizationUtil.globalize(
"sciproject.ui.begin"));
begin.setAutoCurrentYear(false); begin.setAutoCurrentYear(false);
begin.setYearRange(1970, (today.get(Calendar.YEAR) + 2)); begin.setYearRange(1970, (today.get(Calendar.YEAR) + 2));
add(begin); add(begin);
@ -81,26 +82,27 @@ public class SciProjectPropertyForm
final ParameterModel endSkipDayParam = new BooleanParameter( final ParameterModel endSkipDayParam = new BooleanParameter(
SciProject.END_SKIP_DAY); SciProject.END_SKIP_DAY);
final Hidden endSkipDay = new Hidden(endSkipDayParam); final Hidden endSkipDay = new Hidden(endSkipDayParam);
// endSkipDay.setLabel(null);
add(endSkipDay); add(endSkipDay);
add(new Label(SciProjectGlobalizationUtil.globalize(
"sciproject.ui.end")));
final IncompleteDateParameter endParam = new IncompleteDateParameter(SciProject.END); final IncompleteDateParameter endParam = new IncompleteDateParameter(SciProject.END);
endParam.allowSkipMonth(true); endParam.allowSkipMonth(true);
endParam.allowSkipDay(true); endParam.allowSkipDay(true);
Date end = new Date(endParam); Date end = new Date(endParam);
end.setAutoCurrentYear(false); end.setAutoCurrentYear(false);
end.setYearRange(1970, (today.get(Calendar.YEAR) + 8)); end.setYearRange(1970, (today.get(Calendar.YEAR) + 8));
end.setLabel(SciProjectGlobalizationUtil.globalize(
"sciproject.ui.end"));
add(end); add(end);
add(new Label(SciProjectGlobalizationUtil.globalize(
"sciproject.ui.shortdesc")));
ParameterModel shortDescParam = new StringParameter( ParameterModel shortDescParam = new StringParameter(
SciProject.PROJECT_SHORT_DESCRIPTION); SciProject.PROJECT_SHORT_DESCRIPTION);
TextArea shortDesc = new TextArea(shortDescParam); TextArea shortDesc = new TextArea(shortDescParam);
shortDesc.addValidationListener( shortDesc.addValidationListener(
new StringInRangeValidationListener(0, new StringInRangeValidationListener(0,
config.getShortDescMaxLength())); config.getShortDescMaxLength()));
shortDesc.setLabel(SciProjectGlobalizationUtil.globalize(
"sciproject.ui.shortdesc"));
shortDesc.setCols(75); shortDesc.setCols(75);
shortDesc.setRows(5); shortDesc.setRows(5);
add(shortDesc); add(shortDesc);

View File

@ -13,12 +13,10 @@ import com.arsdigita.cms.ContentType;
import com.arsdigita.cms.ItemSelectionModel; import com.arsdigita.cms.ItemSelectionModel;
import com.arsdigita.cms.contenttypes.GenericOrganizationalUnit; import com.arsdigita.cms.contenttypes.GenericOrganizationalUnit;
import com.arsdigita.cms.contenttypes.SciProject; import com.arsdigita.cms.contenttypes.SciProject;
import com.arsdigita.cms.contenttypes.SciProjectConfig;
import com.arsdigita.cms.contenttypes.SciProjectSponsorCollection; import com.arsdigita.cms.contenttypes.SciProjectSponsorCollection;
import com.arsdigita.cms.ui.ItemSearchWidget; import com.arsdigita.cms.ui.ItemSearchWidget;
import com.arsdigita.cms.ui.authoring.BasicItemForm; import com.arsdigita.cms.ui.authoring.BasicItemForm;
import com.arsdigita.cms.ui.authoring.SimpleEditStep; import com.arsdigita.cms.ui.authoring.SimpleEditStep;
import com.arsdigita.kernel.Kernel;
/** /**
* *
@ -46,17 +44,20 @@ public class SciProjectSponsorForm extends BasicItemForm implements FormInitList
@Override @Override
public void addWidgets() { public void addWidgets() {
add(new Label(SciProjectGlobalizationUtil.globalize("sciproject.ui.sponsor")));
itemSearch = new ItemSearchWidget(ITEM_SEARCH, ContentType.findByAssociatedObjectType( itemSearch = new ItemSearchWidget(ITEM_SEARCH, ContentType.findByAssociatedObjectType(
GenericOrganizationalUnit.class.getName())); GenericOrganizationalUnit.class.getName()));
itemSearch.setEditAfterCreate(false); itemSearch.setEditAfterCreate(false);
itemSearch.setLabel(SciProjectGlobalizationUtil.globalize(
"sciproject.ui.sponsor"));
add(itemSearch); add(itemSearch);
selectedSponsorLabel = new Label(""); selectedSponsorLabel = new Label();
add(selectedSponsorLabel); add(selectedSponsorLabel);
add(new Label(SciProjectGlobalizationUtil.globalize("sciproject.ui.sponsor_fundingcode")));
fundingCode = new TextField(FUNDING_CODE); fundingCode = new TextField(FUNDING_CODE);
fundingCode.setLabel(SciProjectGlobalizationUtil.globalize(
"sciproject.ui.sponsor_fundingcode"));
add(fundingCode); add(fundingCode);
} }
@ -159,7 +160,8 @@ public class SciProjectSponsorForm extends BasicItemForm implements FormInitList
if ((((SciProjectSponsorStep) editStep).getSelectedSponsor() == null) if ((((SciProjectSponsorStep) editStep).getSelectedSponsor() == null)
&& (data.get(ITEM_SEARCH) == null)) { && (data.get(ITEM_SEARCH) == null)) {
data.addError(SciProjectGlobalizationUtil.globalize("sciproject.ui.sponsor_no_sponsor_selected")); data.addError(SciProjectGlobalizationUtil.globalize(
"sciproject.ui.sponsor_no_sponsor_selected"));
return; return;
} }

View File

@ -143,11 +143,11 @@ public class SciProjectSponsorSheet extends Table {
case 1: case 1:
return sponsors.getFundingCode(); return sponsors.getFundingCode();
case 2: case 2:
return SciProjectGlobalizationUtil.globalize( return new Label(SciProjectGlobalizationUtil.globalize(
"sciproject.ui.sponsor.edit_assoc").localize(); "sciproject.ui.sponsor.edit_assoc"));
case 3: case 3:
return SciProjectGlobalizationUtil.globalize( return new Label(SciProjectGlobalizationUtil.globalize(
"sciproject.ui.sponsor.remove").localize(); "sciproject.ui.sponsor.remove"));
default: default:
return null; return null;
} }
@ -251,8 +251,8 @@ public class SciProjectSponsorSheet extends Table {
sponsor); sponsor);
if (canEdit) { if (canEdit) {
final ControlLink link = new ControlLink(value.toString()); final ControlLink link = new ControlLink(value.toString());
link.setConfirmation((String) SciProjectGlobalizationUtil.globalize( link.setConfirmation(SciProjectGlobalizationUtil.globalize(
"sciproject.ui.sponsor.remove.confirm").localize()); "sciproject.ui.sponsor.remove.confirm"));
return link; return link;
} else { } else {
return new Label(""); return new Label("");
@ -273,7 +273,7 @@ public class SciProjectSponsorSheet extends Table {
int row, int row,
int col) { int col) {
if (0 == row) { if (0 == row) {
final Label label = new Label(""); final Label label = new Label();
return label; return label;
} else { } else {
final ControlLink link = new ControlLink("up"); final ControlLink link = new ControlLink("up");
@ -301,7 +301,7 @@ public class SciProjectSponsorSheet extends Table {
final SciProjectSponsorCollection sponsors = project.getSponsors(); final SciProjectSponsorCollection sponsors = project.getSponsors();
if ((sponsors.size() - 1) == row) { if ((sponsors.size() - 1) == row) {
final Label label = new Label(""); final Label label = new Label();
return label; return label;
} else { } else {
final ControlLink link = new ControlLink("down"); final ControlLink link = new ControlLink("down");

View File

@ -31,7 +31,7 @@ public class SciProjectSponsorStep extends SimpleEditStep {
final BasicItemForm sponsorForm = new SciProjectSponsorForm(itemModel, this); final BasicItemForm sponsorForm = new SciProjectSponsorForm(itemModel, this);
add(SCIPROJECT_SPONSOR_STEP, add(SCIPROJECT_SPONSOR_STEP,
(String) SciProjectGlobalizationUtil.globalize("sciproject.ui.sponsor.add").localize(), SciProjectGlobalizationUtil.globalize("sciproject.ui.sponsor.add"),
new WorkflowLockedComponentAccess(sponsorForm, itemModel), new WorkflowLockedComponentAccess(sponsorForm, itemModel),
sponsorForm.getSaveCancelSection().getCancelButton()); sponsorForm.getSaveCancelSection().getCancelButton());

View File

@ -70,8 +70,8 @@ public class SciProjectSubProjectsStep extends SimpleEditStep {
} }
}); });
add(ADD_SUBPROJECT_SHEET_NAME, add(ADD_SUBPROJECT_SHEET_NAME,
(String) SciProjectGlobalizationUtil.globalize( SciProjectGlobalizationUtil.globalize(
"sciproject.ui.subproject.add").localize(), "sciproject.ui.subproject.add"),
new WorkflowLockedComponentAccess(addSubProjectSheet, itemModel), new WorkflowLockedComponentAccess(addSubProjectSheet, itemModel),
addSubProjectSheet.getSaveCancelSection().getCancelButton()); addSubProjectSheet.getSaveCancelSection().getCancelButton());

View File

@ -66,7 +66,7 @@ public class SciProjectSuperProjectsStep extends SimpleEditStep {
} }
}); });
add(ADD_SUPERPROJECT_SHEET_NAME, add(ADD_SUPERPROJECT_SHEET_NAME,
(String) SciProjectGlobalizationUtil.globalize("sciproject.ui.superproject.add").localize(), SciProjectGlobalizationUtil.globalize("sciproject.ui.superproject.add"),
new WorkflowLockedComponentAccess(addSuperProjectSheet, itemModel), new WorkflowLockedComponentAccess(addSuperProjectSheet, itemModel),
addSuperProjectSheet.getSaveCancelSection().getCancelButton()); addSuperProjectSheet.getSaveCancelSection().getCancelButton());

View File

@ -16,7 +16,6 @@
* Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
* *
*/ */
package com.arsdigita.shortcuts.ui; package com.arsdigita.shortcuts.ui;
import java.math.BigDecimal; import java.math.BigDecimal;
@ -48,185 +47,189 @@ import org.apache.oro.text.perl.MalformedPerl5PatternException;
public class ShortcutForm extends Form { public class ShortcutForm extends Form {
private static final Category log = Category.getInstance(ShortcutForm.class private static final Category log = Category.getInstance(ShortcutForm.class
.getName()); .getName());
private ACSObjectSelectionModel m_selected_shortcut; private ACSObjectSelectionModel m_selected_shortcut;
private TextField m_url; private TextField m_url;
private TextField m_redirect; private TextField m_redirect;
private final Submit m_submit; private final Submit m_submit;
public ShortcutForm(ACSObjectSelectionModel selected_shortcut) { public ShortcutForm(ACSObjectSelectionModel selected_shortcut) {
super("ShortcutForm"); super("ShortcutForm");
m_selected_shortcut = selected_shortcut; m_selected_shortcut = selected_shortcut;
TrimmedStringParameter urlKeyParameter = new TrimmedStringParameter( TrimmedStringParameter urlKeyParameter = new TrimmedStringParameter(
"url"); "url");
urlKeyParameter.addParameterListener(new NotEmptyValidationListener()); urlKeyParameter.addParameterListener(new NotEmptyValidationListener());
m_url = new TextField(urlKeyParameter); m_url = new TextField(urlKeyParameter);
TrimmedStringParameter redirectParameter = new TrimmedStringParameter( TrimmedStringParameter redirectParameter = new TrimmedStringParameter(
"redirect"); "redirect");
redirectParameter redirectParameter
.addParameterListener(new NotEmptyValidationListener()); .addParameterListener(new NotEmptyValidationListener());
m_redirect = new TextField(redirectParameter); m_redirect = new TextField(redirectParameter);
urlKeyParameter.addParameterListener(new ParameterListener() { urlKeyParameter.addParameterListener(new ParameterListener() {
@Override @Override
public void validate(ParameterEvent e) throws FormProcessException { public void validate(ParameterEvent e) throws FormProcessException {
ParameterData data = e.getParameterData(); ParameterData data = e.getParameterData();
String key = (String) data.getValue(); String key = (String) data.getValue();
if (key == null) if (key == null) {
return; // Something else will handle return; // Something else will handle
// this } // this
Perl5Util perl = new Perl5Util(); Perl5Util perl = new Perl5Util();
try { try {
if (!perl.match("/^(\\/[-a-zA-Z0-9_.]+)+\\/?$/", key)) { if (!perl.match("/^(\\/[-a-zA-Z0-9_.]+)+\\/?$/", key)) {
data.addError(GlobalizationUtil.globalize( data.addError(GlobalizationUtil.globalize(
"shortcuts.ui.invalid_key_descr")); "shortcuts.ui.invalid_key_descr"));
throw new FormProcessException( throw new FormProcessException(
"Invalid key", "Invalid key",
GlobalizationUtil.globalize("shortcuts.ui.invalid_key") GlobalizationUtil.globalize("shortcuts.ui.invalid_key")
); );
} }
} catch (MalformedPerl5PatternException ex) { } catch (MalformedPerl5PatternException ex) {
throw new UncheckedWrapperException("bad regex", ex); throw new UncheckedWrapperException("bad regex", ex);
} }
} }
}); });
redirectParameter.addParameterListener(new ParameterListener() { redirectParameter.addParameterListener(new ParameterListener() {
@Override @Override
public void validate(ParameterEvent e) throws FormProcessException { public void validate(ParameterEvent e) throws FormProcessException {
ParameterData data = e.getParameterData(); ParameterData data = e.getParameterData();
String url = (String) data.getValue(); String url = (String) data.getValue();
if (url == null) if (url == null) {
return; // Something else will handle return; // Something else will handle
// this } // this
url = url.toLowerCase(); url = url.toLowerCase();
// Absolute local url is ok // Absolute local url is ok
if (url.startsWith("/")) if (url.startsWith("/")) {
return; return;
}
// Fully qualified url is ok // Fully qualified url is ok
if (url.startsWith("http://")) if (url.startsWith("http://")) {
return; return;
}
// And secure ones too // And secure ones too
if (url.startsWith("https://")) if (url.startsWith("https://")) {
return; return;
}
data data
.addError("You must enter an absolute path " .addError("You must enter an absolute path "
+ "(starting with '/') or a fully " + "(starting with '/') or a fully "
+ "qualified URL (starting with 'http://' or 'https://')"); + "qualified URL (starting with 'http://' or 'https://')");
throw new FormProcessException("invalid URL"); throw new FormProcessException("invalid URL");
} }
}); });
add(new Label("URL Key:")); add(new Label("URL Key:"));
add(m_url); add(m_url);
add(new Label("Redirect:")); add(new Label("Redirect:"));
add(m_redirect); add(m_redirect);
m_submit = new Submit("Save Shortcut"); m_submit = new Submit("Save Shortcut");
add(m_submit); add(m_submit);
addInitListener(new ShortcutInitListener()); addInitListener(new ShortcutInitListener());
addProcessListener(new ShortcutFormProcessListener()); addProcessListener(new ShortcutFormProcessListener());
addValidationListener(new ShortcutFormValidationListener()); addValidationListener(new ShortcutFormValidationListener());
} }
private class ShortcutInitListener implements FormInitListener { private class ShortcutInitListener implements FormInitListener {
@Override
public void init(FormSectionEvent ev) throws FormProcessException {
PageState state = ev.getPageState();
BigDecimal shortcutKey = (BigDecimal) m_selected_shortcut
.getSelectedKey(state);
if (shortcutKey == null) {
log.debug("init form for empty shortcut");
m_url.setValue(state, null);
m_redirect.setValue(state, null);
} else {
log.debug("init form for shortcut " + shortcutKey);
Shortcut shortcut = new Shortcut(shortcutKey);
m_url.setValue(state, shortcut.getUrlKey());
m_redirect.setValue(state, shortcut.getRedirect());
}
}
}
private class ShortcutFormValidationListener implements
FormValidationListener {
@Override @Override
public void validate(FormSectionEvent e) throws FormProcessException { public void init(FormSectionEvent ev) throws FormProcessException {
PageState state = ev.getPageState();
BigDecimal shortcutKey = (BigDecimal) m_selected_shortcut
.getSelectedKey(state);
if (shortcutKey == null) {
log.debug("init form for empty shortcut");
m_url.setValue(state, null);
m_redirect.setValue(state, null);
} else {
log.debug("init form for shortcut " + shortcutKey);
Shortcut shortcut = new Shortcut(shortcutKey);
m_url.setValue(state, shortcut.getUrlKey());
m_redirect.setValue(state, shortcut.getRedirect());
}
}
}
PageState state = e.getPageState(); private class ShortcutFormValidationListener implements
FormValidationListener {
// get currently edited shortcut @Override
BigDecimal shortcutKey = (BigDecimal) m_selected_shortcut public void validate(FormSectionEvent e) throws FormProcessException {
.getSelectedKey(state);
String key = ShortcutUtil.cleanURLKey((String) m_url PageState state = e.getPageState();
.getValue(state));
if (shortcutKey == null) { // get currently edited shortcut
String target = ShortcutUtil.getTarget(key); BigDecimal shortcutKey = (BigDecimal) m_selected_shortcut
if (target != null) { .getSelectedKey(state);
m_url.addError(GlobalizationUtil.globalize(
"shortcuts.ui.key_already_exists")); String key = ShortcutUtil.cleanURLKey((String) m_url
throw new FormProcessException( .getValue(state));
"duplicate key",
GlobalizationUtil.globalize("shortcuts.ui.duplicate_key") if (shortcutKey == null) {
String target = ShortcutUtil.getTarget(key);
if (target != null) {
m_url.addError(GlobalizationUtil.globalize(
"shortcuts.ui.key_already_exists"));
throw new FormProcessException(
"duplicate key",
GlobalizationUtil.globalize("shortcuts.ui.duplicate_key")
); );
} }
} }
int index = key.indexOf("/", 2); int index = key.indexOf("/", 2);
String base = key.substring(0, index + 1); String base = key.substring(0, index + 1);
} }
} }
private class ShortcutFormProcessListener implements FormProcessListener { private class ShortcutFormProcessListener implements FormProcessListener {
@Override @Override
public void process(FormSectionEvent e) throws FormProcessException { public void process(FormSectionEvent e) throws FormProcessException {
PageState state = e.getPageState(); PageState state = e.getPageState();
BigDecimal shortcutKey = (BigDecimal) m_selected_shortcut.getSelectedKey(state); BigDecimal shortcutKey = (BigDecimal) m_selected_shortcut.getSelectedKey(state);
String url = ShortcutUtil.cleanURLKey((String) m_url.getValue(state)); String url = ShortcutUtil.cleanURLKey((String) m_url.getValue(state));
String redirect = (String) m_redirect.getValue(state); String redirect = (String) m_redirect.getValue(state);
if (shortcutKey == null) {
log.info("save new shortcut " + url);
Shortcut shortcut = Shortcut.create(url, redirect);
shortcut.save();
} else {
log.info("save updated shortcut " + shortcutKey + " " + url);
Shortcut shortcut = new Shortcut(shortcutKey);
shortcut.setUrlKey(url);
shortcut.setRedirect(redirect);
shortcut.save();
}
ShortcutUtil.repopulateShortcuts(); if (shortcutKey == null) {
log.info("save new shortcut " + url);
Shortcut shortcut = Shortcut.create(url, redirect);
shortcut.save();
} else {
log.info("save updated shortcut " + shortcutKey + " " + url);
Shortcut shortcut = new Shortcut(shortcutKey);
shortcut.setUrlKey(url);
shortcut.setRedirect(redirect);
shortcut.save();
}
m_redirect.setValue(state, ""); ShortcutUtil.repopulateShortcuts();
m_url.setValue(state, "");
m_selected_shortcut.clearSelection(state); m_redirect.setValue(state, "");
} m_url.setValue(state, "");
} m_selected_shortcut.clearSelection(state);
}
}
} }

View File

@ -121,7 +121,7 @@ public class SiteForm extends Form {
m_title.setMetaDataAttribute("title", "Title"); m_title.setMetaDataAttribute("title", "Title");
m_title.setHint(SubsiteGlobalizationUtil.globalize("subsite.ui.title.hint")); m_title.setHint(SubsiteGlobalizationUtil.globalize("subsite.ui.title.hint"));
m_title.setSize(40); m_title.setSize(40);
add(new Label(SubsiteGlobalizationUtil.globalize("subsite.ui.title.label"))); m_title.setLabel(SubsiteGlobalizationUtil.globalize("subsite.ui.title.label"));
add(m_title); // adds title input field to form add(m_title); // adds title input field to form
@ -132,7 +132,7 @@ public class SiteForm extends Form {
m_hostname.setMetaDataAttribute("title", "Hostname"); m_hostname.setMetaDataAttribute("title", "Hostname");
m_hostname.setSize(40); m_hostname.setSize(40);
m_hostname.setHint(SubsiteGlobalizationUtil.globalize("subsite.ui.hostname.hint")); m_hostname.setHint(SubsiteGlobalizationUtil.globalize("subsite.ui.hostname.hint"));
add(new Label(SubsiteGlobalizationUtil.globalize("subsite.ui.hostname.label"))); m_hostname.setLabel(SubsiteGlobalizationUtil.globalize("subsite.ui.hostname.label"));
add(m_hostname); // adds hostname input field to form add(m_hostname); // adds hostname input field to form
@ -144,7 +144,8 @@ public class SiteForm extends Form {
m_description.setRows(4); m_description.setRows(4);
m_description.setHint(SubsiteGlobalizationUtil.globalize( m_description.setHint(SubsiteGlobalizationUtil.globalize(
"subsite.ui.description.hint")); "subsite.ui.description.hint"));
add(new Label(SubsiteGlobalizationUtil.globalize("subsite.ui.description.label"))); m_description.setLabel(SubsiteGlobalizationUtil.globalize(
"subsite.ui.description.label"));
add(m_description); // adds description input field to form add(m_description); // adds description input field to form
@ -161,7 +162,8 @@ public class SiteForm extends Form {
} catch (TooManyListenersException ex) { } catch (TooManyListenersException ex) {
throw new UncheckedWrapperException("This cannot happen", ex); throw new UncheckedWrapperException("This cannot happen", ex);
} }
add(new Label(SubsiteGlobalizationUtil.globalize("subsite.ui.customfrontpage.label"))); m_customFrontpageApp.setLabel(SubsiteGlobalizationUtil.globalize(
"subsite.ui.customfrontpage.label"));
add(m_customFrontpageApp); // adds selectfield start page to form add(m_customFrontpageApp); // adds selectfield start page to form
@ -174,7 +176,7 @@ public class SiteForm extends Form {
} catch (TooManyListenersException ex) { } catch (TooManyListenersException ex) {
throw new UncheckedWrapperException("This cannot happen", ex); throw new UncheckedWrapperException("This cannot happen", ex);
} }
add(new Label(SubsiteGlobalizationUtil.globalize("subsite.ui.theme.label"))); m_themes.setLabel(SubsiteGlobalizationUtil.globalize("subsite.ui.theme.label"));
add(m_themes); // adds themes selection box to form add(m_themes); // adds themes selection box to form
@ -183,11 +185,11 @@ public class SiteForm extends Form {
m_styleDir.setMetaDataAttribute("title", "XSLT Directory (Other)"); m_styleDir.setMetaDataAttribute("title", "XSLT Directory (Other)");
m_styleDir.setSize(40); m_styleDir.setSize(40);
m_styleDir.setHint(globalize("subsite.ui.styledir.hint") ); m_styleDir.setHint(globalize("subsite.ui.styledir.hint") );
add(new Label(SubsiteGlobalizationUtil.globalize("subsite.ui.styledir.label"))); m_styleDir.setLabel(SubsiteGlobalizationUtil.globalize("subsite.ui.styledir.label"));
add(m_styleDir); // adds inputfield style dir to form add(m_styleDir); // adds inputfield style dir to form
/* Setup selection box for cagtegory domain */ /* Setup selection box for category domain */
m_rootCategory = (CategoryPicker) Classes.newInstance( m_rootCategory = (CategoryPicker) Classes.newInstance(
Subsite.getConfig().getRootCategoryPicker(), Subsite.getConfig().getRootCategoryPicker(),
new Class[]{String.class}, new Class[]{String.class},
@ -196,8 +198,12 @@ public class SiteForm extends Form {
((Widget) m_rootCategory).setMetaDataAttribute("title", "Root category"); ((Widget) m_rootCategory).setMetaDataAttribute("title", "Root category");
((Widget) m_rootCategory).setHint(SubsiteGlobalizationUtil.globalize( ((Widget) m_rootCategory).setHint(SubsiteGlobalizationUtil.globalize(
"subsite.ui.root_category.hint")); "subsite.ui.root_category.hint"));
((Widget) m_rootCategory).setLabel(SubsiteGlobalizationUtil.globalize(
"subsite.ui.root_category.label"));
} else {
add(new Label(SubsiteGlobalizationUtil.globalize(
"subsite.ui.root_category.label")));
} }
add(new Label(SubsiteGlobalizationUtil.globalize("subsite.ui.root_category.label")));
add(m_rootCategory); // adds domain category selection box to form add(m_rootCategory); // adds domain category selection box to form
m_buttons = new SaveCancelSection(); m_buttons = new SaveCancelSection();

View File

@ -37,26 +37,20 @@ import com.arsdigita.bebop.parameters.GlobalizedParameterListener;
import com.arsdigita.bebop.parameters.NotEmptyValidationListener; import com.arsdigita.bebop.parameters.NotEmptyValidationListener;
import com.arsdigita.bebop.parameters.ParameterData; import com.arsdigita.bebop.parameters.ParameterData;
import com.arsdigita.bebop.parameters.StringParameter; import com.arsdigita.bebop.parameters.StringParameter;
import com.arsdigita.bebop.Label;
import com.arsdigita.persistence.DataCollection; import com.arsdigita.persistence.DataCollection;
import com.arsdigita.persistence.SessionManager; import com.arsdigita.persistence.SessionManager;
import com.arsdigita.util.UncheckedWrapperException; import com.arsdigita.util.UncheckedWrapperException;
//import com.arsdigita.util.IO;
import com.arsdigita.themedirector.ThemeDirectorConstants; import com.arsdigita.themedirector.ThemeDirectorConstants;
import com.arsdigita.themedirector.ThemeDirector; import com.arsdigita.themedirector.ThemeDirector;
import com.arsdigita.themedirector.util.GlobalizationUtil; import com.arsdigita.themedirector.util.GlobalizationUtil;
//import com.arsdigita.themedirector.util.ManifestReader;
import com.arsdigita.subsite.Subsite; import com.arsdigita.subsite.Subsite;
import com.arsdigita.subsite.Site; import com.arsdigita.subsite.Site;
import com.arsdigita.toolbox.ui.Cancellable; import com.arsdigita.toolbox.ui.Cancellable;
import com.arsdigita.web.Web; import com.arsdigita.web.Web;
import java.io.File; import java.io.File;
//import java.io.FileOutputStream;
import java.io.IOException; import java.io.IOException;
//import java.io.InputStream;
import org.apache.commons.io.FileUtils; import org.apache.commons.io.FileUtils;
//import org.apache.commons.io.filefilter.DirectoryFileFilter;
import org.apache.log4j.Logger; import org.apache.log4j.Logger;
@ -105,19 +99,14 @@ public class ThemeForm extends Form implements Cancellable, ThemeDirectorConstan
m_theme = theme; // Initialize ThemeSelectionModel m_theme = theme; // Initialize ThemeSelectionModel
// Add the Title input field // Add the Title input field
// add(new Label(GlobalizationUtil.globalize("theme.title")));
m_title = new TextField(new StringParameter("title")); m_title = new TextField(new StringParameter("title"));
// Experimental. We are migrating the Label if a widget as part of the
// widgets's xml properties.
m_title.setLabel(GlobalizationUtil.globalize("theme.title")); m_title.setLabel(GlobalizationUtil.globalize("theme.title"));
m_title.addValidationListener(new NotEmptyValidationListener()); m_title.addValidationListener(new NotEmptyValidationListener());
m_title.setHint(GlobalizationUtil.globalize("theme.title_hint")); m_title.setHint(GlobalizationUtil.globalize("theme.title_hint"));
m_title.setSize(40); m_title.setSize(40);
add(m_title); add(m_title);
// add(new Label(GlobalizationUtil.globalize("theme.description")));
m_description = new TextArea(new StringParameter("description")); m_description = new TextArea(new StringParameter("description"));
// Experimental, see above
m_description.setLabel(GlobalizationUtil.globalize("theme.description")); m_description.setLabel(GlobalizationUtil.globalize("theme.description"));
m_description.setCols(40); m_description.setCols(40);
m_description.setRows(4); m_description.setRows(4);
@ -125,9 +114,7 @@ public class ThemeForm extends Form implements Cancellable, ThemeDirectorConstan
.globalize("theme.description_hint")); .globalize("theme.description_hint"));
add(m_description); add(m_description);
// add(new Label(GlobalizationUtil.globalize("theme.url")));
m_url = new TextField(new StringParameter("url")); m_url = new TextField(new StringParameter("url"));
// Experimental, see above
m_url.setLabel(GlobalizationUtil.globalize("theme.url")); m_url.setLabel(GlobalizationUtil.globalize("theme.url"));
m_url.addValidationListener(new NotEmptyValidationListener()); m_url.addValidationListener(new NotEmptyValidationListener());
m_url.addValidationListener(new URLFormValidationListener()); m_url.addValidationListener(new URLFormValidationListener());