Changes for XML output and converters of proceedings content type necessary because the change from one organizer to multiple organizers
git-svn-id: https://svn.libreccm.org/ccm/trunk@3474 8810af33-2d31-482b-a856-94f89814c4dfmaster
parent
a0e4ecab3e
commit
f4c2d83332
|
|
@ -112,11 +112,6 @@ public class Proceedings extends PublicationWithPublisher {
|
||||||
set(DATE_TO_OF_CONFERENCE, dateTo);
|
set(DATE_TO_OF_CONFERENCE, dateTo);
|
||||||
}
|
}
|
||||||
|
|
||||||
//added by tosmers because of compiling failure
|
|
||||||
public GenericOrganizationalUnit getOrganizerOfConference() {
|
|
||||||
return getProceedingsBundle().getOrganizationalUnits().getOrganizationalUnit();
|
|
||||||
}
|
|
||||||
|
|
||||||
public ProceedingsOrganizerCollection getOrganizers() {
|
public ProceedingsOrganizerCollection getOrganizers() {
|
||||||
return getProceedingsBundle().getOrganizersOfConference();
|
return getProceedingsBundle().getOrganizersOfConference();
|
||||||
}
|
}
|
||||||
|
|
|
||||||
|
|
@ -244,41 +244,4 @@ public class ProceedingsBundle extends PublicationWithPublisherBundle {
|
||||||
remove(ORGANIZER_OF_CONFERENCE, organizer.getGenericOrganizationalUnitBundle());
|
remove(ORGANIZER_OF_CONFERENCE, organizer.getGenericOrganizationalUnitBundle());
|
||||||
}
|
}
|
||||||
|
|
||||||
// public GenericOrganizationalUnitBundle getOrganizerOfConference() {
|
|
||||||
// DataCollection collection;
|
|
||||||
//
|
|
||||||
// collection = (DataCollection) get(ORGANIZER_OF_CONFERENCE);
|
|
||||||
//
|
|
||||||
// if (0 == collection.size()) {
|
|
||||||
// return null;
|
|
||||||
// } else {
|
|
||||||
// DataObject dobj;
|
|
||||||
//
|
|
||||||
// collection.next();
|
|
||||||
// dobj = collection.getDataObject();
|
|
||||||
// collection.close();
|
|
||||||
//
|
|
||||||
// return (GenericOrganizationalUnitBundle) DomainObjectFactory
|
|
||||||
// .newInstance(
|
|
||||||
// dobj);
|
|
||||||
// }
|
|
||||||
// }
|
|
||||||
//
|
|
||||||
// public void setOrganizerOfConference(GenericOrganizationalUnit organizer) {
|
|
||||||
// final GenericOrganizationalUnitBundle 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.getGenericOrganizationalUnitBundle());
|
|
||||||
// link.set("organizerOrder", 1);
|
|
||||||
// link.save();
|
|
||||||
// }
|
|
||||||
// }
|
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
|
||||||
|
|
@ -26,6 +26,7 @@ import com.arsdigita.cms.contenttypes.GenericOrganizationalUnit;
|
||||||
import com.arsdigita.cms.contenttypes.InProceedings;
|
import com.arsdigita.cms.contenttypes.InProceedings;
|
||||||
import com.arsdigita.cms.contenttypes.InProceedingsCollection;
|
import com.arsdigita.cms.contenttypes.InProceedingsCollection;
|
||||||
import com.arsdigita.cms.contenttypes.Proceedings;
|
import com.arsdigita.cms.contenttypes.Proceedings;
|
||||||
|
import com.arsdigita.cms.contenttypes.ProceedingsOrganizerCollection;
|
||||||
import com.arsdigita.cms.dispatcher.SimpleXMLGenerator;
|
import com.arsdigita.cms.dispatcher.SimpleXMLGenerator;
|
||||||
import com.arsdigita.globalization.GlobalizationHelper;
|
import com.arsdigita.globalization.GlobalizationHelper;
|
||||||
import com.arsdigita.xml.Element;
|
import com.arsdigita.xml.Element;
|
||||||
|
|
@ -33,7 +34,8 @@ import com.arsdigita.xml.Element;
|
||||||
/**
|
/**
|
||||||
*
|
*
|
||||||
* @author Jens Pelzetter
|
* @author Jens Pelzetter
|
||||||
* @version $Id$
|
* @version $Id: ProceedingsExtraXmlGenerator.java 3468 2015-06-08 11:09:07Z
|
||||||
|
* jensp $
|
||||||
*/
|
*/
|
||||||
public class ProceedingsExtraXmlGenerator implements ExtraXMLGenerator {
|
public class ProceedingsExtraXmlGenerator implements ExtraXMLGenerator {
|
||||||
|
|
||||||
|
|
@ -50,24 +52,30 @@ public class ProceedingsExtraXmlGenerator implements ExtraXMLGenerator {
|
||||||
}
|
}
|
||||||
|
|
||||||
final Proceedings proceedings = (Proceedings) item;
|
final Proceedings proceedings = (Proceedings) item;
|
||||||
createOrganizerXml(proceedings, element, state);
|
createOrganizersXml(proceedings, element, state);
|
||||||
if (!listMode) {
|
if (!listMode) {
|
||||||
createPapersXml(proceedings, element, state);
|
createPapersXml(proceedings, element, state);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
private void createOrganizerXml(final Proceedings proceedings,
|
private void createOrganizersXml(final Proceedings proceedings,
|
||||||
final Element parent,
|
final Element parent,
|
||||||
final PageState state) {
|
final PageState state) {
|
||||||
// final GenericOrganizationalUnit organizer =
|
final Element organiziersElem = parent.newChildElement("organizers");
|
||||||
// proceedings.getOrganizerOfConference(GlobalizationHelper.
|
|
||||||
// getNegotiatedLocale().getLanguage());
|
final ProceedingsOrganizerCollection organizers = proceedings.
|
||||||
// if (organizer != null) {
|
getOrganizers();
|
||||||
// final XmlGenerator generator = new XmlGenerator(organizer);
|
|
||||||
// generator.setItemElemName("organizer", "");
|
while (organizers.next()) {
|
||||||
// generator.setListMode(true);
|
final GenericOrganizationalUnit organizer = organizers.getOrganizer(
|
||||||
// generator.generateXML(state, parent, "");
|
GlobalizationHelper.getNegotiatedLocale().getLanguage());
|
||||||
// }
|
if (organizer != null) {
|
||||||
|
final XmlGenerator generator = new XmlGenerator(organizer);
|
||||||
|
generator.setItemElemName("organizer", "");
|
||||||
|
generator.setListMode(true);
|
||||||
|
generator.generateXML(state, organiziersElem, "");
|
||||||
|
}
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
private void createPapersXml(final Proceedings proceedings,
|
private void createPapersXml(final Proceedings proceedings,
|
||||||
|
|
|
||||||
|
|
@ -31,6 +31,7 @@ import com.arsdigita.cms.contenttypes.InternetArticle;
|
||||||
import com.arsdigita.cms.contenttypes.Journal;
|
import com.arsdigita.cms.contenttypes.Journal;
|
||||||
import com.arsdigita.cms.contenttypes.Monograph;
|
import com.arsdigita.cms.contenttypes.Monograph;
|
||||||
import com.arsdigita.cms.contenttypes.Proceedings;
|
import com.arsdigita.cms.contenttypes.Proceedings;
|
||||||
|
import com.arsdigita.cms.contenttypes.ProceedingsOrganizerCollection;
|
||||||
import com.arsdigita.cms.contenttypes.Publication;
|
import com.arsdigita.cms.contenttypes.Publication;
|
||||||
import com.arsdigita.cms.contenttypes.PublicationWithPublisher;
|
import com.arsdigita.cms.contenttypes.PublicationWithPublisher;
|
||||||
import com.arsdigita.cms.contenttypes.Publisher;
|
import com.arsdigita.cms.contenttypes.Publisher;
|
||||||
|
|
@ -107,7 +108,6 @@ public class PublicationXmlHelper {
|
||||||
/*if (publication instanceof Journal) {
|
/*if (publication instanceof Journal) {
|
||||||
generateJournalXml(publicationElem);
|
generateJournalXml(publicationElem);
|
||||||
}*/
|
}*/
|
||||||
|
|
||||||
if (publication instanceof Monograph) {
|
if (publication instanceof Monograph) {
|
||||||
generateMonographXml(publicationElem);
|
generateMonographXml(publicationElem);
|
||||||
}
|
}
|
||||||
|
|
@ -217,8 +217,8 @@ public class PublicationXmlHelper {
|
||||||
|
|
||||||
private void generatePublicationWithPublisherXml(
|
private void generatePublicationWithPublisherXml(
|
||||||
final Element publicationElem) {
|
final Element publicationElem) {
|
||||||
PublicationWithPublisher pwp =
|
PublicationWithPublisher pwp
|
||||||
(PublicationWithPublisher) publication;
|
= (PublicationWithPublisher) publication;
|
||||||
generatePublisherXml(publicationElem, pwp);
|
generatePublisherXml(publicationElem, pwp);
|
||||||
|
|
||||||
generateXmlElement(publicationElem, "isbn", pwp.getISBN());
|
generateXmlElement(publicationElem, "isbn", pwp.getISBN());
|
||||||
|
|
@ -258,7 +258,7 @@ public class PublicationXmlHelper {
|
||||||
|
|
||||||
final SeriesCollection series = publication.getSeries();
|
final SeriesCollection series = publication.getSeries();
|
||||||
|
|
||||||
while(series.next()) {
|
while (series.next()) {
|
||||||
generateSeriesXml(publicationElem, series.getSeries());
|
generateSeriesXml(publicationElem, series.getSeries());
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
@ -274,8 +274,8 @@ public class PublicationXmlHelper {
|
||||||
|
|
||||||
private void generateArticleInCollectedVolumeXml(
|
private void generateArticleInCollectedVolumeXml(
|
||||||
final Element publicationElem) {
|
final Element publicationElem) {
|
||||||
final ArticleInCollectedVolume article =
|
final ArticleInCollectedVolume article
|
||||||
(ArticleInCollectedVolume) publication;
|
= (ArticleInCollectedVolume) publication;
|
||||||
|
|
||||||
generateXmlElement(publicationElem, "pagesFrom", article.getPagesFrom());
|
generateXmlElement(publicationElem, "pagesFrom", article.getPagesFrom());
|
||||||
generateXmlElement(publicationElem, "pagesTo", article.getPagesTo());
|
generateXmlElement(publicationElem, "pagesTo", article.getPagesTo());
|
||||||
|
|
@ -292,8 +292,8 @@ public class PublicationXmlHelper {
|
||||||
if (collectedVolume != null) {
|
if (collectedVolume != null) {
|
||||||
Element collectedVolumeElem = publicationElem.newChildElement(
|
Element collectedVolumeElem = publicationElem.newChildElement(
|
||||||
"collectedVolume");
|
"collectedVolume");
|
||||||
PublicationXmlHelper xmlHelper =
|
PublicationXmlHelper xmlHelper
|
||||||
new PublicationXmlHelper(collectedVolumeElem,
|
= new PublicationXmlHelper(collectedVolumeElem,
|
||||||
collectedVolume);
|
collectedVolume);
|
||||||
xmlHelper.generateXml(false);
|
xmlHelper.generateXml(false);
|
||||||
}
|
}
|
||||||
|
|
@ -316,7 +316,8 @@ public class PublicationXmlHelper {
|
||||||
final Journal journal = article.getJournal();
|
final Journal journal = article.getJournal();
|
||||||
|
|
||||||
if (journal != null) {
|
if (journal != null) {
|
||||||
final Element journalElem = publicationElem.newChildElement("journal");
|
final Element journalElem = publicationElem.newChildElement(
|
||||||
|
"journal");
|
||||||
//PublicationXmlHelper xmlHelper = new PublicationXmlHelper(
|
//PublicationXmlHelper xmlHelper = new PublicationXmlHelper(
|
||||||
// journalElem,
|
// journalElem,
|
||||||
// journal);
|
// journal);
|
||||||
|
|
@ -397,7 +398,6 @@ public class PublicationXmlHelper {
|
||||||
generateXmlElement(publicationElem, "lastYear", journal.getLastYear());
|
generateXmlElement(publicationElem, "lastYear", journal.getLastYear());
|
||||||
generateXmlElement(publicationElem, "issn", journal.getISSN());
|
generateXmlElement(publicationElem, "issn", journal.getISSN());
|
||||||
}*/
|
}*/
|
||||||
|
|
||||||
private void generateMonographXml(final Element publicationElem) {
|
private void generateMonographXml(final Element publicationElem) {
|
||||||
final Monograph monograph = (Monograph) publication;
|
final Monograph monograph = (Monograph) publication;
|
||||||
|
|
||||||
|
|
@ -414,9 +414,9 @@ public class PublicationXmlHelper {
|
||||||
"placeOfConference",
|
"placeOfConference",
|
||||||
proceedings.getPlaceOfConference());
|
proceedings.getPlaceOfConference());
|
||||||
|
|
||||||
generateOrganizationXml(publicationElem,
|
generateOrganizersXml(publicationElem,
|
||||||
"organizer",
|
"organizers",
|
||||||
proceedings.getOrganizerOfConference());
|
proceedings.getOrganizers());
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
@ -446,6 +446,20 @@ public class PublicationXmlHelper {
|
||||||
workingPaper.getReviewed());
|
workingPaper.getReviewed());
|
||||||
}
|
}
|
||||||
|
|
||||||
|
private void generateOrganizersXml(
|
||||||
|
final Element publicationElem,
|
||||||
|
final String elementName,
|
||||||
|
final ProceedingsOrganizerCollection organizers) {
|
||||||
|
|
||||||
|
final Element elem = publicationElem.newChildElement(elementName);
|
||||||
|
|
||||||
|
while(organizers.next()) {
|
||||||
|
final GenericOrganizationalUnit orgaUnit = organizers.getOrganizer();
|
||||||
|
|
||||||
|
generateOrganizationXml(elem, "organizer", orgaUnit);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
private void generateOrganizationXml(final Element publicationElem,
|
private void generateOrganizationXml(final Element publicationElem,
|
||||||
final String elementName,
|
final String elementName,
|
||||||
final GenericOrganizationalUnit orga) {
|
final GenericOrganizationalUnit orga) {
|
||||||
|
|
@ -453,8 +467,8 @@ public class PublicationXmlHelper {
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
|
||||||
Element organizationElem =
|
Element organizationElem
|
||||||
publicationElem.newChildElement(elementName);
|
= publicationElem.newChildElement(elementName);
|
||||||
Element orgaTitleElem = organizationElem.newChildElement("title");
|
Element orgaTitleElem = organizationElem.newChildElement("title");
|
||||||
orgaTitleElem.setText(orga.getTitle());
|
orgaTitleElem.setText(orga.getTitle());
|
||||||
|
|
||||||
|
|
|
||||||
|
|
@ -17,8 +17,10 @@
|
||||||
*
|
*
|
||||||
*/package com.arsdigita.cms.scipublications.exporter.bibtex.converters;
|
*/package com.arsdigita.cms.scipublications.exporter.bibtex.converters;
|
||||||
|
|
||||||
|
import com.arsdigita.cms.contenttypes.GenericOrganizationalUnit;
|
||||||
import com.arsdigita.cms.contenttypes.InProceedings;
|
import com.arsdigita.cms.contenttypes.InProceedings;
|
||||||
import com.arsdigita.cms.contenttypes.Proceedings;
|
import com.arsdigita.cms.contenttypes.Proceedings;
|
||||||
|
import com.arsdigita.cms.contenttypes.ProceedingsOrganizerCollection;
|
||||||
import com.arsdigita.cms.contenttypes.Publication;
|
import com.arsdigita.cms.contenttypes.Publication;
|
||||||
import com.arsdigita.cms.scipublications.exporter.bibtex.builders.BibTeXBuilder;
|
import com.arsdigita.cms.scipublications.exporter.bibtex.builders.BibTeXBuilder;
|
||||||
import com.arsdigita.cms.scipublications.exporter.bibtex.builders.BibTeXField;
|
import com.arsdigita.cms.scipublications.exporter.bibtex.builders.BibTeXField;
|
||||||
|
|
@ -87,9 +89,16 @@ public class InProceedingsConverter extends AbstractBibTeXConverter {
|
||||||
convertVolume(proceedings);
|
convertVolume(proceedings);
|
||||||
convertSeries(proceedings);
|
convertSeries(proceedings);
|
||||||
|
|
||||||
if (proceedings.getOrganizerOfConference() != null) {
|
if (proceedings.getOrganizers() != null
|
||||||
|
&& !proceedings.getOrganizers().isEmpty()) {
|
||||||
|
final ProceedingsOrganizerCollection organizers = proceedings.
|
||||||
|
getOrganizers();
|
||||||
|
organizers.next();
|
||||||
|
final GenericOrganizationalUnit organizer = organizers.
|
||||||
|
getOrganizer();
|
||||||
|
organizers.close();
|
||||||
builder.setField(BibTeXField.ORGANIZATION,
|
builder.setField(BibTeXField.ORGANIZATION,
|
||||||
proceedings.getOrganizerOfConference().getTitle());
|
organizer.getTitle());
|
||||||
}
|
}
|
||||||
|
|
||||||
convertPublisher(proceedings);
|
convertPublisher(proceedings);
|
||||||
|
|
|
||||||
|
|
@ -18,7 +18,9 @@
|
||||||
*/
|
*/
|
||||||
package com.arsdigita.cms.scipublications.exporter.bibtex.converters;
|
package com.arsdigita.cms.scipublications.exporter.bibtex.converters;
|
||||||
|
|
||||||
|
import com.arsdigita.cms.contenttypes.GenericOrganizationalUnit;
|
||||||
import com.arsdigita.cms.contenttypes.Proceedings;
|
import com.arsdigita.cms.contenttypes.Proceedings;
|
||||||
|
import com.arsdigita.cms.contenttypes.ProceedingsOrganizerCollection;
|
||||||
import com.arsdigita.cms.contenttypes.Publication;
|
import com.arsdigita.cms.contenttypes.Publication;
|
||||||
import com.arsdigita.cms.scipublications.exporter.bibtex.builders.BibTeXBuilder;
|
import com.arsdigita.cms.scipublications.exporter.bibtex.builders.BibTeXBuilder;
|
||||||
import com.arsdigita.cms.scipublications.exporter.bibtex.builders.BibTeXField;
|
import com.arsdigita.cms.scipublications.exporter.bibtex.builders.BibTeXField;
|
||||||
|
|
@ -71,10 +73,16 @@ public class ProceedingsConverter extends AbstractBibTeXConverter {
|
||||||
convertVolume(proceedings);
|
convertVolume(proceedings);
|
||||||
convertSeries(publication);
|
convertSeries(publication);
|
||||||
|
|
||||||
if (proceedings.getOrganizerOfConference() != null) {
|
if (proceedings.getOrganizers() != null
|
||||||
|
&& !proceedings.getOrganizers().isEmpty()) {
|
||||||
|
final ProceedingsOrganizerCollection organizers = proceedings.
|
||||||
|
getOrganizers();
|
||||||
|
organizers.next();
|
||||||
|
final GenericOrganizationalUnit organizer = organizers.
|
||||||
|
getOrganizer();
|
||||||
|
organizers.close();
|
||||||
builder.setField(BibTeXField.ORGANIZATION,
|
builder.setField(BibTeXField.ORGANIZATION,
|
||||||
proceedings.getOrganizerOfConference().
|
organizer.getTitle());
|
||||||
getTitle());
|
|
||||||
}
|
}
|
||||||
|
|
||||||
convertPublisher(proceedings);
|
convertPublisher(proceedings);
|
||||||
|
|
|
||||||
Loading…
Reference in New Issue