Für den Typ SciPublications/Proceedings kann nun konfiguriert werden ob die Felder
* Place of Conference * Begin of Conference * End of Conference Pflichtfelder sind. In der Default-Einstellung sind die Felder Pflichtfelder. git-svn-id: https://svn.libreccm.org/ccm/trunk@2138 8810af33-2d31-482b-a856-94f89814c4dfmaster
parent
73a52b2433
commit
3aaa683233
|
|
@ -1,5 +1,6 @@
|
||||||
<?xml version="1.0" encoding="utf-8"?>
|
<?xml version="1.0" encoding="utf-8"?>
|
||||||
<registry>
|
<registry>
|
||||||
<config class="com.arsdigita.cms.contenttypes.PublicationsConfig" storage="ccm-sci-publications/publications.properties"/>
|
<config class="com.arsdigita.cms.contenttypes.PublicationsConfig" storage="ccm-sci-publications/publications.properties"/>
|
||||||
|
<config class="com.arsdigita.cms.contenttypes.ProeccedingsConfig" storage="ccm-sci-publications/proceedings.properties"/>
|
||||||
<config class="com.arsdigita.cms.scipublications.importer.ris.RisImporterConfig" storage="ccm-sci-publications/ris_importer.properties"/>
|
<config class="com.arsdigita.cms.scipublications.importer.ris.RisImporterConfig" storage="ccm-sci-publications/ris_importer.properties"/>
|
||||||
</registry>
|
</registry>
|
||||||
|
|
|
||||||
|
|
@ -32,9 +32,8 @@ import java.util.Date;
|
||||||
import java.util.List;
|
import java.util.List;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Content type of proceedings. Provides attributes for storing the data
|
* Content type of proceedings. Provides attributes for storing the data of the conference (name, date, place,
|
||||||
* of the conference (name, date, place, organizer) and for linking the papers
|
* organizer) and for linking the papers (objects of the content type {@link InProceedings} to a proceedings object.
|
||||||
* (objects of the content type {@link InProceedings} to a proceedings object.
|
|
||||||
*
|
*
|
||||||
*
|
*
|
||||||
* @author Jens Pelzetter
|
* @author Jens Pelzetter
|
||||||
|
|
@ -50,6 +49,7 @@ public class Proceedings extends PublicationWithPublisher {
|
||||||
public static final String PAPER_ORDER = "paperOrder";
|
public static final String PAPER_ORDER = "paperOrder";
|
||||||
public static final String BASE_DATA_OBJECT_TYPE =
|
public static final String BASE_DATA_OBJECT_TYPE =
|
||||||
"com.arsdigita.cms.contenttypes.Proceedings";
|
"com.arsdigita.cms.contenttypes.Proceedings";
|
||||||
|
private static final ProceedingsConfig PROCEEDINGS_CONFIG = new ProceedingsConfig();
|
||||||
|
|
||||||
public Proceedings() {
|
public Proceedings() {
|
||||||
super(BASE_DATA_OBJECT_TYPE);
|
super(BASE_DATA_OBJECT_TYPE);
|
||||||
|
|
@ -71,6 +71,10 @@ public class Proceedings extends PublicationWithPublisher {
|
||||||
super(type);
|
super(type);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
public static ProceedingsConfig getProceedingsConfig() {
|
||||||
|
return PROCEEDINGS_CONFIG;
|
||||||
|
}
|
||||||
|
|
||||||
public ProceedingsBundle getProceedingsBundle() {
|
public ProceedingsBundle getProceedingsBundle() {
|
||||||
return (ProceedingsBundle) getContentBundle();
|
return (ProceedingsBundle) getContentBundle();
|
||||||
}
|
}
|
||||||
|
|
|
||||||
|
|
@ -0,0 +1,56 @@
|
||||||
|
package com.arsdigita.cms.contenttypes;
|
||||||
|
|
||||||
|
import com.arsdigita.runtime.AbstractConfig;
|
||||||
|
import com.arsdigita.util.parameter.BooleanParameter;
|
||||||
|
import com.arsdigita.util.parameter.Parameter;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Special configuration file for the {@link Proceedings} type. The parameters in this configuration
|
||||||
|
* can be used to decide if some fields of the {@link Proceedings} type are mandatory.
|
||||||
|
*
|
||||||
|
* @author Jens Pelzetter
|
||||||
|
* @version $Id$
|
||||||
|
*/
|
||||||
|
public class ProceedingsConfig extends AbstractConfig {
|
||||||
|
|
||||||
|
private final Parameter beginOfConferenceMandatory;
|
||||||
|
private final Parameter endOfConferenceMandatory;
|
||||||
|
private final Parameter placeOfConferenceMandatory;
|
||||||
|
|
||||||
|
public ProceedingsConfig() {
|
||||||
|
super();
|
||||||
|
|
||||||
|
beginOfConferenceMandatory = new BooleanParameter(
|
||||||
|
"com.arsdigita.cms.contenttypes.publications.proceedings.beginOfConferenceIsMandatory",
|
||||||
|
Parameter.REQUIRED,
|
||||||
|
Boolean.TRUE);
|
||||||
|
|
||||||
|
endOfConferenceMandatory = new BooleanParameter(
|
||||||
|
"com.arsdigita.cms.contenttypes.publications.proceedings.endOfConferenceIsMandatory",
|
||||||
|
Parameter.REQUIRED,
|
||||||
|
Boolean.TRUE);
|
||||||
|
|
||||||
|
placeOfConferenceMandatory = new BooleanParameter(
|
||||||
|
"com.arsdigita.cms.contenttypes.publications.proceedings.placeOfConferenceIsMandatory",
|
||||||
|
Parameter.REQUIRED,
|
||||||
|
Boolean.TRUE);
|
||||||
|
|
||||||
|
register(beginOfConferenceMandatory);
|
||||||
|
register(endOfConferenceMandatory);
|
||||||
|
register(placeOfConferenceMandatory);
|
||||||
|
|
||||||
|
loadInfo();
|
||||||
|
}
|
||||||
|
|
||||||
|
public Boolean isBeginOfConferenceMandatory() {
|
||||||
|
return (Boolean) get(beginOfConferenceMandatory);
|
||||||
|
}
|
||||||
|
|
||||||
|
public Boolean isEndOfConferenceMandatory() {
|
||||||
|
return (Boolean) get(endOfConferenceMandatory);
|
||||||
|
}
|
||||||
|
|
||||||
|
public Boolean isPlaceOfConferenceMandatory() {
|
||||||
|
return (Boolean) get(placeOfConferenceMandatory);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
@ -0,0 +1,14 @@
|
||||||
|
com.arsdigita.cms.contenttypes.publications.proceedings.beginOfConferenceIsMandatory.title = Is Begin of Conference mandatory?
|
||||||
|
com.arsdigita.cms.contenttypes.publications.proceedings.beginOfConferenceIsMandatory.purpose = Decides wether the field 'Begin of Conference' is mandatory in the Proceedings type.
|
||||||
|
com.arsdigita.cms.contenttypes.publications.proceedings.beginOfConferenceIsMandatory.example = true
|
||||||
|
com.arsdigita.cms.contenttypes.publications.proceedings.beginOfConferenceIsMandatory.format = [Boolean]
|
||||||
|
|
||||||
|
com.arsdigita.cms.contenttypes.publications.proceedings.endOfConferenceIsMandatory.title = Is End of Conference mandatory?
|
||||||
|
com.arsdigita.cms.contenttypes.publications.proceedings.endOfConferenceIsMandatory.purpose = Decides wether the field 'End of Conference' is mandatory in the Proceedings type.
|
||||||
|
com.arsdigita.cms.contenttypes.publications.proceedings.endOfConferenceIsMandatory.example = true
|
||||||
|
com.arsdigita.cms.contenttypes.publications.proceedings.endOfConferenceIsMandatory.format = [Boolean]
|
||||||
|
|
||||||
|
com.arsdigita.cms.contenttypes.publications.proceedings.placeOfConferenceIsMandatory.title = Is Place of Conference mandatory?
|
||||||
|
com.arsdigita.cms.contenttypes.publications.proceedings.placeOfConferenceIsMandatory.purpose = Decides wether the field 'Place of Conference' is mandatory in the Proceedings type.
|
||||||
|
com.arsdigita.cms.contenttypes.publications.proceedings.placeOfConferenceIsMandatory.example = true
|
||||||
|
com.arsdigita.cms.contenttypes.publications.proceedings.placeOfConferenceIsMandatory.format = [Boolean]
|
||||||
|
|
@ -35,12 +35,15 @@ import com.arsdigita.bebop.parameters.ParameterModel;
|
||||||
import com.arsdigita.bebop.parameters.StringParameter;
|
import com.arsdigita.bebop.parameters.StringParameter;
|
||||||
import com.arsdigita.cms.ItemSelectionModel;
|
import com.arsdigita.cms.ItemSelectionModel;
|
||||||
import com.arsdigita.cms.contenttypes.Proceedings;
|
import com.arsdigita.cms.contenttypes.Proceedings;
|
||||||
|
import com.arsdigita.cms.contenttypes.ProceedingsConfig;
|
||||||
|
import com.arsdigita.cms.contenttypes.Publication;
|
||||||
import java.util.Calendar;
|
import java.util.Calendar;
|
||||||
import java.util.GregorianCalendar;
|
import java.util.GregorianCalendar;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
*
|
*
|
||||||
* @author Jens Pelzetter
|
* @author Jens Pelzetter
|
||||||
|
* @version $Id$
|
||||||
*/
|
*/
|
||||||
public class ProceedingsPropertyForm
|
public class ProceedingsPropertyForm
|
||||||
extends PublicationWithPublisherPropertyForm
|
extends PublicationWithPublisherPropertyForm
|
||||||
|
|
@ -48,17 +51,17 @@ public class ProceedingsPropertyForm
|
||||||
FormInitListener,
|
FormInitListener,
|
||||||
FormSubmissionListener {
|
FormSubmissionListener {
|
||||||
|
|
||||||
private ProceedingsPropertiesStep m_step;
|
//private ProceedingsPropertiesStep m_step;
|
||||||
public static final String ID = "proceedingsEdit";
|
public static final String ID = "proceedingsEdit";
|
||||||
|
|
||||||
public ProceedingsPropertyForm(ItemSelectionModel itemModel) {
|
public ProceedingsPropertyForm(final ItemSelectionModel itemModel) {
|
||||||
this(itemModel, null);
|
this(itemModel, null);
|
||||||
}
|
}
|
||||||
|
|
||||||
public ProceedingsPropertyForm(ItemSelectionModel itemModel,
|
public ProceedingsPropertyForm(final ItemSelectionModel itemModel,
|
||||||
ProceedingsPropertiesStep step) {
|
final ProceedingsPropertiesStep step) {
|
||||||
super(itemModel, step);
|
super(itemModel, step);
|
||||||
m_step = step;
|
//m_step = step;
|
||||||
addSubmissionListener(this);
|
addSubmissionListener(this);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
@ -66,53 +69,61 @@ public class ProceedingsPropertyForm
|
||||||
protected void addWidgets() {
|
protected void addWidgets() {
|
||||||
super.addWidgets();
|
super.addWidgets();
|
||||||
|
|
||||||
|
final ProceedingsConfig proceedingsConfig = Proceedings.getProceedingsConfig();
|
||||||
|
|
||||||
add(new Label(PublicationGlobalizationUtil.globalize(
|
add(new Label(PublicationGlobalizationUtil.globalize(
|
||||||
"publications.ui.proceedings.name_of_conference")));
|
"publications.ui.proceedings.name_of_conference")));
|
||||||
ParameterModel nameOfConfParam = new StringParameter(
|
final ParameterModel nameOfConfParam = new StringParameter(
|
||||||
Proceedings.NAME_OF_CONFERENCE);
|
Proceedings.NAME_OF_CONFERENCE);
|
||||||
TextField nameOfConf = new TextField(nameOfConfParam);
|
final TextField nameOfConf = new TextField(nameOfConfParam);
|
||||||
nameOfConf.addValidationListener(new NotNullValidationListener());
|
nameOfConf.addValidationListener(new NotNullValidationListener());
|
||||||
nameOfConf.addValidationListener(new NotEmptyValidationListener());
|
nameOfConf.addValidationListener(new NotEmptyValidationListener());
|
||||||
add(nameOfConf);
|
add(nameOfConf);
|
||||||
|
|
||||||
add(new Label(PublicationGlobalizationUtil.globalize(
|
add(new Label(PublicationGlobalizationUtil.globalize(
|
||||||
"publications.ui.proceedings.place_of_conference")));
|
"publications.ui.proceedings.place_of_conference")));
|
||||||
ParameterModel placeOfConfParam = new StringParameter(
|
final ParameterModel placeOfConfParam = new StringParameter(
|
||||||
Proceedings.PLACE_OF_CONFERENCE);
|
Proceedings.PLACE_OF_CONFERENCE);
|
||||||
TextField placeOfConf = new TextField(placeOfConfParam);
|
final TextField placeOfConf = new TextField(placeOfConfParam);
|
||||||
|
if (proceedingsConfig.isPlaceOfConferenceMandatory()) {
|
||||||
placeOfConf.addValidationListener(new NotNullValidationListener());
|
placeOfConf.addValidationListener(new NotNullValidationListener());
|
||||||
placeOfConf.addValidationListener(new NotEmptyValidationListener());
|
placeOfConf.addValidationListener(new NotEmptyValidationListener());
|
||||||
|
}
|
||||||
add(placeOfConf);
|
add(placeOfConf);
|
||||||
|
|
||||||
Calendar today = new GregorianCalendar();
|
final Calendar today = new GregorianCalendar();
|
||||||
add(new Label(PublicationGlobalizationUtil.globalize(
|
add(new Label(PublicationGlobalizationUtil.globalize(
|
||||||
"publications.ui.proceedings.date_from_of_conference")));
|
"publications.ui.proceedings.date_from_of_conference")));
|
||||||
ParameterModel dateFromParam = new DateParameter(
|
final ParameterModel dateFromParam = new DateParameter(
|
||||||
Proceedings.DATE_FROM_OF_CONFERENCE);
|
Proceedings.DATE_FROM_OF_CONFERENCE);
|
||||||
Date dateFrom = new Date(dateFromParam);
|
final Date dateFrom = new Date(dateFromParam);
|
||||||
dateFrom.setYearRange(1900, today.get(Calendar.YEAR) + 3);
|
dateFrom.setYearRange(1900, today.get(Calendar.YEAR) + 3);
|
||||||
|
if (proceedingsConfig.isBeginOfConferenceMandatory()) {
|
||||||
dateFrom.addValidationListener(new NotNullValidationListener());
|
dateFrom.addValidationListener(new NotNullValidationListener());
|
||||||
dateFrom.addValidationListener(new NotEmptyValidationListener());
|
dateFrom.addValidationListener(new NotEmptyValidationListener());
|
||||||
|
}
|
||||||
add(dateFrom);
|
add(dateFrom);
|
||||||
|
|
||||||
add(new Label(PublicationGlobalizationUtil.globalize(
|
add(new Label(PublicationGlobalizationUtil.globalize(
|
||||||
"publications.ui.proceedings.date_to_of_conference")));
|
"publications.ui.proceedings.date_to_of_conference")));
|
||||||
ParameterModel dateToParam = new DateParameter(
|
final ParameterModel dateToParam = new DateParameter(
|
||||||
Proceedings.DATE_TO_OF_CONFERENCE);
|
Proceedings.DATE_TO_OF_CONFERENCE);
|
||||||
Date dateTo = new Date(dateToParam);
|
final Date dateTo = new Date(dateToParam);
|
||||||
dateTo.setYearRange(1900, today.get(Calendar.YEAR) + 3);
|
dateTo.setYearRange(1900, today.get(Calendar.YEAR) + 3);
|
||||||
|
if (proceedingsConfig.isEndOfConferenceMandatory()) {
|
||||||
dateTo.addValidationListener(new NotNullValidationListener());
|
dateTo.addValidationListener(new NotNullValidationListener());
|
||||||
dateTo.addValidationListener(new NotEmptyValidationListener());
|
dateTo.addValidationListener(new NotEmptyValidationListener());
|
||||||
|
}
|
||||||
add(dateTo);
|
add(dateTo);
|
||||||
}
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
public void init(FormSectionEvent fse) throws FormProcessException {
|
public void init(final FormSectionEvent fse) throws FormProcessException {
|
||||||
|
|
||||||
super.init(fse);
|
super.init(fse);
|
||||||
|
|
||||||
FormData data = fse.getFormData();
|
final FormData data = fse.getFormData();
|
||||||
Proceedings proceedings = (Proceedings) super.initBasicWidgets(fse);
|
final Proceedings proceedings = (Proceedings) super.initBasicWidgets(fse);
|
||||||
|
|
||||||
data.put(Proceedings.NAME_OF_CONFERENCE,
|
data.put(Proceedings.NAME_OF_CONFERENCE,
|
||||||
proceedings.getNameOfConference());
|
proceedings.getNameOfConference());
|
||||||
|
|
@ -125,11 +136,11 @@ public class ProceedingsPropertyForm
|
||||||
}
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
public void process(FormSectionEvent fse) throws FormProcessException {
|
public void process(final FormSectionEvent fse) throws FormProcessException {
|
||||||
super.process(fse);
|
super.process(fse);
|
||||||
|
|
||||||
FormData data = fse.getFormData();
|
final FormData data = fse.getFormData();
|
||||||
Proceedings proceedings = (Proceedings) super.processBasicWidgets(fse);
|
final Proceedings proceedings = (Proceedings) super.processBasicWidgets(fse);
|
||||||
|
|
||||||
|
|
||||||
if ((proceedings != null) && getSaveCancelSection().getSaveButton().
|
if ((proceedings != null) && getSaveCancelSection().getSaveButton().
|
||||||
|
|
|
||||||
Loading…
Reference in New Issue