Commit ebf02c64 authored by Fischer, Tim's avatar Fischer, Tim
Browse files

Merge branch 'FEATURE-names_for_excel_sheets'

parents 4d45e362 e5661e20
......@@ -27,15 +27,21 @@ public class SmartExcelSheetBundlesSetSource implements BundlesSetSource {
public SmartExcelSheetBundlesSetSource(Sheet sheet) {
String sheetName = sheet.getSheetName();
this.reference = "excel-" + UUID.randomUUID().toString() + "@@" + sheetName;
String sheetType = sheet.getSheetName();
if(sheetName.contains(";")) {
sheetType = sheetName.split(";")[1];
this.reference = sheetName.split(";")[0] + "##" + UUID.randomUUID().toString() + "@@" + sheetType;
} else {
this.reference = "excel-" + UUID.randomUUID().toString() + "@@" + sheetName;
}
switch (sheetName) {
case "journal article" : dcTypeStockMetadatum = new SimpleMetadatum("dc.type.stock", "article"); break;
switch (sheetType) {
case "article" : dcTypeStockMetadatum = new SimpleMetadatum("dc.type.stock", "article"); break;
case "monograph" : dcTypeStockMetadatum = new SimpleMetadatum("dc.type.stock", "monograph"); break;
case "collection" : dcTypeStockMetadatum = new SimpleMetadatum("dc.type.stock", "collection"); break;
case "incollection" : dcTypeStockMetadatum = new SimpleMetadatum("dc.type.stock", "incollection"); break;
case "recension" : dcTypeStockMetadatum = new SimpleMetadatum("dc.type.stock", "recension"); break;
default: log.warn("sheet has an unrecognized name: {}", sheetName);
default: log.warn("sheet has an unrecognized name: {}", sheetType);
}
this.sheet = sheet;
......
......@@ -78,8 +78,8 @@ public class TemplateResource {
bundlesSource.setOwner(userRepository.findOneByLogin(SecurityUtils.getCurrentUserLogin()).get());
bundlesSource.setBundlesSourceState(BundlesSourceState.UNPROCESSED);
bundlesSource.setType(BundlesSourceType.EXCEL_SPREADSHEET);
bundlesSource.setReference("excel-database-" + result.getId());
bundlesSource.setData("excel-database-" + result.getId());
bundlesSource.setReference(Long.toString(result.getId()));
bundlesSource.setData(Long.toString(result.getId()));
BundlesSource resultBundlesSource = bundlesSourceRepository.save(bundlesSource);
result.setBundlesSource(resultBundlesSource);
......
Supports Markdown
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment