use of cz.mzk.recordmanager.server.model.KrameriusConfiguration in project RecordManager2 by moravianlibrary.
the class KramDefaultMetadataDublinCoreRecord method getUrlsByImportConfId.
public List<String> getUrlsByImportConfId(Long importConfId) {
String kramUrl = null;
String kramUrlBase = null;
KrameriusConfiguration kramConf = krameriusConfiguationDao.get(importConfId);
if (kramConf != null && kramConf.getUrl() != null) {
kramUrlBase = Pattern.compile("api/v\\d\\.\\d").matcher(kramConf.getUrl()).replaceAll("") + "i.jsp?pid=";
}
String policy = dcRecord.getRights().stream().anyMatch(s -> s.matches(".*public.*")) ? Constants.DOCUMENT_AVAILABILITY_ONLINE : Constants.DOCUMENT_AVAILABILITY_PROTECTED;
kramUrl = policy + "|" + kramUrlBase + harvestedRecord.getUniqueId().getRecordId() + "|";
return Collections.singletonList(kramUrl);
}
use of cz.mzk.recordmanager.server.model.KrameriusConfiguration in project RecordManager2 by moravianlibrary.
the class ConfigurationTest method test.
@Test
public void test() {
OAIHarvestConfiguration oaiConf = oaiConfigDao.get(OAI_CONF_ID);
KrameriusConfiguration kramConf = kramConfigDao.get(KRAM_CONF_ID);
Assert.assertEquals(importConfigDao.get(OAI_CONF_ID), oaiConf);
Assert.assertEquals(importConfigDao.get(KRAM_CONF_ID), kramConf);
kramConfigDao.persist(kramConf);
Assert.assertNotNull(kramConfigDao.get(KRAM_CONF_ID));
}
use of cz.mzk.recordmanager.server.model.KrameriusConfiguration 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);
}
}
Aggregations