diff --git a/ccm-sci-publications/src/META-INF/services/com.arsdigita.cms.scipublications.exporter.SciPublicationsExporter b/ccm-sci-publications/src/META-INF/services/com.arsdigita.cms.scipublications.exporter.SciPublicationsExporter
index eb234126a..bc2c5bffb 100644
--- a/ccm-sci-publications/src/META-INF/services/com.arsdigita.cms.scipublications.exporter.SciPublicationsExporter
+++ b/ccm-sci-publications/src/META-INF/services/com.arsdigita.cms.scipublications.exporter.SciPublicationsExporter
@@ -1 +1,2 @@
- com.arsdigita.cms.scipublications.exporter.bibtex.BibTeXExporter
\ No newline at end of file
+ com.arsdigita.cms.scipublications.exporter.bibtex.BibTeXExporter
+ com.arsdigita.cms.scipublications.exporter.ris.RisExporter
\ No newline at end of file
diff --git a/ccm-sci-publications/src/META-INF/services/com.arsdigita.cms.scipublications.exporter.ris.RisConverter b/ccm-sci-publications/src/META-INF/services/com.arsdigita.cms.scipublications.exporter.ris.RisConverter
new file mode 100644
index 000000000..5fc2e0163
--- /dev/null
+++ b/ccm-sci-publications/src/META-INF/services/com.arsdigita.cms.scipublications.exporter.ris.RisConverter
@@ -0,0 +1,13 @@
+com.arsdigita.cms.scipublications.exporter.ris.ArticleInCollectedVolumeConverter
+com.arsdigita.cms.scipublications.exporter.ris.ArticleInJournalConverter
+com.arsdigita.cms.scipublications.exporter.ris.CollectedVolumeConverter
+com.arsdigita.cms.scipublications.exporter.ris.ExpertiseConverter
+com.arsdigita.cms.scipublications.exporter.ris.GreyLiteratureConverter
+com.arsdigita.cms.scipublications.exporter.ris.InProceedingsConverter
+com.arsdigita.cms.scipublications.exporter.ris.InternetArticleConverter
+com.arsdigita.cms.scipublications.exporter.ris.MonographConverter
+com.arsdigita.cms.scipublications.exporter.ris.ProceedingsConverter
+com.arsdigita.cms.scipublications.exporter.ris.PublicationConverter
+com.arsdigita.cms.scipublications.exporter.ris.PublicationWithPublisherConverter
+com.arsdigita.cms.scipublications.exporter.ris.ReviewConverter
+com.arsdigita.cms.scipublications.exporter.ris.WorkingPaperConverter
\ No newline at end of file
diff --git a/ccm-sci-publications/src/com/arsdigita/cms/scipublications/SciPublications.java b/ccm-sci-publications/src/com/arsdigita/cms/scipublications/SciPublications.java
index e18364e25..93cbe0685 100644
--- a/ccm-sci-publications/src/com/arsdigita/cms/scipublications/SciPublications.java
+++ b/ccm-sci-publications/src/com/arsdigita/cms/scipublications/SciPublications.java
@@ -1,3 +1,22 @@
+/*
+ * Copyright (c) 2010 Jens Pelzetter,
+ * for the Center of Social Politics of the University of Bremen
+ *
+ * This library is free software; you can redistribute it and/or
+ * modify it under the terms of the GNU Lesser General Public License
+ * as published by the Free Software Foundation; either version 2.1 of
+ * the License, or (at your option) any later version.
+ *
+ * This library is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+ * Lesser General Public License for more details.
+ *
+ * You should have received a copy of the GNU Lesser General Public
+ * License along with this library; if not, write to the Free Software
+ * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
+ *
+ */
package com.arsdigita.cms.scipublications;
import com.arsdigita.domain.DataObjectNotFoundException;
@@ -7,18 +26,25 @@ import com.arsdigita.web.Application;
import java.math.BigDecimal;
/**
+ * This application provides the main entry point for all functions of
+ * the SciPublications module. The application will be mounted at
+ * /ccm/scipubliations/. The functions are accessed using
+ * an additional URL fragment. For example, if you want to access the
+ * export function, you will use the URL
+ * /ccm/scipublications/export/.
*
* @author Jens Pelzetter
*/
public class SciPublications extends Application {
- public static final String BASE_DATA_OBJECT_TYPE = "com.arsdigita.cms.scipublications.SciPublications";
+ public static final String BASE_DATA_OBJECT_TYPE =
+ "com.arsdigita.cms.scipublications.SciPublications";
- public SciPublications(DataObject dobj) {
+ public SciPublications(DataObject dobj) {
super(dobj);
}
- public SciPublications(OID oid) throws DataObjectNotFoundException{
+ public SciPublications(OID oid) throws DataObjectNotFoundException {
super(oid);
}
@@ -30,5 +56,4 @@ public class SciPublications extends Application {
public String getServletPath() {
return "/scipublications/";
}
-
}
diff --git a/ccm-sci-publications/src/com/arsdigita/cms/scipublications/SciPublicationsLoader.java b/ccm-sci-publications/src/com/arsdigita/cms/scipublications/SciPublicationsLoader.java
index deec5dc0f..52dc5c273 100644
--- a/ccm-sci-publications/src/com/arsdigita/cms/scipublications/SciPublicationsLoader.java
+++ b/ccm-sci-publications/src/com/arsdigita/cms/scipublications/SciPublicationsLoader.java
@@ -49,6 +49,7 @@ public class SciPublicationsLoader extends PackageLoader {
ApplicationType type = setup.run();
type.save();
+ //Install the application and mount the app at 'scipublications'.
if (!Application.isInstalled(
SciPublications.BASE_DATA_OBJECT_TYPE, "/scipublications/")) {
Application app = Application.createApplication(type,
diff --git a/ccm-sci-publications/src/com/arsdigita/cms/scipublications/SciPublicationsServlet.java b/ccm-sci-publications/src/com/arsdigita/cms/scipublications/SciPublicationsServlet.java
index b3073b686..140bae10e 100644
--- a/ccm-sci-publications/src/com/arsdigita/cms/scipublications/SciPublicationsServlet.java
+++ b/ccm-sci-publications/src/com/arsdigita/cms/scipublications/SciPublicationsServlet.java
@@ -1,6 +1,24 @@
+/*
+ * Copyright (c) 2010 Jens Pelzetter,
+ * for the Center of Social Politics of the University of Bremen
+ *
+ * This library is free software; you can redistribute it and/or
+ * modify it under the terms of the GNU Lesser General Public License
+ * as published by the Free Software Foundation; either version 2.1 of
+ * the License, or (at your option) any later version.
+ *
+ * This library is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+ * Lesser General Public License for more details.
+ *
+ * You should have received a copy of the GNU Lesser General Public
+ * License along with this library; if not, write to the Free Software
+ * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
+ *
+ */
package com.arsdigita.cms.scipublications;
-import com.arsdigita.categorization.Categorization;
import com.arsdigita.categorization.CategorizedCollection;
import com.arsdigita.categorization.Category;
import com.arsdigita.cms.ContentBundle;
@@ -24,6 +42,43 @@ import javax.servlet.http.HttpServletResponse;
import org.apache.log4j.Logger;
/**
+ *
+ * The SciPublicationsServlet processes the
+ * {@link HttpServletRequest} and calls the requested actions.
+ * The available actions are:
+ *
export
+ * The export action exports content items of the type
+ * {@link Publication} in several formats, like BibTeX or RIS.
+ * The export action has the following query parameters:
+ *
formatpublicationcategory
+ * The format argument is mandatory. Also their must be either one
+ * or more publication parameters or a category
+ * parameter. If the URL is not valid, the Servlet will respond with the
+ * BAD_REQUEST (400) HTTP status code. If one of the specified publications or
+ * the specified category can't be found, the Servlet will respond with the
+ * NOT_FOUND (404) HTTP status code.
+ *
null, if
+ * there is no exporter which supports the specified format.
+ */
public SciPublicationsExporter getExporterForFormat(final String format) {
return exporters.get(format);
}
+ /**
+ *
+ * @return A list of all supported export formats.
+ */
public Listcom.arsdigita.cms.scipublications.exporter.bibtex which
+ * are implementation the {@link BibTeXConverter} interface.
*
- * @author jensp
+ * @author Jens Pelzetter
*/
public class BibTeXExporter implements SciPublicationsExporter {
diff --git a/ccm-sci-publications/src/com/arsdigita/cms/scipublications/exporter/bibtex/builders/AbstractBibTeXBuilder.java b/ccm-sci-publications/src/com/arsdigita/cms/scipublications/exporter/bibtex/builders/AbstractBibTeXBuilder.java
index 4cf445c67..5bc29e4a9 100644
--- a/ccm-sci-publications/src/com/arsdigita/cms/scipublications/exporter/bibtex/builders/AbstractBibTeXBuilder.java
+++ b/ccm-sci-publications/src/com/arsdigita/cms/scipublications/exporter/bibtex/builders/AbstractBibTeXBuilder.java
@@ -81,7 +81,7 @@ public abstract class AbstractBibTeXBuilder implements BibTeXBuilder {
builder);
}
- builder.append('}');
+ builder.append("}\n");
return builder.toString();
}
diff --git a/ccm-sci-publications/src/com/arsdigita/cms/scipublications/exporter/bibtex/converters/AbstractBibTeXConverter.java b/ccm-sci-publications/src/com/arsdigita/cms/scipublications/exporter/bibtex/converters/AbstractBibTeXConverter.java
index 178fc482c..e0e7b679f 100644
--- a/ccm-sci-publications/src/com/arsdigita/cms/scipublications/exporter/bibtex/converters/AbstractBibTeXConverter.java
+++ b/ccm-sci-publications/src/com/arsdigita/cms/scipublications/exporter/bibtex/converters/AbstractBibTeXConverter.java
@@ -1,3 +1,22 @@
+/*
+ * Copyright (c) 2010 Jens Pelzetter,
+ * for the Center of Social Politics of the University of Bremen
+ *
+ * This library is free software; you can redistribute it and/or
+ * modify it under the terms of the GNU Lesser General Public License
+ * as published by the Free Software Foundation; either version 2.1 of
+ * the License, or (at your option) any later version.
+ *
+ * This library is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+ * Lesser General Public License for more details.
+ *
+ * You should have received a copy of the GNU Lesser General Public
+ * License along with this library; if not, write to the Free Software
+ * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
+ *
+ */
package com.arsdigita.cms.scipublications.exporter.bibtex.converters;
import com.arsdigita.cms.contenttypes.AuthorshipCollection;
@@ -10,13 +29,21 @@ import com.arsdigita.cms.scipublications.exporter.bibtex.builders.BibTeXField;
import com.arsdigita.cms.scipublications.exporter.bibtex.builders.UnsupportedFieldException;
/**
+ * An abstract implementation of the {@link BibTeXConverter} providing common
+ * functionality for all converters. To create the BibTeX data, implementations
+ * of the {@link BibTeXBuilder} interface are used.
*
- * @author jensp
+ * @author Jens Pelzetter
*/
public abstract class AbstractBibTeXConverter implements BibTeXConverter {
private BibTeXBuilder bibTeXBuilder;
+ /**
+ * Convert the authors of a publication to BibTeX.
+ *
+ * @param publication The publication to use.
+ */
protected void convertAuthors(final Publication publication) {
AuthorshipCollection authors;
@@ -32,11 +59,24 @@ public abstract class AbstractBibTeXConverter implements BibTeXConverter {
}
}
+ /**
+ * Convert the title of a publication to BibTeX.
+ *
+ * @param publication The publication to use.
+ * @throws UnsupportedFieldException If the title field is not supported by
+ * the BibTeX type.
+ */
protected void convertTitle(final Publication publication)
throws UnsupportedFieldException {
getBibTeXBuilder().setField(BibTeXField.TITLE, publication.getTitle());
}
+ /**
+ * Converts the year of publication to BibTeX.
+ *
+ * @param publication
+ * @throws UnsupportedFieldException
+ */
protected void convertYear(final Publication publication)
throws UnsupportedFieldException {
if (publication.getYearOfPublication() != null) {
@@ -46,6 +86,12 @@ public abstract class AbstractBibTeXConverter implements BibTeXConverter {
}
}
+ /**
+ * Converts the publisher to BibTeX.
+ *
+ * @param publication
+ * @throws UnsupportedFieldException
+ */
protected void convertPublisher(final PublicationWithPublisher publication)
throws UnsupportedFieldException {
if (publication.getPublisher() != null) {
@@ -66,6 +112,12 @@ public abstract class AbstractBibTeXConverter implements BibTeXConverter {
}
}
+ /**
+ * Convert the ISBN to BibTeX.
+ *
+ * @param publication
+ * @throws UnsupportedFieldException
+ */
protected void convertISBN(final PublicationWithPublisher publication)
throws UnsupportedFieldException {
if (publication.getISBN() != null) {
@@ -74,6 +126,12 @@ public abstract class AbstractBibTeXConverter implements BibTeXConverter {
}
}
+ /**
+ * Convert the volume to BibTeX.
+ *
+ * @param publication
+ * @throws UnsupportedFieldException
+ */
protected void convertVolume(final PublicationWithPublisher publication)
throws UnsupportedFieldException {
if (publication.getVolume() != null) {
@@ -82,6 +140,12 @@ public abstract class AbstractBibTeXConverter implements BibTeXConverter {
}
}
+ /**
+ * Convert the edition to BibTeX.
+ *
+ * @param publication
+ * @throws UnsupportedFieldException
+ */
protected void convertEdition(final PublicationWithPublisher publication)
throws UnsupportedFieldException {
if (publication.getEdition() != null) {
@@ -90,10 +154,15 @@ public abstract class AbstractBibTeXConverter implements BibTeXConverter {
}
}
+ /**
+ * Convert the series to BibTeX.
+ *
+ * @param publication
+ * @throws UnsupportedFieldException
+ */
protected void convertSeries(final Publication publication)
throws UnsupportedFieldException {
- SeriesCollection seriesColl =
- publication.getSeries();
+ SeriesCollection seriesColl = publication.getSeries();
if ((seriesColl != null) && (seriesColl.size() > 0)) {
seriesColl.next();
@@ -105,6 +174,12 @@ public abstract class AbstractBibTeXConverter implements BibTeXConverter {
}
}
+ /**
+ * Retrieves to BibTeX builder for the converter. Uses the implementation
+ * of {@link #getBibTeXType()} for get the BibTeX type.
+ *
+ * @return The BibTeX builder for the converter.
+ */
protected BibTeXBuilder getBibTeXBuilder() {
if (bibTeXBuilder == null) {
bibTeXBuilder = BibTeXBuilders.getInstance().
@@ -114,5 +189,9 @@ public abstract class AbstractBibTeXConverter implements BibTeXConverter {
return bibTeXBuilder;
}
+ /**
+ *
+ * @return The BibTeX type to use for building the BibTeX data.
+ */
protected abstract String getBibTeXType();
}
diff --git a/ccm-sci-publications/src/com/arsdigita/cms/scipublications/exporter/bibtex/converters/ArticleInCollectedVolumeConverter.java b/ccm-sci-publications/src/com/arsdigita/cms/scipublications/exporter/bibtex/converters/ArticleInCollectedVolumeConverter.java
index b5f5b5592..fd25579bf 100644
--- a/ccm-sci-publications/src/com/arsdigita/cms/scipublications/exporter/bibtex/converters/ArticleInCollectedVolumeConverter.java
+++ b/ccm-sci-publications/src/com/arsdigita/cms/scipublications/exporter/bibtex/converters/ArticleInCollectedVolumeConverter.java
@@ -54,6 +54,10 @@ public class ArticleInCollectedVolumeConverter extends AbstractBibTeXConverter {
if (article.getCollectedVolume().getPublisher() == null) {
builder.setField(BibTeXField.PUBLISHER, "");
+ } else {
+ builder.setField(BibTeXField.PUBLISHER,
+ article.getCollectedVolume().getPublisher().
+ getTitle());
}
if (article.getCollectedVolume().getVolume() != null) {
@@ -61,6 +65,12 @@ public class ArticleInCollectedVolumeConverter extends AbstractBibTeXConverter {
article.getCollectedVolume().getVolume().
toString());
}
+
+ if (article.getCollectedVolume().getEdition() != null) {
+ builder.setField(BibTeXField.EDITION,
+ article.getCollectedVolume().getEdition());
+ }
+
SeriesCollection seriesColl =
article.getCollectedVolume().getSeries();
if ((seriesColl != null) && (seriesColl.size() > 0)) {
@@ -72,13 +82,8 @@ public class ArticleInCollectedVolumeConverter extends AbstractBibTeXConverter {
seriesColl.close();
}
- } else {
- builder.setField(BibTeXField.PUBLISHER,
- article.getCollectedVolume().getPublisher().
- getTitle());
}
-
if (article.getChapter() != null) {
builder.setField(BibTeXField.CHAPTER, article.getChapter());
}
@@ -90,10 +95,7 @@ public class ArticleInCollectedVolumeConverter extends AbstractBibTeXConverter {
article.getPagesTo()));
}
- if (article.getCollectedVolume().getEdition() != null) {
- builder.setField(BibTeXField.EDITION,
- article.getCollectedVolume().getEdition());
- }
+
} catch (UnsupportedFieldException ex) {
logger.warn("Tried to set unsupported BibTeX field while "
+ "converting a publication");
diff --git a/ccm-sci-publications/src/com/arsdigita/cms/scipublications/exporter/bibtex/converters/BibTeXConverter.java b/ccm-sci-publications/src/com/arsdigita/cms/scipublications/exporter/bibtex/converters/BibTeXConverter.java
index 0e190cdd8..93cabbf9e 100644
--- a/ccm-sci-publications/src/com/arsdigita/cms/scipublications/exporter/bibtex/converters/BibTeXConverter.java
+++ b/ccm-sci-publications/src/com/arsdigita/cms/scipublications/exporter/bibtex/converters/BibTeXConverter.java
@@ -1,15 +1,45 @@
+/*
+ * Copyright (c) 2010 Jens Pelzetter,
+ * for the Center of Social Politics of the University of Bremen
+ *
+ * This library is free software; you can redistribute it and/or
+ * modify it under the terms of the GNU Lesser General Public License
+ * as published by the Free Software Foundation; either version 2.1 of
+ * the License, or (at your option) any later version.
+ *
+ * This library is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+ * Lesser General Public License for more details.
+ *
+ * You should have received a copy of the GNU Lesser General Public
+ * License along with this library; if not, write to the Free Software
+ * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
+ *
+ */
package com.arsdigita.cms.scipublications.exporter.bibtex.converters;
import com.arsdigita.cms.contenttypes.Publication;
/**
+ * Interface for the BibTeX converters.
*
- * @param com.arsdigita.cms.scipublications.exporter.bibtex package
+ * provides an exporter for the BibTeX format.
+ */
+package com.arsdigita.cms.scipublications.exporter.bibtex;
diff --git a/ccm-sci-publications/src/com/arsdigita/cms/scipublications/exporter/ris/AbstractRisConverter.java b/ccm-sci-publications/src/com/arsdigita/cms/scipublications/exporter/ris/AbstractRisConverter.java
new file mode 100644
index 000000000..3a98dfc73
--- /dev/null
+++ b/ccm-sci-publications/src/com/arsdigita/cms/scipublications/exporter/ris/AbstractRisConverter.java
@@ -0,0 +1,123 @@
+/*
+ * Copyright (c) 2010 Jens Pelzetter,
+ * for the Center of Social Politics of the University of Bremen
+ *
+ * This library is free software; you can redistribute it and/or
+ * modify it under the terms of the GNU Lesser General Public License
+ * as published by the Free Software Foundation; either version 2.1 of
+ * the License, or (at your option) any later version.
+ *
+ * This library is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+ * Lesser General Public License for more details.
+ *
+ * You should have received a copy of the GNU Lesser General Public
+ * License along with this library; if not, write to the Free Software
+ * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
+ *
+ */
+package com.arsdigita.cms.scipublications.exporter.ris;
+
+import com.arsdigita.cms.contenttypes.AuthorshipCollection;
+import com.arsdigita.cms.contenttypes.Publication;
+import com.arsdigita.cms.contenttypes.PublicationWithPublisher;
+import com.arsdigita.cms.contenttypes.SeriesCollection;
+
+/**
+ * An abstract base implementation of the {@link RisConverter} interface
+ * providing common functionality.
+ *
+ * @author Jens Pelzetter
+ */
+public abstract class AbstractRisConverter implements RisConverter {
+
+ private RisBuilder risBuilder = new RisBuilder();
+
+ protected void convertAuthors(final Publication publication) {
+ AuthorshipCollection authors;
+
+ authors = publication.getAuthors();
+ if (authors != null) {
+ while (authors.next()) {
+ if (authors.isEditor()) {
+ getRisBuilder().addField(RisFields.AU,
+ String.format("%s,%s",
+ authors.getAuthor().
+ getSurname(),
+ authors.getAuthor().
+ getGivenName()));
+ } else {
+ getRisBuilder().addField(RisFields.ED,
+ String.format("%s,%s",
+ authors.getAuthor().
+ getSurname(),
+ authors.getAuthor().
+ getGivenName()));
+ }
+ }
+ }
+ }
+
+ protected void convertTitle(final Publication publication) {
+ getRisBuilder().addField(RisFields.TI,
+ publication.getTitle());
+ }
+
+ protected void convertYear(final Publication publication) {
+ getRisBuilder().addField(RisFields.PY,
+ String.format("%d///", publication.
+ getYearOfPublication()));
+ }
+
+ protected void convertPublisher(final PublicationWithPublisher publication) {
+ if (publication.getPublisher() != null) {
+ if ((publication.getPublisher().getPlace() != null)
+ && !(publication.getPublisher().getPlace().isEmpty())) {
+ getRisBuilder().addField(RisFields.CY,
+ publication.getPublisher().getPlace());
+ }
+
+ getRisBuilder().addField(RisFields.PB,
+ publication.getPublisher().getTitle());
+ }
+ }
+
+ protected void convertISBN(final PublicationWithPublisher publication) {
+ if (publication.getISBN() != null) {
+ getRisBuilder().addField(RisFields.SN,
+ publication.getISBN());
+ }
+ }
+
+ protected void convertVolume(final PublicationWithPublisher publication) {
+ if (publication.getVolume() != null) {
+ getRisBuilder().addField(RisFields.VL,
+ publication.getVolume().toString());
+ }
+ }
+
+ protected void convertEdition(final PublicationWithPublisher publication) {
+ if (publication.getEdition() != null) {
+ getRisBuilder().addField(RisFields.ET,
+ publication.getEdition());
+ }
+ }
+
+ protected void convertSeries(final Publication publication) {
+ SeriesCollection seriesColl = publication.getSeries();
+ if ((seriesColl != null) && (seriesColl.size() > 0)) {
+
+ seriesColl.next();
+
+ getRisBuilder().addField(RisFields.T3,
+ seriesColl.getSeries().getTitle());
+
+ seriesColl.close();
+ }
+ }
+
+ protected RisBuilder getRisBuilder() {
+ return risBuilder;
+ }
+}
diff --git a/ccm-sci-publications/src/com/arsdigita/cms/scipublications/exporter/ris/ArticleInCollectedVolumeConverter.java b/ccm-sci-publications/src/com/arsdigita/cms/scipublications/exporter/ris/ArticleInCollectedVolumeConverter.java
new file mode 100644
index 000000000..ebae2457f
--- /dev/null
+++ b/ccm-sci-publications/src/com/arsdigita/cms/scipublications/exporter/ris/ArticleInCollectedVolumeConverter.java
@@ -0,0 +1,55 @@
+package com.arsdigita.cms.scipublications.exporter.ris;
+
+import com.arsdigita.cms.contenttypes.ArticleInCollectedVolume;
+import com.arsdigita.cms.contenttypes.Publication;
+
+/**
+ *
+ * @author jensp
+ */
+public class ArticleInCollectedVolumeConverter extends AbstractRisConverter {
+
+ public String convert(final Publication publication) {
+ ArticleInCollectedVolume article;
+
+ if (!(publication instanceof ArticleInCollectedVolume)) {
+ throw new UnsupportedCcmTypeException(
+ String.format("The ArticleInCollectedVolumeConverter only "
+ + "supports publication types which are of the"
+ + "type ArticleInCollectedVolume or which are "
+ + "extending "
+ + "ArticleInCollectedVolume. The "
+ + "provided publication is of type '%s' which "
+ + "is not of type "
+ + "ArticleInCollectedVolume and does not "
+ + "extends ArticleInCollectedVolume.",
+ publication.getClass().getName()));
+ }
+
+ article = (ArticleInCollectedVolume) publication;
+
+ getRisBuilder().setType(RisTypes.CHAP);
+ convertAuthors(publication);
+ convertTitle(publication);
+ convertYear(publication);
+
+ if (article.getCollectedVolume() != null) {
+ getRisBuilder().addField(RisFields.BT,
+ article.getCollectedVolume().getTitle());
+
+ }
+
+ if (article.getPagesFrom() != null) {
+ getRisBuilder().addField(RisFields.SP,
+ article.getPagesFrom().toString());
+ getRisBuilder().addField(RisFields.EP,
+ article.getPagesTo().toString());
+ }
+
+ return getRisBuilder().toRis();
+ }
+
+ public String getCcmType() {
+ return ArticleInCollectedVolume.class.getName();
+ }
+}
diff --git a/ccm-sci-publications/src/com/arsdigita/cms/scipublications/exporter/ris/ArticleInJournalConverter.java b/ccm-sci-publications/src/com/arsdigita/cms/scipublications/exporter/ris/ArticleInJournalConverter.java
new file mode 100644
index 000000000..f1be92dd4
--- /dev/null
+++ b/ccm-sci-publications/src/com/arsdigita/cms/scipublications/exporter/ris/ArticleInJournalConverter.java
@@ -0,0 +1,61 @@
+package com.arsdigita.cms.scipublications.exporter.ris;
+
+import com.arsdigita.cms.contenttypes.ArticleInJournal;
+import com.arsdigita.cms.contenttypes.Publication;
+
+/**
+ *
+ * @author Jens Pelzetter
+ */
+public class ArticleInJournalConverter extends AbstractRisConverter {
+
+ @Override
+ public String convert(final Publication publication) {
+ ArticleInJournal article;
+
+ if (!(publication instanceof ArticleInJournal)) {
+ throw new UnsupportedCcmTypeException(
+ String.format("The ArticleInJournalConverter only "
+ + "supports publication types which are of the"
+ + "type ArticleInJournal or which are "
+ + "extending "
+ + "ArticleInJournal. The "
+ + "provided publication is of type '%s' which "
+ + "is not of type "
+ + "ArticleInJournal and does not "
+ + "extends ArticleInJournal.",
+ publication.getClass().getName()));
+ }
+
+ article = (ArticleInJournal) publication;
+
+ getRisBuilder().setType(RisTypes.MGZN);
+ convertAuthors(publication);
+ convertTitle(publication);
+ convertYear(publication);
+
+ if (article.getJournal() != null) {
+ getRisBuilder().addField(RisFields.JF,
+ article.getJournal().getTitle());
+ }
+
+ if (article.getVolume() != null) {
+ getRisBuilder().addField(RisFields.VL,
+ article.getVolume().toString());
+ }
+
+ if (article.getPagesFrom() != null) {
+ getRisBuilder().addField(RisFields.SP,
+ article.getPagesFrom().toString());
+ getRisBuilder().addField(RisFields.EP,
+ article.getPagesTo().toString());
+ }
+
+ return getRisBuilder().toRis();
+ }
+
+ @Override
+ public String getCcmType() {
+ return ArticleInJournalConverter.class.getName();
+ }
+}
diff --git a/ccm-sci-publications/src/com/arsdigita/cms/scipublications/exporter/ris/CollectedVolumeConverter.java b/ccm-sci-publications/src/com/arsdigita/cms/scipublications/exporter/ris/CollectedVolumeConverter.java
new file mode 100644
index 000000000..4214df785
--- /dev/null
+++ b/ccm-sci-publications/src/com/arsdigita/cms/scipublications/exporter/ris/CollectedVolumeConverter.java
@@ -0,0 +1,46 @@
+package com.arsdigita.cms.scipublications.exporter.ris;
+
+import com.arsdigita.cms.contenttypes.CollectedVolume;
+import com.arsdigita.cms.contenttypes.Publication;
+
+/**
+ *
+ * @author Jens Pelzetter
+ */
+public class CollectedVolumeConverter extends AbstractRisConverter {
+
+ @Override
+ public String convert(final Publication publication) {
+ CollectedVolume collectedVolume;
+
+ if (!(publication instanceof CollectedVolume)) {
+ throw new UnsupportedCcmTypeException(
+ String.format("The PublicationWithPublicationConverter only "
+ + "supports publication types which are "
+ + "extending CollectedVolume. The "
+ + "provided publication is of type '%s' which "
+ + "does not extends "
+ + "CollectedVolume.",
+ publication.getClass().getName()));
+ }
+
+ collectedVolume = (CollectedVolume) publication;
+
+ getRisBuilder().setType(RisTypes.BOOK);
+ convertAuthors(publication);
+
+ convertTitle(publication);
+ convertYear(publication);
+
+ convertPublisher(collectedVolume);
+ convertISBN(collectedVolume);
+ convertEdition(collectedVolume);
+
+ return getRisBuilder().toRis();
+ }
+
+ @Override
+ public String getCcmType() {
+ return CollectedVolume.class.getName();
+ }
+}
diff --git a/ccm-sci-publications/src/com/arsdigita/cms/scipublications/exporter/ris/ExpertiseConverter.java b/ccm-sci-publications/src/com/arsdigita/cms/scipublications/exporter/ris/ExpertiseConverter.java
new file mode 100644
index 000000000..6f5f9a246
--- /dev/null
+++ b/ccm-sci-publications/src/com/arsdigita/cms/scipublications/exporter/ris/ExpertiseConverter.java
@@ -0,0 +1,44 @@
+package com.arsdigita.cms.scipublications.exporter.ris;
+
+import com.arsdigita.cms.contenttypes.Expertise;
+import com.arsdigita.cms.contenttypes.Publication;
+
+/**
+ *
+ * @author Jens Pelzetter
+ */
+public class ExpertiseConverter extends AbstractRisConverter {
+
+ @Override
+ public String convert(final Publication publication) {
+ Expertise expertise;
+
+ if (!(publication instanceof Expertise)) {
+ throw new UnsupportedCcmTypeException(
+ String.format("The ExpertiseConverter only "
+ + "supports publication types which are of the"
+ + "type Expertise or which are "
+ + "extending "
+ + "Expertise. The "
+ + "provided publication is of type '%s' which "
+ + "is not of type "
+ + "Expertise and does not "
+ + "extends Expertise.",
+ publication.getClass().getName()));
+ }
+
+ expertise = (Expertise) publication;
+
+ getRisBuilder().setType(RisTypes.GEN);
+ convertAuthors(publication);
+ convertTitle(publication);
+ convertYear(publication);
+
+ return getRisBuilder().toRis();
+ }
+
+ @Override
+ public String getCcmType() {
+ return Expertise.class.getName();
+ }
+}
diff --git a/ccm-sci-publications/src/com/arsdigita/cms/scipublications/exporter/ris/GreyLiteratureConverter.java b/ccm-sci-publications/src/com/arsdigita/cms/scipublications/exporter/ris/GreyLiteratureConverter.java
new file mode 100644
index 000000000..334b5f353
--- /dev/null
+++ b/ccm-sci-publications/src/com/arsdigita/cms/scipublications/exporter/ris/GreyLiteratureConverter.java
@@ -0,0 +1,44 @@
+package com.arsdigita.cms.scipublications.exporter.ris;
+
+import com.arsdigita.cms.contenttypes.GreyLiterature;
+import com.arsdigita.cms.contenttypes.Publication;
+
+/**
+ *
+ * @author Jens Pelzetter
+ */
+public class GreyLiteratureConverter extends AbstractRisConverter {
+
+ @Override
+ public String convert(final Publication publication) {
+ GreyLiterature greyLiterature;
+
+ if (!(publication instanceof GreyLiterature)) {
+ throw new UnsupportedCcmTypeException(
+ String.format("The GreyLiteratureConverter only "
+ + "supports publication types which are of the"
+ + "type GreyLiterature or which are "
+ + "extending "
+ + "GreyLiterature. The "
+ + "provided publication is of type '%s' which "
+ + "is not of type "
+ + "GreyLiterature and does not "
+ + "extends GreyLiterature.",
+ publication.getClass().getName()));
+ }
+
+ greyLiterature = (GreyLiterature) publication;
+
+ getRisBuilder().setType(RisTypes.GEN);
+ convertAuthors(publication);
+ convertTitle(publication);
+ convertYear(publication);
+
+ return getRisBuilder().toRis();
+ }
+
+ @Override
+ public String getCcmType() {
+ return GreyLiterature.class.getName();
+ }
+}
diff --git a/ccm-sci-publications/src/com/arsdigita/cms/scipublications/exporter/ris/InProceedingsConverter.java b/ccm-sci-publications/src/com/arsdigita/cms/scipublications/exporter/ris/InProceedingsConverter.java
new file mode 100644
index 000000000..c0e2bd146
--- /dev/null
+++ b/ccm-sci-publications/src/com/arsdigita/cms/scipublications/exporter/ris/InProceedingsConverter.java
@@ -0,0 +1,65 @@
+package com.arsdigita.cms.scipublications.exporter.ris;
+
+import com.arsdigita.cms.contenttypes.InProceedings;
+import com.arsdigita.cms.contenttypes.Proceedings;
+import com.arsdigita.cms.contenttypes.Publication;
+
+/**
+ *
+ * @author Jens Pelzetter
+ */
+public class InProceedingsConverter extends AbstractRisConverter {
+
+ @Override
+ public String convert(final Publication publication) {
+ InProceedings inProceedings;
+
+ if (!(publication instanceof InProceedings)) {
+ throw new UnsupportedCcmTypeException(
+ String.format("The InProceedingsConverter only "
+ + "supports publication types which are of the"
+ + "type InProceedings or which are "
+ + "extending "
+ + "InProceedings. The "
+ + "provided publication is of type '%s' which "
+ + "is not of type "
+ + "InProceedings and does not "
+ + "extends InProceedings.",
+ publication.getClass().getName()));
+ }
+
+ inProceedings = (InProceedings) publication;
+
+ getRisBuilder().setType(RisTypes.GEN);
+ convertAuthors(publication);
+ convertTitle(publication);
+ convertYear(publication);
+
+ if (inProceedings.getPagesFrom() != null) {
+ getRisBuilder().addField(RisFields.SP,
+ inProceedings.getPagesFrom().toString());
+ getRisBuilder().addField(RisFields.EP,
+ inProceedings.getPagesTo().toString());
+ }
+
+ if(inProceedings.getProceedings() != null) {
+ Proceedings proceedings;
+
+ proceedings = inProceedings.getProceedings();
+
+ getRisBuilder().addField(RisFields.BT,
+ proceedings.getTitle());
+
+ convertVolume(proceedings);
+ convertSeries(proceedings);
+ convertPublisher(proceedings);
+ }
+
+ return getRisBuilder().toString();
+ }
+
+ @Override
+ public String getCcmType() {
+ return InProceedings.class.getName();
+ }
+}
diff --git a/ccm-sci-publications/src/com/arsdigita/cms/scipublications/exporter/ris/InternetArticleConverter.java b/ccm-sci-publications/src/com/arsdigita/cms/scipublications/exporter/ris/InternetArticleConverter.java
new file mode 100644
index 000000000..11f8fb02a
--- /dev/null
+++ b/ccm-sci-publications/src/com/arsdigita/cms/scipublications/exporter/ris/InternetArticleConverter.java
@@ -0,0 +1,44 @@
+package com.arsdigita.cms.scipublications.exporter.ris;
+
+import com.arsdigita.cms.contenttypes.InternetArticle;
+import com.arsdigita.cms.contenttypes.Publication;
+
+/**
+ *
+ * @author Jens Pelzetter
+ */
+public class InternetArticleConverter extends AbstractRisConverter {
+
+ @Override
+ public String convert(final Publication publication) {
+ InternetArticle article;
+
+ if (!(publication instanceof InternetArticle)) {
+ throw new UnsupportedCcmTypeException(
+ String.format("The InternetArticleConverter only "
+ + "supports publication types which are of the"
+ + "type InternetArticle or which are "
+ + "extending "
+ + "InternetArticle. The "
+ + "provided publication is of type '%s' which "
+ + "is not of type "
+ + "InternetArticle and does not "
+ + "extends InternetArticle.",
+ publication.getClass().getName()));
+ }
+
+ article = (InternetArticle) publication;
+
+ getRisBuilder().setType(RisTypes.GEN);
+ convertAuthors(publication);
+ convertTitle(publication);
+ convertYear(publication);
+
+ return getRisBuilder().toRis();
+ }
+
+ @Override
+ public String getCcmType() {
+ return InternetArticle.class.getName();
+ }
+}
diff --git a/ccm-sci-publications/src/com/arsdigita/cms/scipublications/exporter/ris/MonographConverter.java b/ccm-sci-publications/src/com/arsdigita/cms/scipublications/exporter/ris/MonographConverter.java
new file mode 100644
index 000000000..3731d3678
--- /dev/null
+++ b/ccm-sci-publications/src/com/arsdigita/cms/scipublications/exporter/ris/MonographConverter.java
@@ -0,0 +1,46 @@
+package com.arsdigita.cms.scipublications.exporter.ris;
+
+import com.arsdigita.cms.contenttypes.Monograph;
+import com.arsdigita.cms.contenttypes.Publication;
+
+/**
+ *
+ * @author Jens Pelzetter
+ */
+public class MonographConverter extends AbstractRisConverter {
+
+ @Override
+ public String convert(final Publication publication) {
+ Monograph monograph;
+
+ if (!(publication instanceof Monograph)) {
+ throw new UnsupportedCcmTypeException(
+ String.format("The MonographConverter only "
+ + "supports publication types which are of the"
+ + "type Monograph or which are extending "
+ + "Monograh. The "
+ + "provided publication is of type '%s' which "
+ + "is not of type Monograph and does not "
+ + "extends Monograph.",
+ publication.getClass().getName()));
+ }
+
+ monograph = (Monograph) publication;
+
+ getRisBuilder().setType(RisTypes.BOOK);
+ convertAuthors(publication);
+ convertTitle(publication);
+ convertYear(publication);
+
+ convertPublisher(monograph);
+ convertISBN(monograph);
+ convertEdition(monograph);
+
+ return getRisBuilder().toRis();
+ }
+
+ @Override
+ public String getCcmType() {
+ return Monograph.class.getName();
+ }
+}
diff --git a/ccm-sci-publications/src/com/arsdigita/cms/scipublications/exporter/ris/ProceedingsConverter.java b/ccm-sci-publications/src/com/arsdigita/cms/scipublications/exporter/ris/ProceedingsConverter.java
new file mode 100644
index 000000000..1138477a8
--- /dev/null
+++ b/ccm-sci-publications/src/com/arsdigita/cms/scipublications/exporter/ris/ProceedingsConverter.java
@@ -0,0 +1,49 @@
+package com.arsdigita.cms.scipublications.exporter.ris;
+
+import com.arsdigita.cms.contenttypes.Proceedings;
+import com.arsdigita.cms.contenttypes.Publication;
+
+/**
+ *
+ * @author jensp
+ */
+public class ProceedingsConverter extends AbstractRisConverter {
+
+ @Override
+ public String convert(final Publication publication) {
+ Proceedings proceedings;
+
+ if (!(publication instanceof Proceedings)) {
+ throw new UnsupportedCcmTypeException(
+ String.format("The ProceedingsConverter only "
+ + "supports publication types which are of the"
+ + "type Proceedings or which are "
+ + "extending "
+ + "Proceedings. The "
+ + "provided publication is of type '%s' which "
+ + "is not of type "
+ + "Proceedings and does not "
+ + "extends Proceedings.",
+ publication.getClass().getName()));
+ }
+
+ proceedings = (Proceedings) publication;
+
+ getRisBuilder().setType(RisTypes.CONF);
+ convertAuthors(publication);
+ convertTitle(publication);
+ convertYear(publication);
+
+ convertVolume(proceedings);
+ convertSeries(publication);
+ convertPublisher(proceedings);
+
+
+ return getRisBuilder().toRis();
+ }
+
+ @Override
+ public String getCcmType() {
+ return Proceedings.class.getName();
+ }
+}
diff --git a/ccm-sci-publications/src/com/arsdigita/cms/scipublications/exporter/ris/PublicationConverter.java b/ccm-sci-publications/src/com/arsdigita/cms/scipublications/exporter/ris/PublicationConverter.java
new file mode 100644
index 000000000..25dff76c8
--- /dev/null
+++ b/ccm-sci-publications/src/com/arsdigita/cms/scipublications/exporter/ris/PublicationConverter.java
@@ -0,0 +1,23 @@
+package com.arsdigita.cms.scipublications.exporter.ris;
+
+import com.arsdigita.cms.contenttypes.Publication;
+
+/**
+ *
+ * @author Jens Pelzetter
+ */
+public class PublicationConverter extends AbstractRisConverter {
+
+ public String convert(final Publication publication) {
+ getRisBuilder().setType(RisTypes.GEN);
+ convertAuthors(publication);
+ convertTitle(publication);
+ convertYear(publication);
+
+ return getRisBuilder().toRis();
+ }
+
+ public String getCcmType() {
+ return Publication.class.getName();
+ }
+}
diff --git a/ccm-sci-publications/src/com/arsdigita/cms/scipublications/exporter/ris/PublicationWithPublisherConverter.java b/ccm-sci-publications/src/com/arsdigita/cms/scipublications/exporter/ris/PublicationWithPublisherConverter.java
new file mode 100644
index 000000000..8e15f6ee7
--- /dev/null
+++ b/ccm-sci-publications/src/com/arsdigita/cms/scipublications/exporter/ris/PublicationWithPublisherConverter.java
@@ -0,0 +1,43 @@
+package com.arsdigita.cms.scipublications.exporter.ris;
+
+import com.arsdigita.cms.contenttypes.Publication;
+import com.arsdigita.cms.contenttypes.PublicationWithPublisher;
+
+/**
+ *
+ * @author Jens Pelzetter
+ */
+public class PublicationWithPublisherConverter extends AbstractRisConverter {
+
+ public String convert(final Publication publication) {
+ PublicationWithPublisher _publication;
+
+ if (!(publication instanceof PublicationWithPublisher)) {
+ throw new UnsupportedCcmTypeException(
+ String.format("The PublicationWithPublicationConverter only "
+ + "supports publication types which are "
+ + "extending PublicationWithPublisher. The "
+ + "provided publication is of type '%s' which "
+ + "does not extends "
+ + "PublicationWithPublisher.",
+ publication.getClass().getName()));
+ }
+
+ _publication = (PublicationWithPublisher) publication;
+
+ getRisBuilder().setType(RisTypes.GEN);
+ convertAuthors(publication);
+ convertTitle(publication);
+ convertYear(publication);
+
+ convertPublisher(_publication);
+ convertISBN(_publication);
+ convertEdition(_publication);
+
+ return getRisBuilder().toRis();
+ }
+
+ public String getCcmType() {
+ return PublicationWithPublisher.class.getName();
+ }
+}
diff --git a/ccm-sci-publications/src/com/arsdigita/cms/scipublications/exporter/ris/ReviewConverter.java b/ccm-sci-publications/src/com/arsdigita/cms/scipublications/exporter/ris/ReviewConverter.java
new file mode 100644
index 000000000..b8ddc30be
--- /dev/null
+++ b/ccm-sci-publications/src/com/arsdigita/cms/scipublications/exporter/ris/ReviewConverter.java
@@ -0,0 +1,15 @@
+package com.arsdigita.cms.scipublications.exporter.ris;
+
+import com.arsdigita.cms.contenttypes.Review;
+
+/**
+ *
+ * @author Jens Pelzetter
+ */
+public class ReviewConverter extends ArticleInJournalConverter {
+
+ @Override
+ public String getCcmType() {
+ return Review.class.getName();
+ }
+}
diff --git a/ccm-sci-publications/src/com/arsdigita/cms/scipublications/exporter/ris/RisBuilder.java b/ccm-sci-publications/src/com/arsdigita/cms/scipublications/exporter/ris/RisBuilder.java
new file mode 100644
index 000000000..de453acaa
--- /dev/null
+++ b/ccm-sci-publications/src/com/arsdigita/cms/scipublications/exporter/ris/RisBuilder.java
@@ -0,0 +1,105 @@
+/*
+ * Copyright (c) 2010 Jens Pelzetter,
+ * for the Center of Social Politics of the University of Bremen
+ *
+ * This library is free software; you can redistribute it and/or
+ * modify it under the terms of the GNU Lesser General Public License
+ * as published by the Free Software Foundation; either version 2.1 of
+ * the License, or (at your option) any later version.
+ *
+ * This library is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+ * Lesser General Public License for more details.
+ *
+ * You should have received a copy of the GNU Lesser General Public
+ * License along with this library; if not, write to the Free Software
+ * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
+ *
+ */
+package com.arsdigita.cms.scipublications.exporter.ris;
+
+import java.util.EnumMap;
+import java.util.Map;
+
+/**
+ * Build an reference in RIS format.
+ *
+ * @author Jens Pelzetter
+ */
+public class RisBuilder {
+
+ /**
+ * Type of the reference
+ */
+ private RisTypes type;
+ /**
+ * Fields of the reference.
+ */
+ private Map
+ * Fields supported by RIS for describing a publication, excluding the
+ * fields TY (type of reference) and ER (end of
+ * reference). These fields are automatically set by the converters.
+ *
+ * The descriptions of the fields or tags as they are called in the RIS + * specification are copied from the specification + *
+ * + * @author Jens Pelzetter + */ +public enum RisFields { + + /** + * Reference ID. According to the specification not used by reference + * managers. + */ + ID, + /** + * Title Primary. Note that the BT tag maps to this field only for + * Whole Book and Unpublished Work references. This field can contain + * alphanumeric characters; there is no practical length limit to this + * field. + */ + T1, + /** + * @see #T1 + */ + TI, + /** + * @see #T1 + * @see #T2 + */ + CT, + /** + * @see #T1 + * @see #T2 + */ + BT, + /** + *+ * Author Primary. Each author must be on a separate line, preceded by this + * tag. Each reference can contain + * unlimited author fields, and can contain up to 255 characters for each + * field. The author name must be in the following syntax: + *
+ *+ * Lastname,Firstname,Suffix + *+ *
+ * For Firstname, you can use full names, initials, or both. The format for + * the author’s first name is as follows: + *
+ *+ * Phillips,A.J. + * Phillips,Albert John + * Phillips,Albert + *+ *
LastnameFirstnameInitialFull NameSuffix+ * Date Primary. This date must be in the following format: + *
+ *+ * YYYY/MM/DD/other info + *+ *
+ * The year, month and day fields are all numeric. The other info field can
+ * be any string of letters, spaces and hyphens. Note that each specific
+ * date information is optional, however the slashes (“/”) are not. For
+ * example, if you just had the year and
+ * other info, then the output
+ * would look like:
+ *
+ * “1993///Spring.” + *+ */ + Y1, + /** + * @see #Y1 + */ + PY, + /** + * Notes. These are free text fields and can contain + * alphanumeric characters; there is no practical length limit to this + * field. + */ + N1, + /** + * @see #N1 + */ + AB, + /** + * Keywords. Each keyword or phrase must be on its own line, preceded by + * this tag. A keyword can consist of multiple words (phrases) and can be + * up to + * 255 characters long. There can unlimited keywords in a reference. + */ + KW, + /** + *
+ * Reprint status. This optional field can contain one of three status + * notes. Each must be in uppercase, and the date after “ON REQUEST” must + * be in + * USA format, in parentheses: (MM/DD/YY). If this field is blank in your + * downloaded text file, the Import function assumes the reprint status is + * “NOT IN FILE.” + *
+ *The three options are:
+ *IN FILENOT IN FILEON REQUEST (mm/dd/yy)UnsupportedCcmType without detail message.
+ */
+ public UnsupportedCcmTypeException() {
+ }
+
+ /**
+ * Constructs an instance of UnsupportedCcmType with the specified detail message.
+ * @param msg the detail message.
+ */
+ public UnsupportedCcmTypeException(final String msg) {
+ super(msg);
+ }
+
+ public UnsupportedCcmTypeException(final Throwable cause) {
+ super(cause);
+ }
+
+ public UnsupportedCcmTypeException(final String msg, Throwable cause) {
+ super(msg, cause);
+ }
+}
diff --git a/ccm-sci-publications/src/com/arsdigita/cms/scipublications/exporter/ris/WorkingPaperConverter.java b/ccm-sci-publications/src/com/arsdigita/cms/scipublications/exporter/ris/WorkingPaperConverter.java
new file mode 100644
index 000000000..70dae7bc2
--- /dev/null
+++ b/ccm-sci-publications/src/com/arsdigita/cms/scipublications/exporter/ris/WorkingPaperConverter.java
@@ -0,0 +1,45 @@
+package com.arsdigita.cms.scipublications.exporter.ris;
+
+import com.arsdigita.cms.contenttypes.Publication;
+import com.arsdigita.cms.contenttypes.WorkingPaper;
+
+/**
+ *
+ * @author Jens Pelzetter
+ */
+public class WorkingPaperConverter extends AbstractRisConverter {
+
+ @Override
+ public String convert(final Publication publication) {
+ WorkingPaper workingPaper;
+
+ if (!(publication instanceof WorkingPaper)) {
+ throw new UnsupportedCcmTypeException(
+ String.format("The WorkingPaperConverter only "
+ + "supports publication types which are of the"
+ + "type WorkingPaper or which are "
+ + "extending "
+ + "WorkingPaper. The "
+ + "provided publication is of type '%s' which "
+ + "is not of type "
+ + "WorkingPaper and does not "
+ + "extends WorkingPaper.",
+ publication.getClass().getName()));
+ }
+
+ workingPaper = (WorkingPaper) publication;
+
+ getRisBuilder().setType(RisTypes.UNPB);
+
+ convertAuthors(publication);
+ convertTitle(publication);
+ convertYear(publication);
+
+ return getRisBuilder().toRis();
+ }
+
+ @Override
+ public String getCcmType() {
+ return WorkingPaper.class.getName();
+ }
+}
diff --git a/ccm-sci-publications/src/com/arsdigita/cms/scipublications/package-info.java b/ccm-sci-publications/src/com/arsdigita/cms/scipublications/package-info.java
new file mode 100644
index 000000000..b1f7aed89
--- /dev/null
+++ b/ccm-sci-publications/src/com/arsdigita/cms/scipublications/package-info.java
@@ -0,0 +1,20 @@
+/**
+ * + * The SciPublications package provides several functions for working + * with the Publication content types provided by the ccm-sci-publications + * module. + *
+ *+ * This includes exporters for reference management software and imports + * from such formats. Examples are BibTeX and RIS. + *
+ *
+ * The entry point for all functions is provided by the
+ * SciPublications
+ * application and the SciPublicationsServlet. The application
+ * makes heavy use of the {@link ServiceLoader} class which was introduced in
+ * Java 1.6.
+ *