use of cz.mzk.recordmanager.server.util.HibernateSessionSynchronizer.SessionBinder in project RecordManager2 by moravianlibrary.
the class OAIAuthItemWriter method beforeStep.
@Override
public void beforeStep(StepExecution stepExecution) {
try (SessionBinder session = sync.register()) {
Long confId = stepExecution.getJobParameters().getLong("configurationId");
configuration = configDao.get(confId);
format = formatResolver.resolve(configuration.getMetadataPrefix());
try {
TransformerFactory transformerFactory = TransformerFactory.newInstance();
transformer = transformerFactory.newTransformer();
} catch (TransformerConfigurationException tce) {
throw new RuntimeException(tce);
}
}
}
use of cz.mzk.recordmanager.server.util.HibernateSessionSynchronizer.SessionBinder in project RecordManager2 by moravianlibrary.
the class ImportRecordsWriter method beforeStep.
@Override
public void beforeStep(StepExecution stepExecution) {
try (SessionBinder session = sync.register()) {
OAIHarvestConfiguration hc = oaiHarvestConfigurationDao.get(configurationId);
String regex = null;
if (hc != null) {
regex = hc.getRegex();
harvestConfiguration = hc;
} else {
DownloadImportConfiguration dic = downloadImportConfigurationDao.get(configurationId);
if (dic != null) {
regex = dic.getRegex();
harvestConfiguration = dic;
}
}
if (regex != null) {
regexpExtractor = new RegexpExtractor(regex);
}
}
}
use of cz.mzk.recordmanager.server.util.HibernateSessionSynchronizer.SessionBinder in project RecordManager2 by moravianlibrary.
the class KrameriusItemReader method beforeStep.
@Override
public void beforeStep(StepExecution stepExecution) {
try (SessionBinder sess = hibernateSync.register()) {
conf = configDao.get(confId);
if (conf == null) {
throw new IllegalArgumentException(String.format("OAI harvest configuration with id=%s not found", confId));
}
KrameriusHarvesterParams params = new KrameriusHarvesterParams();
params.setUrl(conf.getUrl());
params.setMetadataStream(conf.getMetadataStream());
params.setQueryRows(conf.getQueryRows());
params.setFrom(fromDate);
params.setUntil(untilDate);
kHarvester = harvesterFactory.create(params, confId);
}
}
use of cz.mzk.recordmanager.server.util.HibernateSessionSynchronizer.SessionBinder in project RecordManager2 by moravianlibrary.
the class KrameriusFulltextProcessor method beforeStep.
@Override
public void beforeStep(StepExecution stepExecution) {
try (SessionBinder sess = sync.register()) {
KrameriusConfiguration config = configDao.get(confId);
if (config == null) {
throw new IllegalArgumentException(String.format("Kramerius configuration with id=%s not found", confId));
}
downloadPrivateFulltexts = config.isDownloadPrivateFulltexts();
fulltexter = krameriusFulltexterFactory.create(config);
}
}
use of cz.mzk.recordmanager.server.util.HibernateSessionSynchronizer.SessionBinder in project RecordManager2 by moravianlibrary.
the class KrameriusItemProcessor method beforeStep.
@Override
public void beforeStep(StepExecution stepExecution) {
try (SessionBinder session = sync.register()) {
Long confId = stepExecution.getJobParameters().getLong("configurationId");
configuration = configDao.get(confId);
format = formatResolver.resolve(configuration.getMetadataStream());
}
}
Aggregations