More bugfixes
git-svn-id: https://svn.libreccm.org/ccm/trunk@5818 8810af33-2d31-482b-a856-94f89814c4dfmaster
parent
8d2060ec0e
commit
bcae65f56b
|
|
@ -35,10 +35,11 @@ public class InternetArticleConverter extends AbstractRisConverter {
|
|||
|
||||
@Override
|
||||
public String convert(final Publication publication) {
|
||||
|
||||
InternetArticle article;
|
||||
|
||||
System.err.printf("Converting publication %s as InternetArticle to RIS...%n",
|
||||
Objects.toString(publication));
|
||||
// System.err.printf("Converting publication %s as InternetArticle to RIS...%n",
|
||||
// Objects.toString(publication));
|
||||
|
||||
if (!(publication instanceof InternetArticle)) {
|
||||
throw new UnsupportedCcmTypeException(
|
||||
|
|
@ -54,29 +55,29 @@ public class InternetArticleConverter extends AbstractRisConverter {
|
|||
publication.getClass().getName()));
|
||||
}
|
||||
|
||||
System.err.printf("Casting to InternetArticle%n");
|
||||
// System.err.printf("Casting to InternetArticle%n");
|
||||
article = (InternetArticle) publication;
|
||||
|
||||
System.err.printf("Setting RIS type to EJOUR...%n");
|
||||
// System.err.printf("Setting RIS type to EJOUR...%n");
|
||||
getRisBuilder().setType(RisType.EJOUR);
|
||||
System.err.printf("Converting authors...%n");
|
||||
// System.err.printf("Converting authors...%n");
|
||||
convertAuthors(publication);
|
||||
System.err.printf("Converting title...%n");
|
||||
// System.err.printf("Converting title...%n");
|
||||
convertTitle(publication);
|
||||
System.err.printf("Converting year...%n");
|
||||
// System.err.printf("Converting year...%n");
|
||||
convertYear(publication);
|
||||
|
||||
System.err.printf("Converting reviewed...%n");
|
||||
// System.err.printf("Converting reviewed...%n");
|
||||
if (article.getReviewed() != null && article.getReviewed()) {
|
||||
getRisBuilder().addField(RisField.RI, "");
|
||||
}
|
||||
|
||||
System.err.printf("Converting URL...%n");
|
||||
// System.err.printf("Converting URL...%n");
|
||||
if (article.getUrl() != null) {
|
||||
getRisBuilder().addField(RisField.UR, article.getUrl());
|
||||
}
|
||||
|
||||
System.err.printf("Building String%n");
|
||||
// System.err.printf("Building String%n");
|
||||
return getRisBuilder().toRis();
|
||||
}
|
||||
|
||||
|
|
|
|||
|
|
@ -27,11 +27,11 @@ import org.apache.log4j.Logger;
|
|||
|
||||
/**
|
||||
* Implementation of {@link SciPublicationsExporter} which exports publications
|
||||
* in the RIS format. The RIS format is described at
|
||||
* in the RIS format. The RIS format is described at
|
||||
* <a href="http://www.refman.com/support/risformat_intro.asp">http://www.refman.com/support/risformat_intro.asp</a>
|
||||
* and
|
||||
* and
|
||||
* <a href="http://www.adeptscience.co.uk/kb/article/FE26">http://www.adeptscience.co.uk/kb/article/FE26</a>.
|
||||
* The <code>RisExporter</code> uses implementations of the {@link RisConverter}
|
||||
* The <code>RisExporter</code> uses implementations of the {@link RisConverter}
|
||||
* interface provided by the {@link RisConverters} class to convert the
|
||||
* publication content items from CCM to RIS references.
|
||||
*
|
||||
|
|
@ -45,11 +45,11 @@ public class RisExporter implements SciPublicationsExporter {
|
|||
public PublicationFormat getSupportedFormat() {
|
||||
try {
|
||||
return new PublicationFormat("RIS",
|
||||
new MimeType("text", "x-ris"),
|
||||
"ris");
|
||||
} catch(MimeTypeParseException ex) {
|
||||
logger.warn("Failed to create MimeType for PublicationFormat."
|
||||
+ "Using null mimetype instead. Cause: ", ex);
|
||||
new MimeType("text", "x-ris"),
|
||||
"ris");
|
||||
} catch (MimeTypeParseException ex) {
|
||||
logger.warn("Failed to create MimeType for PublicationFormat."
|
||||
+ "Using null mimetype instead. Cause: ", ex);
|
||||
return new PublicationFormat("RIS",
|
||||
null,
|
||||
"ris");
|
||||
|
|
@ -59,9 +59,10 @@ public class RisExporter implements SciPublicationsExporter {
|
|||
public String exportPublication(final Publication publication) {
|
||||
return RisConverters.getInstance().convert(publication);
|
||||
}
|
||||
|
||||
@Override
|
||||
|
||||
@Override
|
||||
public String getPreamble() {
|
||||
return null;
|
||||
return "";
|
||||
}
|
||||
|
||||
}
|
||||
|
|
|
|||
Loading…
Reference in New Issue