use of org.ambraproject.rhino.view.journal.JournalOutputView in project rhino by PLOS.
the class ArticleRevisionView method serializeIngestion.
// Could be extracted for more public use, in case we ever need this shallow ArticleIngestion view elsewhere.
private JsonObject serializeIngestion(JsonSerializationContext context, ArticleIngestion ingestion) {
JsonObject serialized = new JsonObject();
JournalOutputView journalOutputView = JournalOutputView.getView(ingestion.getJournal());
serialized.add("journal", context.serialize(journalOutputView));
serialized.addProperty("ingestionNumber", ingestion.getIngestionNumber());
serialized.addProperty("title", ingestion.getTitle());
serialized.addProperty("publicationDate", ingestion.getPublicationDate().toLocalDate().toString());
if (ingestion.getRevisionDate() != null) {
serialized.addProperty("revisionDate", ingestion.getRevisionDate().toLocalDate().toString());
}
serialized.addProperty("publicationStage", ingestion.getPublicationStage());
serialized.addProperty("articleType", ingestion.getArticleType());
return serialized;
}
Aggregations