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"?>
|
||||
<registry>
|
||||
<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"/>
|
||||
</registry>
|
||||
|
|
|
|||
|
|
@ -32,9 +32,8 @@ import java.util.Date;
|
|||
import java.util.List;
|
||||
|
||||
/**
|
||||
* Content type of proceedings. Provides attributes for storing the data
|
||||
* of the conference (name, date, place, organizer) and for linking the papers
|
||||
* (objects of the content type {@link InProceedings} to a proceedings object.
|
||||
* Content type of proceedings. Provides attributes for storing the data of the conference (name, date, place,
|
||||
* organizer) and for linking the papers (objects of the content type {@link InProceedings} to a proceedings object.
|
||||
*
|
||||
*
|
||||
* @author Jens Pelzetter
|
||||
|
|
@ -50,6 +49,7 @@ public class Proceedings extends PublicationWithPublisher {
|
|||
public static final String PAPER_ORDER = "paperOrder";
|
||||
public static final String BASE_DATA_OBJECT_TYPE =
|
||||
"com.arsdigita.cms.contenttypes.Proceedings";
|
||||
private static final ProceedingsConfig PROCEEDINGS_CONFIG = new ProceedingsConfig();
|
||||
|
||||
public Proceedings() {
|
||||
super(BASE_DATA_OBJECT_TYPE);
|
||||
|
|
@ -71,6 +71,10 @@ public class Proceedings extends PublicationWithPublisher {
|
|||
super(type);
|
||||
}
|
||||
|
||||
public static ProceedingsConfig getProceedingsConfig() {
|
||||
return PROCEEDINGS_CONFIG;
|
||||
}
|
||||
|
||||
public ProceedingsBundle getProceedingsBundle() {
|
||||
return (ProceedingsBundle) getContentBundle();
|
||||
}
|
||||
|
|
@ -78,20 +82,20 @@ public class Proceedings extends PublicationWithPublisher {
|
|||
public GenericOrganizationalUnit getOrganizerOfConference() {
|
||||
/*DataCollection collection;
|
||||
|
||||
collection = (DataCollection) get(ORGANIZER_OF_CONFERENCE);
|
||||
collection = (DataCollection) get(ORGANIZER_OF_CONFERENCE);
|
||||
|
||||
if (0 == collection.size()) {
|
||||
return null;
|
||||
} else {
|
||||
DataObject dobj;
|
||||
if (0 == collection.size()) {
|
||||
return null;
|
||||
} else {
|
||||
DataObject dobj;
|
||||
|
||||
collection.next();
|
||||
dobj = collection.getDataObject();
|
||||
collection.close();
|
||||
collection.next();
|
||||
dobj = collection.getDataObject();
|
||||
collection.close();
|
||||
|
||||
return (GenericOrganizationalUnit) DomainObjectFactory.newInstance(
|
||||
dobj);
|
||||
}*/
|
||||
return (GenericOrganizationalUnit) DomainObjectFactory.newInstance(
|
||||
dobj);
|
||||
}*/
|
||||
|
||||
final GenericOrganizationalUnitBundle bundle = getProceedingsBundle().getOrganizerOfConference();
|
||||
|
||||
|
|
@ -104,7 +108,7 @@ public class Proceedings extends PublicationWithPublisher {
|
|||
|
||||
public GenericOrganizationalUnit getOrganizerOfConference(
|
||||
final String language) {
|
||||
final GenericOrganizationalUnitBundle bundle = getProceedingsBundle().getOrganizerOfConference();
|
||||
final GenericOrganizationalUnitBundle bundle = getProceedingsBundle().getOrganizerOfConference();
|
||||
|
||||
if (bundle == null) {
|
||||
return null;
|
||||
|
|
@ -116,17 +120,17 @@ public class Proceedings extends PublicationWithPublisher {
|
|||
public void setOrganizerOfConference(GenericOrganizationalUnit organizer) {
|
||||
/*GenericOrganizationalUnit oldOrga;
|
||||
|
||||
oldOrga = getOrganizerOfConference();
|
||||
if (oldOrga != null) {
|
||||
remove(ORGANIZER_OF_CONFERENCE, oldOrga);
|
||||
}
|
||||
oldOrga = getOrganizerOfConference();
|
||||
if (oldOrga != null) {
|
||||
remove(ORGANIZER_OF_CONFERENCE, oldOrga);
|
||||
}
|
||||
|
||||
if (null != organizer) {
|
||||
Assert.exists(organizer, GenericOrganizationalUnit.class);
|
||||
DataObject link = add(ORGANIZER_OF_CONFERENCE, organizer);
|
||||
link.set("organizerOrder", 1);
|
||||
link.save();
|
||||
} */
|
||||
if (null != organizer) {
|
||||
Assert.exists(organizer, GenericOrganizationalUnit.class);
|
||||
DataObject link = add(ORGANIZER_OF_CONFERENCE, organizer);
|
||||
link.set("organizerOrder", 1);
|
||||
link.save();
|
||||
} */
|
||||
|
||||
getProceedingsBundle().setOrganizerOfConference(organizer);
|
||||
}
|
||||
|
|
@ -172,16 +176,16 @@ public class Proceedings extends PublicationWithPublisher {
|
|||
public void addPaper(InProceedings paper) {
|
||||
/*Assert.exists(paper, InProceedings.class);
|
||||
|
||||
DataObject link = add(PAPERS, paper);
|
||||
DataObject link = add(PAPERS, paper);
|
||||
|
||||
link.set(PAPER_ORDER, Integer.valueOf((int) getPapers().size()));*/
|
||||
link.set(PAPER_ORDER, Integer.valueOf((int) getPapers().size()));*/
|
||||
|
||||
getProceedingsBundle().addPaper(paper);
|
||||
}
|
||||
|
||||
public void removePaper(InProceedings paper) {
|
||||
/*Assert.exists(paper, InProceedings.class);
|
||||
remove(PAPERS, paper);*/
|
||||
remove(PAPERS, paper);*/
|
||||
|
||||
getProceedingsBundle().removePaper(paper);
|
||||
}
|
||||
|
|
|
|||
|
|
@ -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.cms.ItemSelectionModel;
|
||||
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.GregorianCalendar;
|
||||
|
||||
/**
|
||||
*
|
||||
* @author Jens Pelzetter
|
||||
* @version $Id$
|
||||
*/
|
||||
public class ProceedingsPropertyForm
|
||||
extends PublicationWithPublisherPropertyForm
|
||||
|
|
@ -48,17 +51,17 @@ public class ProceedingsPropertyForm
|
|||
FormInitListener,
|
||||
FormSubmissionListener {
|
||||
|
||||
private ProceedingsPropertiesStep m_step;
|
||||
//private ProceedingsPropertiesStep m_step;
|
||||
public static final String ID = "proceedingsEdit";
|
||||
|
||||
public ProceedingsPropertyForm(ItemSelectionModel itemModel) {
|
||||
public ProceedingsPropertyForm(final ItemSelectionModel itemModel) {
|
||||
this(itemModel, null);
|
||||
}
|
||||
|
||||
public ProceedingsPropertyForm(ItemSelectionModel itemModel,
|
||||
ProceedingsPropertiesStep step) {
|
||||
public ProceedingsPropertyForm(final ItemSelectionModel itemModel,
|
||||
final ProceedingsPropertiesStep step) {
|
||||
super(itemModel, step);
|
||||
m_step = step;
|
||||
//m_step = step;
|
||||
addSubmissionListener(this);
|
||||
}
|
||||
|
||||
|
|
@ -66,53 +69,61 @@ public class ProceedingsPropertyForm
|
|||
protected void addWidgets() {
|
||||
super.addWidgets();
|
||||
|
||||
final ProceedingsConfig proceedingsConfig = Proceedings.getProceedingsConfig();
|
||||
|
||||
add(new Label(PublicationGlobalizationUtil.globalize(
|
||||
"publications.ui.proceedings.name_of_conference")));
|
||||
ParameterModel nameOfConfParam = new StringParameter(
|
||||
final ParameterModel nameOfConfParam = new StringParameter(
|
||||
Proceedings.NAME_OF_CONFERENCE);
|
||||
TextField nameOfConf = new TextField(nameOfConfParam);
|
||||
final TextField nameOfConf = new TextField(nameOfConfParam);
|
||||
nameOfConf.addValidationListener(new NotNullValidationListener());
|
||||
nameOfConf.addValidationListener(new NotEmptyValidationListener());
|
||||
add(nameOfConf);
|
||||
|
||||
add(new Label(PublicationGlobalizationUtil.globalize(
|
||||
"publications.ui.proceedings.place_of_conference")));
|
||||
ParameterModel placeOfConfParam = new StringParameter(
|
||||
final ParameterModel placeOfConfParam = new StringParameter(
|
||||
Proceedings.PLACE_OF_CONFERENCE);
|
||||
TextField placeOfConf = new TextField(placeOfConfParam);
|
||||
placeOfConf.addValidationListener(new NotNullValidationListener());
|
||||
placeOfConf.addValidationListener(new NotEmptyValidationListener());
|
||||
final TextField placeOfConf = new TextField(placeOfConfParam);
|
||||
if (proceedingsConfig.isPlaceOfConferenceMandatory()) {
|
||||
placeOfConf.addValidationListener(new NotNullValidationListener());
|
||||
placeOfConf.addValidationListener(new NotEmptyValidationListener());
|
||||
}
|
||||
add(placeOfConf);
|
||||
|
||||
Calendar today = new GregorianCalendar();
|
||||
final Calendar today = new GregorianCalendar();
|
||||
add(new Label(PublicationGlobalizationUtil.globalize(
|
||||
"publications.ui.proceedings.date_from_of_conference")));
|
||||
ParameterModel dateFromParam = new DateParameter(
|
||||
final ParameterModel dateFromParam = new DateParameter(
|
||||
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.addValidationListener(new NotNullValidationListener());
|
||||
dateFrom.addValidationListener(new NotEmptyValidationListener());
|
||||
if (proceedingsConfig.isBeginOfConferenceMandatory()) {
|
||||
dateFrom.addValidationListener(new NotNullValidationListener());
|
||||
dateFrom.addValidationListener(new NotEmptyValidationListener());
|
||||
}
|
||||
add(dateFrom);
|
||||
|
||||
add(new Label(PublicationGlobalizationUtil.globalize(
|
||||
"publications.ui.proceedings.date_to_of_conference")));
|
||||
ParameterModel dateToParam = new DateParameter(
|
||||
final ParameterModel dateToParam = new DateParameter(
|
||||
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.addValidationListener(new NotNullValidationListener());
|
||||
dateTo.addValidationListener(new NotEmptyValidationListener());
|
||||
if (proceedingsConfig.isEndOfConferenceMandatory()) {
|
||||
dateTo.addValidationListener(new NotNullValidationListener());
|
||||
dateTo.addValidationListener(new NotEmptyValidationListener());
|
||||
}
|
||||
add(dateTo);
|
||||
}
|
||||
|
||||
@Override
|
||||
public void init(FormSectionEvent fse) throws FormProcessException {
|
||||
public void init(final FormSectionEvent fse) throws FormProcessException {
|
||||
|
||||
super.init(fse);
|
||||
|
||||
FormData data = fse.getFormData();
|
||||
Proceedings proceedings = (Proceedings) super.initBasicWidgets(fse);
|
||||
final FormData data = fse.getFormData();
|
||||
final Proceedings proceedings = (Proceedings) super.initBasicWidgets(fse);
|
||||
|
||||
data.put(Proceedings.NAME_OF_CONFERENCE,
|
||||
proceedings.getNameOfConference());
|
||||
|
|
@ -125,11 +136,11 @@ public class ProceedingsPropertyForm
|
|||
}
|
||||
|
||||
@Override
|
||||
public void process(FormSectionEvent fse) throws FormProcessException {
|
||||
public void process(final FormSectionEvent fse) throws FormProcessException {
|
||||
super.process(fse);
|
||||
|
||||
FormData data = fse.getFormData();
|
||||
Proceedings proceedings = (Proceedings) super.processBasicWidgets(fse);
|
||||
final FormData data = fse.getFormData();
|
||||
final Proceedings proceedings = (Proceedings) super.processBasicWidgets(fse);
|
||||
|
||||
|
||||
if ((proceedings != null) && getSaveCancelSection().getSaveButton().
|
||||
|
|
|
|||
Loading…
Reference in New Issue