Some extensisons for publications:
- Symbol (Kürzel) for Journal (Ticket #1523) - Language of publication (Ticket #1552) - Date of first publication (Ticket #1536) git-svn-id: https://svn.libreccm.org/ccm/trunk@2078 8810af33-2d31-482b-a856-94f89814c4dfmaster
parent
6c79fc15a9
commit
5856cc0ce5
|
|
@ -2,7 +2,7 @@
|
|||
<ccm:application xmlns:ccm="http://ccm.redhat.com/ccm-project"
|
||||
name="ccm-sci-publications"
|
||||
prettyName="OpenCCM Content Types"
|
||||
version="6.6.3"
|
||||
version="6.6.4"
|
||||
release="1"
|
||||
webapp="ROOT">
|
||||
<ccm:dependencies>
|
||||
|
|
|
|||
|
|
@ -29,6 +29,7 @@ object type Journal extends ContentPage {
|
|||
Integer[0..1] lastYear = ct_journal.lastyear INTEGER;
|
||||
String[0..1] issn = ct_journal.issn VARCHAR(9);
|
||||
String[0..1] abstract = ct_journal.abstract VARCHAR(4096);
|
||||
String[0..1] symbol = ct_journal.symbol VARCHAR(128);
|
||||
|
||||
reference key (ct_journal.journal_id);
|
||||
}
|
||||
|
|
|
|||
|
|
@ -41,6 +41,10 @@ object type Publication extends ContentPage {
|
|||
//(ordering by publications by their authors requires joins or subqueries
|
||||
//without this field)
|
||||
String[0..1] authorsStr = ct_publications.authors VARCHAR(2048);
|
||||
//Year on which the publication was first published
|
||||
Integer[0..1] yearFirstPublished = ct_publications.firstPublished INTEGER;
|
||||
//The language of the publication
|
||||
String[0..1] languageOfPublication = ct_publications.lang VARCHAR(128);
|
||||
|
||||
reference key (ct_publications.publication_id);
|
||||
}
|
||||
|
|
|
|||
|
|
@ -8,4 +8,7 @@
|
|||
<version from="6.6.2" to="6.6.3">
|
||||
<script class="com.arsdigita.cms.contenttypes.upgrades.SciPublicationsUpgrade662to663"/>
|
||||
</version>
|
||||
<version from="6.6.3" to="6.6.4">
|
||||
<script sql="ccm-sci-publications/upgrade/::database::-6.6.3-6.6.4.sql" />
|
||||
</version>
|
||||
</upgrade>
|
||||
|
|
@ -41,8 +41,8 @@ public class Journal extends ContentPage {
|
|||
public static final String ABSTRACT = "abstract";
|
||||
public static final String ARTICLES = "articles";
|
||||
public static final String ARTICLE_ORDER = "articleOrder";
|
||||
public static final String BASE_DATA_OBJECT_TYPE =
|
||||
"com.arsdigita.cms.contenttypes.Journal";
|
||||
public static final String SYMBOL = "symbol";
|
||||
public static final String BASE_DATA_OBJECT_TYPE = "com.arsdigita.cms.contenttypes.Journal";
|
||||
|
||||
public Journal() {
|
||||
this(BASE_DATA_OBJECT_TYPE);
|
||||
|
|
@ -115,7 +115,7 @@ public class Journal extends ContentPage {
|
|||
getJournalBundle().addArticle(article);
|
||||
}
|
||||
|
||||
public void removeArticle(ArticleInJournal article) {
|
||||
public void removeArticle(final ArticleInJournal article) {
|
||||
//Assert.exists(article, ArticleInCollectedVolume.class);
|
||||
//remove(ARTICLES, article);
|
||||
|
||||
|
|
@ -126,6 +126,19 @@ public class Journal extends ContentPage {
|
|||
return !this.getArticles().isEmpty();
|
||||
}
|
||||
|
||||
/**
|
||||
* The symbol used commonly used for referencing the journal (german: Kürzel).
|
||||
*
|
||||
* @return
|
||||
*/
|
||||
public String getSymbol() {
|
||||
return (String) get(SYMBOL);
|
||||
}
|
||||
|
||||
public void setSymbol(final String symbol) {
|
||||
set(SYMBOL, symbol);
|
||||
}
|
||||
|
||||
@Override
|
||||
public List<ExtraXMLGenerator> getExtraXMLGenerators() {
|
||||
final List<ExtraXMLGenerator> generators = super.getExtraXMLGenerators();
|
||||
|
|
@ -139,4 +152,5 @@ public class Journal extends ContentPage {
|
|||
generators.add(new JournalExtraXmlGenerator());
|
||||
return generators;
|
||||
}
|
||||
|
||||
}
|
||||
|
|
|
|||
|
|
@ -75,6 +75,8 @@ public class Publication extends ContentPage {
|
|||
public final static String ORGAUNITS = "orgaunits";
|
||||
public final static String ORGAUNIT_PUBLICATIONS = "publications";
|
||||
public static final String REVIEWED = "reviewed";
|
||||
public static final String FIRST_PUBLISHED = "yearFirstPublished";
|
||||
public static final String LANG = "languageOfPublication";
|
||||
public final static String BASE_DATA_OBJECT_TYPE =
|
||||
"com.arsdigita.cms.contenttypes.Publication";
|
||||
private final static PublicationsConfig config = new PublicationsConfig();
|
||||
|
|
@ -335,6 +337,32 @@ public class Publication extends ContentPage {
|
|||
PublicationBundle.removePublication(orgaunit, publication);
|
||||
}
|
||||
|
||||
/**
|
||||
* The year when the first edition of the publication was published.
|
||||
*
|
||||
* @return
|
||||
*/
|
||||
public Integer getYearFirstPublished() {
|
||||
return (Integer) get(FIRST_PUBLISHED);
|
||||
}
|
||||
|
||||
public void setYearFirstPublished(final Integer value) {
|
||||
set(FIRST_PUBLISHED, value);
|
||||
}
|
||||
|
||||
/**
|
||||
* The language the publication is written in.
|
||||
*
|
||||
* @return
|
||||
*/
|
||||
public String getLanguageOfPublication() {
|
||||
return (String) get(LANG);
|
||||
}
|
||||
|
||||
public void setLanguageOfPublication(final String value) {
|
||||
set(LANG, value);
|
||||
}
|
||||
|
||||
@Override
|
||||
public List<ExtraXMLGenerator> getExtraXMLGenerators() {
|
||||
final List<ExtraXMLGenerator> generators = super.getExtraXMLGenerators();
|
||||
|
|
|
|||
|
|
@ -31,6 +31,8 @@ public class PublicationsConfig extends AbstractConfig {
|
|||
private final Parameter defaultPublicationsFolder;
|
||||
private final Parameter orgaType;
|
||||
private final Parameter orgaBundleType;
|
||||
private final Parameter enableFirstPublishedProperty;
|
||||
private final Parameter enableLanguageProperty;
|
||||
|
||||
public PublicationsConfig() {
|
||||
attachOrgaUnitsStep =
|
||||
|
|
@ -127,6 +129,16 @@ public class PublicationsConfig extends AbstractConfig {
|
|||
Parameter.OPTIONAL,
|
||||
PublisherBundle.BASE_DATA_OBJECT_TYPE);
|
||||
|
||||
enableFirstPublishedProperty = new BooleanParameter(
|
||||
"com.arsdigita.cms.contenttypes.publications.enable_first_published_property",
|
||||
Parameter.REQUIRED,
|
||||
true);
|
||||
|
||||
enableLanguageProperty = new BooleanParameter(
|
||||
"com.arsdigita.cms.contenttypes.publications.enable_language_property",
|
||||
Parameter.REQUIRED,
|
||||
true);
|
||||
|
||||
register(attachOrgaUnitsStep);
|
||||
register(attachOrganizationPublicationsStepTo);
|
||||
register(attachPersonPublicationsStep);
|
||||
|
|
@ -145,6 +157,8 @@ public class PublicationsConfig extends AbstractConfig {
|
|||
register(defaultPublicationsFolder);
|
||||
register(orgaType);
|
||||
register(orgaBundleType);
|
||||
register(enableFirstPublishedProperty);
|
||||
register(enableLanguageProperty);
|
||||
|
||||
loadInfo();
|
||||
}
|
||||
|
|
@ -265,4 +279,12 @@ public class PublicationsConfig extends AbstractConfig {
|
|||
return (String) get(orgaBundleType);
|
||||
}
|
||||
|
||||
public Boolean getEnableFirstPublishedProperty() {
|
||||
return (Boolean) get(enableFirstPublishedProperty);
|
||||
}
|
||||
|
||||
public Boolean getEnableLanguageProperty() {
|
||||
return (Boolean) get(enableLanguageProperty);
|
||||
}
|
||||
|
||||
}
|
||||
|
|
|
|||
|
|
@ -86,4 +86,14 @@ com.arsdigita.cms.contenttypes.publications.organization_type.format = String
|
|||
com.arsdigita.cms.contenttypes.publications.organization_bundle_type.title = Type of the content bundle sub class used for imported organizations
|
||||
com.arsdigita.cms.contenttypes.publications.organization_bundle_type.purpose = Sets the type of the bundle used for imported organization. Must be a subtype of com.arsdigita.cms.contenttypes.GenericOrganizationalUnitBundle
|
||||
com.arsdigita.cms.contenttypes.publications.organization_bundle_type.example = com.arsdigita.cms.contenttypes.PublisherBundle
|
||||
com.arsdigita.cms.contenttypes.publications.organization_bundle_type = String
|
||||
com.arsdigita.cms.contenttypes.publications.organization_bundle_type.format = String
|
||||
|
||||
com.arsdigita.cms.contenttypes.publications.enable_first_published_property.title = Enable first published property
|
||||
com.arsdigita.cms.contenttypes.publications.enable_first_published_property.purpose = Enable first published property
|
||||
com.arsdigita.cms.contenttypes.publications.enable_first_published_property.example = true
|
||||
com.arsdigita.cms.contenttypes.publications.enable_first_published_property.format = Boolean
|
||||
|
||||
com.arsdigita.cms.contenttypes.publications.enable_language_property.title = Enable language property
|
||||
com.arsdigita.cms.contenttypes.publications.enable_language_property.purpose = Enable language property
|
||||
com.arsdigita.cms.contenttypes.publications.enable_language_property.example = true
|
||||
com.arsdigita.cms.contenttypes.publications.enable_language_property.format = Boolean
|
||||
|
|
@ -71,6 +71,7 @@ public class ArticleInJournalJournalForm
|
|||
itemSearch.setDefaultCreationFolder(new Folder(new BigDecimal(config.getDefaultJournalsFolder())));
|
||||
}
|
||||
itemSearch.setEditAfterCreate(false);
|
||||
itemSearch.setQueryField("symbol");
|
||||
add(itemSearch);
|
||||
}
|
||||
|
||||
|
|
|
|||
|
|
@ -69,9 +69,6 @@ public class JournalPropertiesStep extends SimpleEditStep {
|
|||
sheet.add(PublicationGlobalizationUtil.globalize(
|
||||
"publications.ui.journal.name"),
|
||||
Publication.NAME);
|
||||
sheet.add(PublicationGlobalizationUtil.globalize(
|
||||
"publications.ui.journal.title"),
|
||||
Publication.TITLE);
|
||||
|
||||
sheet.add(PublicationGlobalizationUtil.globalize(
|
||||
"publications.ui.journal.issn"),
|
||||
|
|
@ -89,6 +86,9 @@ public class JournalPropertiesStep extends SimpleEditStep {
|
|||
"publications.ui.journal.abstract"),
|
||||
Journal.ABSTRACT);
|
||||
|
||||
sheet.add(PublicationGlobalizationUtil.globalize("publications.ui.journal.symbol"), Journal.SYMBOL);
|
||||
|
||||
|
||||
if (!ContentSection.getConfig().getHideLaunchDate()) {
|
||||
sheet.add(ContenttypesGlobalizationUtil.globalize(
|
||||
"cms.ui.authoring.page_launch_date"),
|
||||
|
|
|
|||
|
|
@ -34,9 +34,11 @@ import com.arsdigita.bebop.parameters.IntegerParameter;
|
|||
import com.arsdigita.bebop.parameters.ParameterData;
|
||||
import com.arsdigita.bebop.parameters.ParameterModel;
|
||||
import com.arsdigita.bebop.parameters.StringParameter;
|
||||
import com.arsdigita.cms.ContentSection;
|
||||
import com.arsdigita.cms.ItemSelectionModel;
|
||||
import com.arsdigita.cms.contenttypes.Journal;
|
||||
import com.arsdigita.cms.ui.authoring.BasicPageForm;
|
||||
import java.util.Date;
|
||||
import org.apache.log4j.Logger;
|
||||
|
||||
/**
|
||||
|
|
@ -49,17 +51,15 @@ public class JournalPropertyForm
|
|||
FormInitListener,
|
||||
FormSubmissionListener {
|
||||
|
||||
private static final Logger s_log =
|
||||
Logger.getLogger(JournalPropertyForm.class);
|
||||
private JournalPropertiesStep m_step;
|
||||
private static final Logger s_log = Logger.getLogger(JournalPropertyForm.class);
|
||||
private final JournalPropertiesStep m_step;
|
||||
public static final String ID = "JournalEdit";
|
||||
|
||||
public JournalPropertyForm(ItemSelectionModel itemModel) {
|
||||
public JournalPropertyForm(final ItemSelectionModel itemModel) {
|
||||
this(itemModel, null);
|
||||
}
|
||||
|
||||
public JournalPropertyForm(ItemSelectionModel itemModel,
|
||||
JournalPropertiesStep step) {
|
||||
public JournalPropertyForm(final ItemSelectionModel itemModel, final JournalPropertiesStep step) {
|
||||
super(ID, itemModel);
|
||||
m_step = step;
|
||||
addSubmissionListener(this);
|
||||
|
|
@ -69,15 +69,18 @@ public class JournalPropertyForm
|
|||
protected void addWidgets() {
|
||||
super.addWidgets();
|
||||
|
||||
add(new Label((String) PublicationGlobalizationUtil.globalize("publications.ui.journal.symbol").localize()));
|
||||
final ParameterModel symbolModel = new StringParameter(Journal.SYMBOL);
|
||||
final TextField symbol = new TextField(symbolModel);
|
||||
add(symbol);
|
||||
|
||||
add(new Label((String) PublicationGlobalizationUtil.globalize(
|
||||
"publications.ui.journal.issn").localize()));
|
||||
ParameterModel issnParam = new StringParameter(Journal.ISSN);
|
||||
TextField issn = new TextField(issnParam);
|
||||
final ParameterModel issnParam = new StringParameter(Journal.ISSN);
|
||||
final TextField issn = new TextField(issnParam);
|
||||
issn.addValidationListener(new ParameterListener() {
|
||||
|
||||
public void validate(ParameterEvent event) throws
|
||||
FormProcessException {
|
||||
ParameterData data = event.getParameterData();
|
||||
public void validate(final ParameterEvent event) throws FormProcessException {
|
||||
final ParameterData data = event.getParameterData();
|
||||
String value = (String) data.getValue();
|
||||
|
||||
if (value.isEmpty()) {
|
||||
|
|
@ -88,83 +91,113 @@ public class JournalPropertyForm
|
|||
|
||||
if (value.length() != 8) {
|
||||
data.invalidate();
|
||||
data.addError(PublicationGlobalizationUtil.globalize(
|
||||
"publications.ui.invalid_issn"));
|
||||
data.addError(PublicationGlobalizationUtil.globalize("publications.ui.invalid_issn"));
|
||||
}
|
||||
|
||||
try {
|
||||
Long num = Long.parseLong(value);
|
||||
final Long num = Long.parseLong(value);
|
||||
} catch (NumberFormatException ex) {
|
||||
data.invalidate();
|
||||
data.addError(PublicationGlobalizationUtil.globalize(
|
||||
"publications.ui.invalid_issn"));
|
||||
data.addError(PublicationGlobalizationUtil.globalize("publications.ui.invalid_issn"));
|
||||
}
|
||||
}
|
||||
|
||||
});
|
||||
add(issn);
|
||||
|
||||
add(new Label((String) PublicationGlobalizationUtil.globalize(
|
||||
"publications.ui.journal.firstYearOfPublication").localize()));
|
||||
ParameterModel firstYearParam = new IntegerParameter(Journal.FIRST_YEAR);
|
||||
TextField firstYear = new TextField(firstYearParam);
|
||||
final ParameterModel firstYearParam = new IntegerParameter(Journal.FIRST_YEAR);
|
||||
final TextField firstYear = new TextField(firstYearParam);
|
||||
add(firstYear);
|
||||
|
||||
add(new Label((String) PublicationGlobalizationUtil.globalize(
|
||||
"publications.ui.journal.lastYearOfPublication").localize()));
|
||||
ParameterModel lastYearParam = new IntegerParameter(Journal.LAST_YEAR);
|
||||
TextField lastYear = new TextField(lastYearParam);
|
||||
final ParameterModel lastYearParam = new IntegerParameter(Journal.LAST_YEAR);
|
||||
final TextField lastYear = new TextField(lastYearParam);
|
||||
add(lastYear);
|
||||
|
||||
add(new Label((String) PublicationGlobalizationUtil.globalize(
|
||||
"publications.ui.journal.abstract").localize()));
|
||||
ParameterModel abstractParam = new StringParameter(Journal.ABSTRACT);
|
||||
TextArea abstractArea = new TextArea(abstractParam);
|
||||
final ParameterModel abstractParam = new StringParameter(Journal.ABSTRACT);
|
||||
final TextArea abstractArea = new TextArea(abstractParam);
|
||||
abstractArea.setCols(60);
|
||||
abstractArea.setRows(18);
|
||||
add(abstractArea);
|
||||
}
|
||||
|
||||
@Override
|
||||
public void init(FormSectionEvent fse) throws FormProcessException {
|
||||
FormData data = fse.getFormData();
|
||||
Journal journal = (Journal) super.initBasicWidgets(fse);
|
||||
public void init(final FormSectionEvent fse) throws FormProcessException {
|
||||
final FormData data = fse.getFormData();
|
||||
|
||||
//Can' use basic initBasicWidgets for journal because we are doing some magic with the title to make it possible
|
||||
//to filter for the symbol of the journal
|
||||
//final Journal journal = (Journal) super.initBasicWidgets(fse);
|
||||
|
||||
final Journal journal = (Journal) getItemSelectionModel().getSelectedObject(fse.getPageState());
|
||||
|
||||
data.put(CONTENT_ITEM_ID, journal.getID().toString());
|
||||
data.put(NAME, journal.getName());
|
||||
data.put(TITLE, journal.getTitle());
|
||||
data.put(Journal.SYMBOL, journal.getSymbol());
|
||||
data.put(Journal.ISSN, journal.getISSN());
|
||||
data.put(Journal.FIRST_YEAR, journal.getFirstYear());
|
||||
data.put(Journal.LAST_YEAR, journal.getLastYear());
|
||||
data.put(Journal.ABSTRACT, journal.getAbstract());
|
||||
|
||||
if (!ContentSection.getConfig().getHideLaunchDate()) {
|
||||
data.put(LAUNCH_DATE, journal.getLaunchDate());
|
||||
// if launch date is required, help user by suggesting today's date
|
||||
if (ContentSection.getConfig().getRequireLaunchDate() && journal.getLaunchDate() == null) {
|
||||
data.put(LAUNCH_DATE, new Date());
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@Override
|
||||
public void process(FormSectionEvent fse) throws FormProcessException {
|
||||
FormData data = fse.getFormData();
|
||||
Journal journal = (Journal) super.processBasicWidgets(fse);
|
||||
public void process(final FormSectionEvent fse) throws FormProcessException {
|
||||
final FormData data = fse.getFormData();
|
||||
//final Journal journal = (Journal) super.processBasicWidgets(fse);
|
||||
|
||||
if ((journal != null) && getSaveCancelSection().getSaveButton().
|
||||
isSelected(fse.getPageState())) {
|
||||
final Journal journal = (Journal) getItemSelectionModel().getSelectedObject(fse.getPageState());
|
||||
|
||||
if ((journal != null) && getSaveCancelSection().getSaveButton().isSelected(fse.getPageState())) {
|
||||
|
||||
final String name = (String) data.get(NAME);
|
||||
journal.setName(name);
|
||||
|
||||
final String title = (String) data.get(TITLE);
|
||||
journal.setTitle(title);
|
||||
|
||||
final String symbol = (String) data.get(Journal.SYMBOL);
|
||||
journal.setSymbol(symbol);
|
||||
|
||||
String issn = (String) data.get(Journal.ISSN);
|
||||
issn = issn.replace("-", "");
|
||||
journal.setISSN(issn);
|
||||
|
||||
Integer firstYear = (Integer) data.get(Journal.FIRST_YEAR);
|
||||
final Integer firstYear = (Integer) data.get(Journal.FIRST_YEAR);
|
||||
journal.setFirstYear(firstYear);
|
||||
|
||||
Integer lastYear = (Integer) data.get(Journal.LAST_YEAR);
|
||||
final Integer lastYear = (Integer) data.get(Journal.LAST_YEAR);
|
||||
journal.setLastYear(lastYear);
|
||||
|
||||
String abstractStr = (String) data.get(Journal.ABSTRACT);
|
||||
final String abstractStr = (String) data.get(Journal.ABSTRACT);
|
||||
journal.setAbstract(abstractStr);
|
||||
|
||||
if (!ContentSection.getConfig().getHideLaunchDate()) {
|
||||
journal.setLaunchDate((Date) data.get(LAUNCH_DATE));
|
||||
}
|
||||
|
||||
journal.save();
|
||||
}
|
||||
}
|
||||
|
||||
@Override
|
||||
public void submitted(FormSectionEvent fse) throws FormProcessException {
|
||||
if ((m_step != null) && getSaveCancelSection().getCancelButton().
|
||||
isSelected(fse.getPageState())) {
|
||||
public void submitted(final FormSectionEvent fse) throws FormProcessException {
|
||||
if ((m_step != null) && getSaveCancelSection().getCancelButton().isSelected(fse.getPageState())) {
|
||||
m_step.cancelStreamlinedCreation(fse.getPageState());
|
||||
}
|
||||
}
|
||||
|
||||
}
|
||||
|
|
|
|||
|
|
@ -83,12 +83,21 @@ public class PublicationPropertiesStep extends SimpleEditStep {
|
|||
"publications.ui.publication.misc"),
|
||||
Publication.MISC);
|
||||
|
||||
if (Publication.getConfig().getEnableFirstPublishedProperty()) {
|
||||
sheet.add(PublicationGlobalizationUtil.globalize("publications.ui.publication.first_published"),
|
||||
Publication.FIRST_PUBLISHED);
|
||||
}
|
||||
|
||||
if (Publication.getConfig().getEnableLanguageProperty()) {
|
||||
sheet.add(PublicationGlobalizationUtil.globalize("publications.ui.publication.language"),
|
||||
Publication.LANG);
|
||||
}
|
||||
|
||||
if (!ContentSection.getConfig().getHideLaunchDate()) {
|
||||
sheet.add(ContenttypesGlobalizationUtil.globalize(
|
||||
"cms.ui.authoring.page_launch_date"),
|
||||
ContentPage.LAUNCH_DATE,
|
||||
new DomainObjectPropertySheet.AttributeFormatter() {
|
||||
|
||||
public String format(DomainObject item,
|
||||
String attribute,
|
||||
PageState state) {
|
||||
|
|
@ -101,6 +110,7 @@ public class PublicationPropertiesStep extends SimpleEditStep {
|
|||
"cms.ui.unknown").localize();
|
||||
}
|
||||
}
|
||||
|
||||
});
|
||||
}
|
||||
|
||||
|
|
@ -165,5 +175,6 @@ public class PublicationPropertiesStep extends SimpleEditStep {
|
|||
return String.format("<pre>%s</pre>", str);
|
||||
}
|
||||
}
|
||||
|
||||
}
|
||||
}
|
||||
|
|
|
|||
|
|
@ -26,6 +26,8 @@ import com.arsdigita.bebop.event.FormInitListener;
|
|||
import com.arsdigita.bebop.event.FormProcessListener;
|
||||
import com.arsdigita.bebop.event.FormSectionEvent;
|
||||
import com.arsdigita.bebop.event.FormSubmissionListener;
|
||||
import com.arsdigita.bebop.form.Option;
|
||||
import com.arsdigita.bebop.form.SingleSelect;
|
||||
import com.arsdigita.bebop.form.TextArea;
|
||||
import com.arsdigita.bebop.form.TextField;
|
||||
import com.arsdigita.bebop.parameters.IntegerParameter;
|
||||
|
|
@ -34,6 +36,9 @@ import com.arsdigita.bebop.parameters.StringParameter;
|
|||
import com.arsdigita.cms.ItemSelectionModel;
|
||||
import com.arsdigita.cms.contenttypes.Publication;
|
||||
import com.arsdigita.cms.ui.authoring.BasicPageForm;
|
||||
import java.util.Arrays;
|
||||
import java.util.Comparator;
|
||||
import java.util.Locale;
|
||||
import org.apache.log4j.Logger;
|
||||
|
||||
/**
|
||||
|
|
@ -66,22 +71,38 @@ public class PublicationPropertyForm
|
|||
protected void addWidgets() {
|
||||
super.addWidgets();
|
||||
|
||||
/*add(new Label((String) PublicationGlobalizationUtil.globalize(
|
||||
"publications.ui.publication.title").localize()));
|
||||
ParameterModel titleParam = new StringParameter(Publication.TITLE);
|
||||
TextField title = new TextField(titleParam);
|
||||
add(title);*/
|
||||
|
||||
add(new Label((String) PublicationGlobalizationUtil.globalize(
|
||||
"publications.ui.publication.year_of_publication").localize()));
|
||||
ParameterModel yearOfPublicationParam = new IntegerParameter(
|
||||
Publication.YEAR_OF_PUBLICATION);
|
||||
TextField yearOfPublication = new TextField(yearOfPublicationParam);
|
||||
final ParameterModel yearOfPublicationParam = new IntegerParameter(Publication.YEAR_OF_PUBLICATION);
|
||||
final TextField yearOfPublication = new TextField(yearOfPublicationParam);
|
||||
yearOfPublication.setMaxLength(4);
|
||||
//yearOfPublication.addValidationListener(new NotNullValidationListener());
|
||||
//yearOfPublication.addValidationListener(new NotEmptyValidationListener());
|
||||
add(yearOfPublication);
|
||||
|
||||
add(new Label((String) PublicationGlobalizationUtil.globalize("publications.ui.publication.first_published").localize()));
|
||||
final ParameterModel firstPublishedParam = new IntegerParameter(Publication.FIRST_PUBLISHED);
|
||||
final TextField firstPublished = new TextField(firstPublishedParam);
|
||||
add(firstPublished);
|
||||
|
||||
add(new Label((String) PublicationGlobalizationUtil.globalize("publications.ui.publication.language").localize()));
|
||||
final ParameterModel langParam = new StringParameter(Publication.LANG);
|
||||
//final TextField lang = new TextField(langParam);
|
||||
final SingleSelect lang = new SingleSelect(langParam);
|
||||
final Locale[] locales = Locale.getAvailableLocales();
|
||||
lang.addOption(new Option("", ""));
|
||||
Arrays.sort(locales, new Comparator<Locale>() {
|
||||
|
||||
public int compare(final Locale locale1, final Locale locale2) {
|
||||
return locale1.getDisplayName().compareTo(locale2.getDisplayName());
|
||||
}
|
||||
|
||||
});
|
||||
for(Locale locale : locales) {
|
||||
lang.addOption(new Option(locale.toString(), locale.getDisplayName()));
|
||||
}
|
||||
add(lang);
|
||||
|
||||
add(new Label((String) PublicationGlobalizationUtil.globalize(
|
||||
"publications.ui.publication.abstract").localize()));
|
||||
ParameterModel abstractParam = new StringParameter(Publication.ABSTRACT);
|
||||
|
|
@ -105,8 +126,9 @@ public class PublicationPropertyForm
|
|||
Publication publication = (Publication) super.initBasicWidgets(fse);
|
||||
|
||||
//data.put(Publication.TITLE, publication.getTitle());
|
||||
data.put(Publication.YEAR_OF_PUBLICATION, publication.
|
||||
getYearOfPublication());
|
||||
data.put(Publication.YEAR_OF_PUBLICATION, publication.getYearOfPublication());
|
||||
data.put(Publication.FIRST_PUBLISHED, publication.getYearFirstPublished());
|
||||
data.put(Publication.LANG, publication.getLanguageOfPublication());
|
||||
data.put(Publication.ABSTRACT, publication.getAbstract());
|
||||
data.put(Publication.MISC, publication.getMisc());
|
||||
}
|
||||
|
|
@ -119,8 +141,9 @@ public class PublicationPropertyForm
|
|||
if ((publication != null) && getSaveCancelSection().getSaveButton().
|
||||
isSelected(fse.getPageState())) {
|
||||
//publication.setTitle((String) data.get(Publication.TITLE));
|
||||
publication.setYearOfPublication((Integer) data.get(
|
||||
Publication.YEAR_OF_PUBLICATION));
|
||||
publication.setYearOfPublication((Integer) data.get(Publication.YEAR_OF_PUBLICATION));
|
||||
publication.setYearFirstPublished((Integer) data.get(Publication.FIRST_PUBLISHED));
|
||||
publication.setLanguageOfPublication((String) data.get(Publication.LANG));
|
||||
publication.setAbstract((String) data.get(Publication.ABSTRACT));
|
||||
publication.setMisc((String) data.get(Publication.MISC));
|
||||
|
||||
|
|
@ -141,4 +164,5 @@ public class PublicationPropertyForm
|
|||
return (String) PublicationGlobalizationUtil.globalize(
|
||||
"publications.ui.publication.title").localize();
|
||||
}
|
||||
|
||||
}
|
||||
|
|
|
|||
|
|
@ -411,3 +411,6 @@ organization.ui.publications.description=Edited publications
|
|||
organization.ui.publications.columns.name=Title
|
||||
organization.ui.publications.columns.year=Year
|
||||
organization.ui.publications.columns.type=Type
|
||||
publications.ui.journal.symbol=Symbol of the journal
|
||||
publications.ui.publication.first_published=First published
|
||||
publications.ui.publication.language=Language of publication
|
||||
|
|
|
|||
|
|
@ -410,3 +410,6 @@ organization.ui.publications.description=Herausgegebene Publikationen
|
|||
organization.ui.publications.columns.name=Titel
|
||||
organization.ui.publications.columns.year=Jahr
|
||||
organization.ui.publications.columns.type=Typ
|
||||
publications.ui.journal.symbol=K\u00fcrzel der Zeitschrift
|
||||
publications.ui.publication.first_published=Erste Ver\u00f6ffentlichung
|
||||
publications.ui.publication.language=Sprache der Publikation
|
||||
|
|
|
|||
Loading…
Reference in New Issue