Search in sources :

Example 1 with ReleaseInfoDataSources

use of org.nextprot.api.core.domain.release.ReleaseInfoDataSources in project nextprot-api by calipho-sib.

the class ReleaseInfoServiceImpl method findReleaseDatasources.

@Override
@Cacheable("release-data-sources")
public ReleaseInfoDataSources findReleaseDatasources() {
    ReleaseInfoDataSources sources = new ReleaseInfoDataSources();
    sources.setDatasources(releaseStatsDao.findReleaseInfoDataSources());
    return sources;
}
Also used : ReleaseInfoDataSources(org.nextprot.api.core.domain.release.ReleaseInfoDataSources) Cacheable(org.springframework.cache.annotation.Cacheable)

Example 2 with ReleaseInfoDataSources

use of org.nextprot.api.core.domain.release.ReleaseInfoDataSources in project nextprot-api by calipho-sib.

the class EntryXMLStreamWriter method writeHeader.

@Override
protected void writeHeader(Map<String, Object> infos) throws IOException {
    int entryNum = (int) infos.get(EntryStreamWriter.getEntryCountKey());
    ReleaseInfoVersions releaseInfoVersions = (ReleaseInfoVersions) infos.get(EntryStreamWriter.getReleaseInfoKey());
    ReleaseInfoDataSources releaseInfoDataSources = (ReleaseInfoDataSources) infos.get(EntryStreamWriter.getReleaseDataSourcesKey());
    Template headerTemplate = velocityConfig.getVelocityEngine().getTemplate("export-header.xml.vm");
    headerTemplate.merge(new NXVelocityContext(entryNum, releaseInfoVersions), getStream());
    Template releaseContentTemplate = velocityConfig.getVelocityEngine().getTemplate("release-contents.xml.vm");
    writePrettyXml(releaseContentTemplate, new NXVelocityContext(entryNum, releaseInfoVersions, releaseInfoDataSources), 2);
    getStream().write("    </header>\n");
    getStream().write("    <entry-list>\n");
}
Also used : NXVelocityContext(org.nextprot.api.web.NXVelocityContext) ReleaseInfoVersions(org.nextprot.api.core.domain.release.ReleaseInfoVersions) ReleaseInfoDataSources(org.nextprot.api.core.domain.release.ReleaseInfoDataSources) Template(org.apache.velocity.Template)

Aggregations

ReleaseInfoDataSources (org.nextprot.api.core.domain.release.ReleaseInfoDataSources)2 Template (org.apache.velocity.Template)1 ReleaseInfoVersions (org.nextprot.api.core.domain.release.ReleaseInfoVersions)1 NXVelocityContext (org.nextprot.api.web.NXVelocityContext)1 Cacheable (org.springframework.cache.annotation.Cacheable)1