Aktueller Stand des CSV-Importers
git-svn-id: https://svn.libreccm.org/ccm/trunk@1927 8810af33-2d31-482b-a856-94f89814c4dfmaster
parent
d0ab7f6de5
commit
f24f85597b
|
|
@ -218,7 +218,12 @@ public class ImporterUtil {
|
|||
|
||||
final CollectedVolume collectedVolume = new CollectedVolume();
|
||||
collectedVolume.setTitle(title);
|
||||
collectedVolume.setName(normalizeString(title));
|
||||
final String name = normalizeString(title);
|
||||
if (name.length() < 200) {
|
||||
collectedVolume.setName(name);
|
||||
} else {
|
||||
collectedVolume.setName(name.substring(0, 200));
|
||||
}
|
||||
collectedVolume.setContentSection(folder.getContentSection());
|
||||
collectedVolume.setLanguage(Kernel.getConfig().getLanguagesIndependentCode());
|
||||
collectedVolume.save();
|
||||
|
|
@ -452,6 +457,8 @@ public class ImporterUtil {
|
|||
bundle.setContentType(orga.getContentType());
|
||||
bundle.addInstance(orga);
|
||||
bundle.setName(orga.getName());
|
||||
bundle.setParent(folder);
|
||||
bundle.setContentSection(folder.getContentSection());
|
||||
bundle.save();
|
||||
|
||||
publication.setOrganization(orga);
|
||||
|
|
|
|||
|
|
@ -127,8 +127,16 @@ abstract class AbstractPublicationImporter<T extends Publication> {
|
|||
|
||||
bundle.save();
|
||||
|
||||
publication.setAbstract(data.getAbstract());
|
||||
publication.setMisc(data.getMisc());
|
||||
if (data.getAbstract().length() < 4096) {
|
||||
publication.setAbstract(data.getAbstract());
|
||||
} else {
|
||||
publication.setAbstract(data.getAbstract().substring(0, 4096));
|
||||
}
|
||||
if (data.getMisc().length() < 4096) {
|
||||
publication.setMisc(data.getMisc());
|
||||
} else {
|
||||
publication.setMisc(data.getMisc().substring(0, 4096));
|
||||
}
|
||||
|
||||
publication.save();
|
||||
}
|
||||
|
|
@ -150,7 +158,11 @@ abstract class AbstractPublicationImporter<T extends Publication> {
|
|||
private void processTitleAndName(final T publication) {
|
||||
if (!pretend) {
|
||||
publication.setTitle(data.getTitle());
|
||||
publication.setName(normalizeString(data.getTitle()));
|
||||
String name = normalizeString(data.getTitle());
|
||||
if (name.length() > 200) {
|
||||
name = name.substring(0, 200);
|
||||
}
|
||||
publication.setName(name);
|
||||
}
|
||||
report.setTitle(data.getTitle());
|
||||
}
|
||||
|
|
|
|||
|
|
@ -26,10 +26,15 @@ abstract class AbstractPublicationWithPublisherImporter<T extends PublicationWit
|
|||
final CsvLine data = getData();
|
||||
|
||||
if ((data.getIsbn() != null) && !data.getIsbn().isEmpty()) {
|
||||
if (!isPretend()) {
|
||||
final String isbn = data.getIsbn().replace("-", "");
|
||||
if (!isPretend() && isbn.length() == 13) {
|
||||
publication.setISBN(data.getIsbn());
|
||||
}
|
||||
getReport().addField(new FieldImportReport("isbn", data.getIsbn()));
|
||||
if (isbn.length() == 13) {
|
||||
getReport().addField(new FieldImportReport("isbn", isbn));
|
||||
} else {
|
||||
getReport().addMessage(String.format("Invalid ISBN at line %d.", data.getLineNumber()));
|
||||
}
|
||||
}
|
||||
|
||||
processVolume(publication);
|
||||
|
|
|
|||
|
|
@ -38,14 +38,16 @@ class ArticleInCollectedVolumeImporter extends AbstractPublicationImporter<Artic
|
|||
report.addField(new FieldImportReport("Chapter", data.getChapter()));
|
||||
}
|
||||
|
||||
report.setCollectedVolume(importerUtil.processCollectedVolume(
|
||||
article,
|
||||
data.getCollectedVolume(),
|
||||
data.getYear(),
|
||||
parseAuthors(data.getCollectedVolumeAuthors()),
|
||||
data.getPublisher(),
|
||||
data.getPlace(),
|
||||
isPretend()));
|
||||
if ((data.getCollectedVolume() != null) && !data.getCollectedVolume().isEmpty()) {
|
||||
report.setCollectedVolume(importerUtil.processCollectedVolume(
|
||||
article,
|
||||
data.getCollectedVolume(),
|
||||
data.getYear(),
|
||||
parseAuthors(data.getCollectedVolumeAuthors()),
|
||||
data.getPublisher(),
|
||||
data.getPlace(),
|
||||
isPretend()));
|
||||
}
|
||||
|
||||
|
||||
return article;
|
||||
|
|
|
|||
Loading…
Reference in New Issue