use of ambit2.db.substance.study.SubstanceStudyDetailsProcessor in project ambit-mirror by ideaconsult.
the class SubstanceExportResource method createJSONReporter.
@Override
protected IProcessor<Q, Representation> createJSONReporter(String filenamePrefix) {
String jsonpcallback = getParams().getFirstValue("jsonp");
if (jsonpcallback == null)
jsonpcallback = getParams().getFirstValue("callback");
String command = "results";
try {
if (Boolean.parseBoolean(getParams().getFirstValue("array").toString()))
command = null;
} catch (Exception x) {
}
ProcessorsChain chain = new ProcessorsChain<>();
chain.add(new SubstanceStudyDetailsProcessor());
getCompositionProcessors(chain);
SubstanceRecordAnnotationProcessor annotator = null;
try {
annotator = new SubstanceRecordAnnotationProcessor(new File(((AmbitFreeMarkerApplication) getApplication()).getProperties().getMapFolder()), false);
} catch (Exception x) {
Logger.getGlobal().log(Level.WARNING, x.getMessage());
annotator = null;
}
return new OutputWriterConvertor<SubstanceRecord, Q>((QueryAbstractReporter<SubstanceRecord, Q, Writer>) new Substance2BucketJsonReporter(command, chain, jsonmode, summaryMeasurement, dbTag, annotator), jsonpcallback == null ? MediaType.APPLICATION_JSON : MediaType.APPLICATION_JAVASCRIPT, filenamePrefix);
}
use of ambit2.db.substance.study.SubstanceStudyDetailsProcessor in project ambit-mirror by ideaconsult.
the class SubstanceRDFReporter method init.
/*
* public SubstanceRDFReporter(String base, MediaType mediaType) {
* super(null, mediaType, null); this.base = base; init(); }
*/
protected void init() {
SubstanceStudyDetailsProcessor paReader = new SubstanceStudyDetailsProcessor();
getProcessors().clear();
getProcessors().add(paReader);
getProcessors().add(new DefaultAmbitProcessor<SubstanceRecord, SubstanceRecord>() {
@Override
public SubstanceRecord process(SubstanceRecord target) throws Exception {
processItem(target);
return target;
}
});
}
use of ambit2.db.substance.study.SubstanceStudyDetailsProcessor in project ambit-mirror by ideaconsult.
the class SubstanceBundleStAXReporter method initProcessors.
protected void initProcessors() {
SubstanceStudyDetailsProcessor paReader = new SubstanceStudyDetailsProcessor();
getProcessors().clear();
getProcessors().add(paReader);
getProcessors().add(new DefaultAmbitProcessor<SubstanceRecord, SubstanceRecord>() {
@Override
public SubstanceRecord process(SubstanceRecord target) throws Exception {
processItem(target);
return target;
}
});
}
Aggregations