Project

General

Profile

« Previous | Next » 

Revision 60577

Added by Alessia Bardi over 1 year ago

Log request body

View differences:

modules/dnet-directindex-api/trunk/src/main/java/eu/dnetlib/openaire/directindex/api/OpenaireResultSubmitter.java
2 2

  
3 3
import java.text.SimpleDateFormat;
4 4
import java.util.Date;
5
import java.util.Map;
6 5
import javax.annotation.Resource;
7 6

  
8 7
import com.google.gson.Gson;
9 8
import eu.dnetlib.common.rmi.DNetRestDocumentation;
10
import eu.dnetlib.data.index.CloudIndexClient;
11 9
import eu.dnetlib.data.index.CloudIndexClientException;
12 10
import eu.dnetlib.enabling.is.lookup.rmi.ISLookUpService;
13 11
import eu.dnetlib.enabling.locators.UniqueServiceLocator;
14 12
import eu.dnetlib.functionality.index.solr.feed.StreamingInputDocumentFactory;
15
import eu.dnetlib.miscutils.datetime.HumanTime;
16 13
import eu.dnetlib.miscutils.functional.UnaryFunction;
17 14
import eu.dnetlib.openaire.directindex.objects.ResultEntry;
18 15
import eu.dnetlib.openaire.directindex.utils.OafToIndexRecordFactory;
......
20 17
import org.apache.commons.logging.Log;
21 18
import org.apache.commons.logging.LogFactory;
22 19
import org.apache.solr.client.solrj.impl.CloudSolrClient;
23
import org.apache.solr.client.solrj.response.UpdateResponse;
24 20
import org.apache.solr.common.SolrInputDocument;
25 21
import org.apache.velocity.app.VelocityEngine;
26 22
import org.springframework.beans.factory.annotation.Autowired;
......
87 83
	@RequestMapping(value = { "/api/publications/feedJson", "/api/results/feedJson" }, method = RequestMethod.POST)
88 84
	public @ResponseBody String feedObjectJson(@RequestParam(value = "json", required = true) final String json,
89 85
			@RequestParam(value = "commit", required = false, defaultValue = "true") final boolean commit) throws DirecIndexApiException {
86
		log.debug(json);
90 87
		final ResultEntry pub = new Gson().fromJson(json, ResultEntry.class);
91 88
		return feedObject(pub, commit);
92 89
	}
......
144 141
	}
145 142

  
146 143
	private String feed(final ResultEntry pub) throws DirecIndexApiException {
144
		log.debug(pub);
147 145
		try {
148 146
			final IndexDsInfo info = indexDSRetriever.calculateCurrentIndexDsInfo();
149 147
			final String oafRecord = pub.asOafRecord(velocityEngine, serviceLocator.getService(ISLookUpService.class), oafSchemaLocation, community_api);

Also available in: Unified diff