DaBInImporter unterstützt optialen Timestamp, um nur Items zu importieren, die sich nach einem bestimmten Datum geändert haben.
git-svn-id: https://svn.libreccm.org/ccm/trunk@738 8810af33-2d31-482b-a856-94f89814c4dfmaster
parent
96c1719677
commit
4f844cad39
|
|
@ -98,6 +98,7 @@ public class DaBInImporter extends Program {
|
||||||
*/
|
*/
|
||||||
private static final Logger logger = Logger.getLogger(DaBInImporter.class);
|
private static final Logger logger = Logger.getLogger(DaBInImporter.class);
|
||||||
private Properties config;
|
private Properties config;
|
||||||
|
private String timestamp = null;
|
||||||
private ContentSection section;
|
private ContentSection section;
|
||||||
private ContentSection personsSection;
|
private ContentSection personsSection;
|
||||||
private ContentSection projectsSection;
|
private ContentSection projectsSection;
|
||||||
|
|
@ -216,25 +217,30 @@ public class DaBInImporter extends Program {
|
||||||
mySqlPassword = config.getProperty("mysql.password");
|
mySqlPassword = config.getProperty("mysql.password");
|
||||||
mySqlDb = config.getProperty("mysql.db");
|
mySqlDb = config.getProperty("mysql.db");
|
||||||
|
|
||||||
|
timestamp = config.getProperty("data.timestamp");
|
||||||
|
|
||||||
section = getContentSection(config.getProperty("ccm.contentsection"));
|
section = getContentSection(config.getProperty("ccm.contentsection"));
|
||||||
personsSection = getContentSection(config.getProperty("ccm.personsContentSection"));
|
personsSection = getContentSection(config.getProperty(
|
||||||
projectsSection = getContentSection(config.getProperty("ccm.projectsContentSection"));
|
"ccm.personsContentSection"));
|
||||||
publicationsSection = getContentSection(config.getProperty("ccm.publicationsContentSection"));
|
projectsSection = getContentSection(config.getProperty(
|
||||||
|
"ccm.projectsContentSection"));
|
||||||
|
publicationsSection = getContentSection(config.getProperty(
|
||||||
|
"ccm.publicationsContentSection"));
|
||||||
LifecycleDefinitionCollection lifecycles =
|
LifecycleDefinitionCollection lifecycles =
|
||||||
section.getLifecycleDefinitions();
|
section.getLifecycleDefinitions();
|
||||||
while (lifecycles.next()) {
|
while (lifecycles.next()) {
|
||||||
lifecycle = lifecycles.getLifecycleDefinition();
|
lifecycle = lifecycles.getLifecycleDefinition();
|
||||||
}
|
}
|
||||||
lifecycles = personsSection.getLifecycleDefinitions();
|
lifecycles = personsSection.getLifecycleDefinitions();
|
||||||
while(lifecycles.next()) {
|
while (lifecycles.next()) {
|
||||||
personsLifecycle = lifecycles.getLifecycleDefinition();
|
personsLifecycle = lifecycles.getLifecycleDefinition();
|
||||||
}
|
}
|
||||||
lifecycles = projectsSection.getLifecycleDefinitions();
|
lifecycles = projectsSection.getLifecycleDefinitions();
|
||||||
while(lifecycles.next()) {
|
while (lifecycles.next()) {
|
||||||
projectsLifecycle = lifecycles.getLifecycleDefinition();
|
projectsLifecycle = lifecycles.getLifecycleDefinition();
|
||||||
}
|
}
|
||||||
lifecycles = publicationsSection.getLifecycleDefinitions();
|
lifecycles = publicationsSection.getLifecycleDefinitions();
|
||||||
while(lifecycles.next()) {
|
while (lifecycles.next()) {
|
||||||
publicationsLifecycle = lifecycles.getLifecycleDefinition();
|
publicationsLifecycle = lifecycles.getLifecycleDefinition();
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
@ -315,7 +321,8 @@ public class DaBInImporter extends Program {
|
||||||
authorsAlpha.put('y', folder);
|
authorsAlpha.put('y', folder);
|
||||||
authorsAlpha.put('z', folder);
|
authorsAlpha.put('z', folder);
|
||||||
|
|
||||||
contacts = createFolder(personsRootFolder, "kontaktdaten", "Kontaktdaten");
|
contacts = createFolder(personsRootFolder, "kontaktdaten",
|
||||||
|
"Kontaktdaten");
|
||||||
folder = createFolder(contacts, "09", "0-9");
|
folder = createFolder(contacts, "09", "0-9");
|
||||||
contactsAlpha.put('0', folder);
|
contactsAlpha.put('0', folder);
|
||||||
folder = createFolder(contacts, "ab", "A-B");
|
folder = createFolder(contacts, "ab", "A-B");
|
||||||
|
|
@ -557,7 +564,8 @@ public class DaBInImporter extends Program {
|
||||||
folder = createFolder(publishers, "z", "Z");
|
folder = createFolder(publishers, "z", "Z");
|
||||||
publishersAlpha.put('z', folder);
|
publishersAlpha.put('z', folder);
|
||||||
|
|
||||||
publications = createFolder(publicationsRootFolder, "publikationen", "Publikationen");
|
publications = createFolder(publicationsRootFolder, "publikationen",
|
||||||
|
"Publikationen");
|
||||||
folder = createFolder(publications, "09", "0-9");
|
folder = createFolder(publications, "09", "0-9");
|
||||||
publicationsAlpha.put('0', folder);
|
publicationsAlpha.put('0', folder);
|
||||||
folder = createFolder(publications, "a", "A");
|
folder = createFolder(publications, "a", "A");
|
||||||
|
|
@ -845,12 +853,20 @@ public class DaBInImporter extends Program {
|
||||||
long counter = 1;
|
long counter = 1;
|
||||||
long number;
|
long number;
|
||||||
|
|
||||||
result =
|
if (timestamp == null) {
|
||||||
stmt.executeQuery(
|
result =
|
||||||
"SELECT person.Person_Id, Anrede, Vorname, Name, Angaben "
|
stmt.executeQuery(
|
||||||
+ "FROM person "
|
"SELECT person.Person_Id, Anrede, Vorname, Name, Angaben "
|
||||||
+ "WHERE Eigenschaft = 'Aktiv' OR Eigenschaft = 'Ehemalig' "
|
+ "FROM person "
|
||||||
+ "ORDER BY Name, Vorname");
|
+ "WHERE Eigenschaft = 'Aktiv' OR Eigenschaft = 'Ehemalig' "
|
||||||
|
+ "ORDER BY Name, Vorname");
|
||||||
|
} else {
|
||||||
|
result = stmt.executeQuery(String.format(
|
||||||
|
"SELECT person.Person_Id, Anrede, Vorname, Name, Angaben "
|
||||||
|
+ "FROM person "
|
||||||
|
+ "WHERE (Eigenschaft = 'Aktiv' OR Eigenschaft = 'Ehemalig') AND Timestamp > '%s' "
|
||||||
|
+ "ORDER BY Name, Vorname", timestamp));
|
||||||
|
}
|
||||||
result.last();
|
result.last();
|
||||||
number = result.getRow();
|
number = result.getRow();
|
||||||
result.beforeFirst();
|
result.beforeFirst();
|
||||||
|
|
@ -885,11 +901,20 @@ public class DaBInImporter extends Program {
|
||||||
long counter = 1;
|
long counter = 1;
|
||||||
long number;
|
long number;
|
||||||
|
|
||||||
result = stmt.executeQuery(
|
if (timestamp == null) {
|
||||||
"SELECT DISTINCT person.Person_Id, Anrede, Vorname, Name, Angaben "
|
result = stmt.executeQuery(
|
||||||
+ "FROM person JOIN projektlink on person.Person_Id = projektlink.Person_Id "
|
"SELECT DISTINCT person.Person_Id, Anrede, Vorname, Name, Angaben "
|
||||||
+ "WHERE Eigenschaft = 'Autor' OR Eigenschaft = 'Sonstiges' "
|
+ "FROM person JOIN projektlink on person.Person_Id = projektlink.Person_Id "
|
||||||
+ "ORDER BY Name, Vorname");
|
+ "WHERE Eigenschaft = 'Autor' OR Eigenschaft = 'Sonstiges' "
|
||||||
|
+ "ORDER BY Name, Vorname");
|
||||||
|
} else {
|
||||||
|
result = stmt.executeQuery(String.format(
|
||||||
|
"SELECT DISTINCT person.Person_Id, Anrede, Vorname, Name, Angaben "
|
||||||
|
+ "FROM person JOIN projektlink on person.Person_Id = projektlink.Person_Id "
|
||||||
|
+ "WHERE (Eigenschaft = 'Autor' OR Eigenschaft = 'Sonstiges') AND Timestamp > '%s' "
|
||||||
|
+ "ORDER BY Name, Vorname", timestamp));
|
||||||
|
|
||||||
|
}
|
||||||
result.last();
|
result.last();
|
||||||
number = result.getRow();
|
number = result.getRow();
|
||||||
result.beforeFirst();
|
result.beforeFirst();
|
||||||
|
|
@ -923,11 +948,19 @@ public class DaBInImporter extends Program {
|
||||||
long counter = 1;
|
long counter = 1;
|
||||||
long number;
|
long number;
|
||||||
|
|
||||||
result = stmt.executeQuery(
|
if (timestamp == null) {
|
||||||
"SELECT DISTINCT person.Person_Id, Anrede, Vorname, Name, Angaben "
|
result = stmt.executeQuery(
|
||||||
+ "FROM person "
|
"SELECT DISTINCT person.Person_Id, Anrede, Vorname, Name, Angaben "
|
||||||
+ "WHERE Eigenschaft = 'Autor' AND NOT EXISTS (SELECT * FROM projektlink where projektlink.Person_Id = person.Person_Id)"
|
+ "FROM person "
|
||||||
+ "ORDER BY Name, Vorname");
|
+ "WHERE Eigenschaft = 'Autor' AND NOT EXISTS (SELECT * FROM projektlink where projektlink.Person_Id = person.Person_Id)"
|
||||||
|
+ "ORDER BY Name, Vorname");
|
||||||
|
} else {
|
||||||
|
result = stmt.executeQuery(String.format(
|
||||||
|
"SELECT DISTINCT person.Person_Id, Anrede, Vorname, Name, Angaben "
|
||||||
|
+ "FROM person "
|
||||||
|
+ "WHERE Eigenschaft = 'Autor' AND NOT EXISTS (SELECT * FROM projektlink where projektlink.Person_Id = person.Person_Id) AND Timestamp > '%s' "
|
||||||
|
+ "ORDER BY Name, Vorname", timestamp));
|
||||||
|
}
|
||||||
result.last();
|
result.last();
|
||||||
number = result.getRow();
|
number = result.getRow();
|
||||||
result.beforeFirst();
|
result.beforeFirst();
|
||||||
|
|
@ -961,11 +994,20 @@ public class DaBInImporter extends Program {
|
||||||
long counter = 1;
|
long counter = 1;
|
||||||
long number;
|
long number;
|
||||||
|
|
||||||
result =
|
if (timestamp == null) {
|
||||||
stmt.executeQuery(
|
result =
|
||||||
"SELECT DISTINCT abteilunglink.Auftrag, person.Person_Id, person.Eigenschaft, abteilunglink.Auftrag "
|
stmt.executeQuery(
|
||||||
+ "FROM abteilunglink JOIN person ON abteilunglink.Person_Id = person.Person_Id "
|
"SELECT DISTINCT abteilunglink.Auftrag, person.Person_Id, person.Eigenschaft, abteilunglink.Auftrag "
|
||||||
+ "WHERE abteilunglink.Abteilung_Id = 11 AND person.Eigenschaft = 'Aktiv'");
|
+ "FROM abteilunglink JOIN person ON abteilunglink.Person_Id = person.Person_Id "
|
||||||
|
+ "WHERE abteilunglink.Abteilung_Id = 11 AND person.Eigenschaft = 'Aktiv'");
|
||||||
|
} else {
|
||||||
|
result =
|
||||||
|
stmt.executeQuery(String.format(
|
||||||
|
"SELECT DISTINCT abteilunglink.Auftrag, person.Person_Id, person.Eigenschaft, abteilunglink.Auftrag "
|
||||||
|
+ "FROM abteilunglink JOIN person ON abteilunglink.Person_Id = person.Person_Id "
|
||||||
|
+ "WHERE abteilunglink.Abteilung_Id = 11 AND person.Eigenschaft = 'Aktiv' AND Timestamp > '%s'",
|
||||||
|
timestamp));
|
||||||
|
}
|
||||||
result.last();
|
result.last();
|
||||||
number = result.getRow();
|
number = result.getRow();
|
||||||
result.beforeFirst();
|
result.beforeFirst();
|
||||||
|
|
@ -1012,11 +1054,20 @@ public class DaBInImporter extends Program {
|
||||||
long counter = 1;
|
long counter = 1;
|
||||||
long number;
|
long number;
|
||||||
|
|
||||||
result =
|
if (timestamp == null) {
|
||||||
stmt.executeQuery(
|
result =
|
||||||
"SELECT DISTINCT abteilunglink.Auftrag, person.Person_Id, person.Eigenschaft, abteilunglink.Auftrag "
|
stmt.executeQuery(
|
||||||
+ "FROM abteilunglink JOIN person ON abteilunglink.Person_Id = person.Person_Id "
|
"SELECT DISTINCT abteilunglink.Auftrag, person.Person_Id, person.Eigenschaft, abteilunglink.Auftrag "
|
||||||
+ "WHERE abteilunglink.Abteilung_Id = 11 AND person.Eigenschaft = 'Ehemalig'");
|
+ "FROM abteilunglink JOIN person ON abteilunglink.Person_Id = person.Person_Id "
|
||||||
|
+ "WHERE abteilunglink.Abteilung_Id = 11 AND person.Eigenschaft = 'Ehemalig'");
|
||||||
|
} else {
|
||||||
|
result =
|
||||||
|
stmt.executeQuery(String.format(
|
||||||
|
"SELECT DISTINCT abteilunglink.Auftrag, person.Person_Id, person.Eigenschaft, abteilunglink.Auftrag "
|
||||||
|
+ "FROM abteilunglink JOIN person ON abteilunglink.Person_Id = person.Person_Id "
|
||||||
|
+ "WHERE abteilunglink.Abteilung_Id = 11 AND person.Eigenschaft = 'Ehemalig' AND Timestamp > '%s'",
|
||||||
|
timestamp));
|
||||||
|
}
|
||||||
result.last();
|
result.last();
|
||||||
number = result.getRow();
|
number = result.getRow();
|
||||||
result.beforeFirst();
|
result.beforeFirst();
|
||||||
|
|
@ -1093,11 +1144,19 @@ public class DaBInImporter extends Program {
|
||||||
data.setNameEn(result.getString(1));
|
data.setNameEn(result.getString(1));
|
||||||
}
|
}
|
||||||
|
|
||||||
result = stmt.executeQuery(String.format(
|
if (timestamp == null) {
|
||||||
"SELECT abteilunglink.Auftrag, person.Person_Id, person.Eigenschaft "
|
result = stmt.executeQuery(String.format(
|
||||||
+ "FROM abteilunglink JOIN person ON abteilunglink.Person_Id = person.Person_Id "
|
"SELECT abteilunglink.Auftrag, person.Person_Id, person.Eigenschaft "
|
||||||
+ "WHERE abteilunglink.Abteilung_Id = %s AND (person.Eigenschaft = 'Aktiv' OR person.Eigenschaft = 'Ehemalig')",
|
+ "FROM abteilunglink JOIN person ON abteilunglink.Person_Id = person.Person_Id "
|
||||||
departmentIds.get(i)));
|
+ "WHERE abteilunglink.Abteilung_Id = %s AND (person.Eigenschaft = 'Aktiv' OR person.Eigenschaft = 'Ehemalig')",
|
||||||
|
departmentIds.get(i)));
|
||||||
|
} else {
|
||||||
|
result = stmt.executeQuery(String.format(
|
||||||
|
"SELECT abteilunglink.Auftrag, person.Person_Id, person.Eigenschaft "
|
||||||
|
+ "FROM abteilunglink JOIN person ON abteilunglink.Person_Id = person.Person_Id "
|
||||||
|
+ "WHERE abteilunglink.Abteilung_Id = %s AND (person.Eigenschaft = 'Aktiv' OR person.Eigenschaft = 'Ehemalig') AND Timestamp > '%s'",
|
||||||
|
departmentIds.get(i), timestamp));
|
||||||
|
}
|
||||||
|
|
||||||
while (result.next()) {
|
while (result.next()) {
|
||||||
MembershipData membership;
|
MembershipData membership;
|
||||||
|
|
@ -1132,9 +1191,17 @@ public class DaBInImporter extends Program {
|
||||||
ResultSet result;
|
ResultSet result;
|
||||||
List<String> projectsIds = new ArrayList<String>();
|
List<String> projectsIds = new ArrayList<String>();
|
||||||
|
|
||||||
result = stmt.executeQuery("SELECT DISTINCT Projekt_Id "
|
if (timestamp == null) {
|
||||||
+ "FROM projekt "
|
result = stmt.executeQuery("SELECT DISTINCT Projekt_Id "
|
||||||
+ "ORDER BY Projekt_Id");
|
+ "FROM projekt "
|
||||||
|
+ "ORDER BY Projekt_Id");
|
||||||
|
} else {
|
||||||
|
result = stmt.executeQuery(String.format("SELECT DISTINCT Projekt_Id "
|
||||||
|
+ "FROM projekt "
|
||||||
|
+ "WHERE Timestamp > '%s'"
|
||||||
|
+ "ORDER BY Projekt_Id",
|
||||||
|
timestamp));
|
||||||
|
}
|
||||||
while (result.next()) {
|
while (result.next()) {
|
||||||
projectsIds.add(result.getString(1));
|
projectsIds.add(result.getString(1));
|
||||||
}
|
}
|
||||||
|
|
@ -1221,9 +1288,15 @@ public class DaBInImporter extends Program {
|
||||||
long counter = 1;
|
long counter = 1;
|
||||||
long number;
|
long number;
|
||||||
|
|
||||||
result = stmt.executeQuery("SELECT Verlag FROM publikation "
|
if (timestamp == null) {
|
||||||
+ "WHERE Typ = 'Monographie' OR Typ = 'Sammelband' OR Typ = 'Artikel / Aufsatz' "
|
result = stmt.executeQuery("SELECT Verlag FROM publikation "
|
||||||
+ "GROUP BY Verlag");
|
+ "WHERE Typ = 'Monographie' OR Typ = 'Sammelband' OR Typ = 'Artikel / Aufsatz' "
|
||||||
|
+ "GROUP BY Verlag");
|
||||||
|
} else {
|
||||||
|
result = stmt.executeQuery(String.format("SELECT Verlag FROM publikation "
|
||||||
|
+ "WHERE (Typ = 'Monographie' OR Typ = 'Sammelband' OR Typ = 'Artikel / Aufsatz') AND Timestamp > '%s' "
|
||||||
|
+ "GROUP BY Verlag", timestamp));
|
||||||
|
}
|
||||||
result.last();
|
result.last();
|
||||||
number = result.getRow();
|
number = result.getRow();
|
||||||
result.beforeFirst();
|
result.beforeFirst();
|
||||||
|
|
@ -1266,11 +1339,20 @@ public class DaBInImporter extends Program {
|
||||||
long counter = 1;
|
long counter = 1;
|
||||||
long number;
|
long number;
|
||||||
|
|
||||||
|
if (timestamp == null) {
|
||||||
result = stmt.executeQuery(
|
result = stmt.executeQuery(
|
||||||
"SELECT Publikation_Id, Name, Verlag, Jahr, Link, Beschreibung, Abteilung_Id, Sichtbarkeit, ErschienenIn "
|
"SELECT Publikation_Id, Name, Verlag, Jahr, Link, Beschreibung, Abteilung_Id, Sichtbarkeit, ErschienenIn "
|
||||||
+ "FROM publikation "
|
+ "FROM publikation "
|
||||||
+ "WHERE Typ = 'Monographie' "
|
+ "WHERE Typ = 'Monographie' "
|
||||||
+ "ORDER BY Name");
|
+ "ORDER BY Name");
|
||||||
|
} else {
|
||||||
|
result = stmt.executeQuery(String.format(
|
||||||
|
"SELECT Publikation_Id, Name, Verlag, Jahr, Link, Beschreibung, Abteilung_Id, Sichtbarkeit, ErschienenIn "
|
||||||
|
+ "FROM publikation "
|
||||||
|
+ "WHERE Typ = 'Monographie' AND Timestamp > '%s' "
|
||||||
|
+ "ORDER BY Name",
|
||||||
|
timestamp));
|
||||||
|
}
|
||||||
result.last();
|
result.last();
|
||||||
number = result.getRow();
|
number = result.getRow();
|
||||||
result.beforeFirst();
|
result.beforeFirst();
|
||||||
|
|
@ -1342,11 +1424,19 @@ public class DaBInImporter extends Program {
|
||||||
long counter = 1;
|
long counter = 1;
|
||||||
long number;
|
long number;
|
||||||
|
|
||||||
|
if (timestamp == null) {
|
||||||
result = stmt.executeQuery(
|
result = stmt.executeQuery(
|
||||||
"SELECT Publikation_Id, Name, Verlag, Jahr, Link, Beschreibung, Abteilung_Id, Sichtbarkeit "
|
"SELECT Publikation_Id, Name, Verlag, Jahr, Link, Beschreibung, Abteilung_Id, Sichtbarkeit "
|
||||||
+ "FROM publikation "
|
+ "FROM publikation "
|
||||||
+ "WHERE (Typ = 'Sammelband' AND (ErschienenIn IS NULL OR CHAR_LENGTH(ErschienenIn) = 0)) "
|
+ "WHERE (Typ = 'Sammelband' AND (ErschienenIn IS NULL OR CHAR_LENGTH(ErschienenIn) = 0)) "
|
||||||
+ "ORDER BY Name");
|
+ "ORDER BY Name");
|
||||||
|
} else {
|
||||||
|
result = stmt.executeQuery(String.format(
|
||||||
|
"SELECT Publikation_Id, Name, Verlag, Jahr, Link, Beschreibung, Abteilung_Id, Sichtbarkeit "
|
||||||
|
+ "FROM publikation "
|
||||||
|
+ "WHERE (Typ = 'Sammelband' AND (ErschienenIn IS NULL OR CHAR_LENGTH(ErschienenIn) = 0)) AND Timestamp > '%s' "
|
||||||
|
+ "ORDER BY Name", timestamp));
|
||||||
|
}
|
||||||
result.last();
|
result.last();
|
||||||
number = result.getRow();
|
number = result.getRow();
|
||||||
result.beforeFirst();
|
result.beforeFirst();
|
||||||
|
|
@ -1416,6 +1506,7 @@ public class DaBInImporter extends Program {
|
||||||
long counter = 1;
|
long counter = 1;
|
||||||
long number;
|
long number;
|
||||||
|
|
||||||
|
if (timestamp == null) {
|
||||||
result = stmt.executeQuery(
|
result = stmt.executeQuery(
|
||||||
"SELECT Publikation_Id, Name, Verlag, Jahr, Link, Beschreibung, Abteilung_Id, Sichtbarkeit, ErschienenIn "
|
"SELECT Publikation_Id, Name, Verlag, Jahr, Link, Beschreibung, Abteilung_Id, Sichtbarkeit, ErschienenIn "
|
||||||
+ "FROM publikation "
|
+ "FROM publikation "
|
||||||
|
|
@ -1423,6 +1514,16 @@ public class DaBInImporter extends Program {
|
||||||
+ "OR (Typ = 'Monograph' AND ErschienenIn IS NOT NULL AND CHAR_LENGTH(ErschienenIn) > 0) "
|
+ "OR (Typ = 'Monograph' AND ErschienenIn IS NOT NULL AND CHAR_LENGTH(ErschienenIn) > 0) "
|
||||||
+ "OR (Typ = 'Artikel / Aufsatz' AND SUBSTRING(ErschienenIn, 1, 2) = 'in') "
|
+ "OR (Typ = 'Artikel / Aufsatz' AND SUBSTRING(ErschienenIn, 1, 2) = 'in') "
|
||||||
+ "ORDER BY Name");
|
+ "ORDER BY Name");
|
||||||
|
} else {
|
||||||
|
result = stmt.executeQuery(String.format(
|
||||||
|
"SELECT Publikation_Id, Name, Verlag, Jahr, Link, Beschreibung, Abteilung_Id, Sichtbarkeit, ErschienenIn "
|
||||||
|
+ "FROM publikation "
|
||||||
|
+ "WHERE ((Typ = 'Sammelband' AND ErschienenIn IS NOT NULL AND CHAR_LENGTH(ErschienenIn) > 0) "
|
||||||
|
+ "OR (Typ = 'Monograph' AND ErschienenIn IS NOT NULL AND CHAR_LENGTH(ErschienenIn) > 0) "
|
||||||
|
+ "OR (Typ = 'Artikel / Aufsatz' AND SUBSTRING(ErschienenIn, 1, 2) = 'in')) "
|
||||||
|
+ "AND Timestamp > '%s' "
|
||||||
|
+ "ORDER BY Name", timestamp));
|
||||||
|
}
|
||||||
result.last();
|
result.last();
|
||||||
number = result.getRow();
|
number = result.getRow();
|
||||||
result.beforeFirst();
|
result.beforeFirst();
|
||||||
|
|
@ -1494,11 +1595,19 @@ public class DaBInImporter extends Program {
|
||||||
long counter = 1;
|
long counter = 1;
|
||||||
long number;
|
long number;
|
||||||
|
|
||||||
|
if (timestamp == null) {
|
||||||
result = stmt.executeQuery(
|
result = stmt.executeQuery(
|
||||||
"SELECT Publikation_Id, Name, Verlag, Jahr, Link, Beschreibung, Abteilung_Id, Sichtbarkeit, ErschienenIn "
|
"SELECT Publikation_Id, Name, Verlag, Jahr, Link, Beschreibung, Abteilung_Id, Sichtbarkeit, ErschienenIn "
|
||||||
+ "FROM publikation "
|
+ "FROM publikation "
|
||||||
+ "WHERE (Typ = 'Artikel / Aufsatz' AND SUBSTRING(ErschienenIn, 1, 2) <> 'in') "
|
+ "WHERE (Typ = 'Artikel / Aufsatz' AND SUBSTRING(ErschienenIn, 1, 2) <> 'in') "
|
||||||
+ "ORDER BY Name");
|
+ "ORDER BY Name");
|
||||||
|
} else {
|
||||||
|
result = stmt.executeQuery(String.format(
|
||||||
|
"SELECT Publikation_Id, Name, Verlag, Jahr, Link, Beschreibung, Abteilung_Id, Sichtbarkeit, ErschienenIn "
|
||||||
|
+ "FROM publikation "
|
||||||
|
+ "WHERE (Typ = 'Artikel / Aufsatz' AND SUBSTRING(ErschienenIn, 1, 2) <> 'in') AND Timestamp > '%s' "
|
||||||
|
+ "ORDER BY Name", timestamp));
|
||||||
|
}
|
||||||
result.last();
|
result.last();
|
||||||
number = result.getRow();
|
number = result.getRow();
|
||||||
result.beforeFirst();
|
result.beforeFirst();
|
||||||
|
|
@ -1571,11 +1680,19 @@ public class DaBInImporter extends Program {
|
||||||
long counter = 1;
|
long counter = 1;
|
||||||
long number;
|
long number;
|
||||||
|
|
||||||
|
if (timestamp == null) {
|
||||||
result = stmt.executeQuery(
|
result = stmt.executeQuery(
|
||||||
"SELECT Publikation_Id, Name, Verlag, Jahr, Link, Beschreibung, Abteilung_Id, Sichtbarkeit, ErschienenIn "
|
"SELECT Publikation_Id, Name, Verlag, Jahr, Link, Beschreibung, Abteilung_Id, Sichtbarkeit, ErschienenIn "
|
||||||
+ "FROM publikation "
|
+ "FROM publikation "
|
||||||
+ "WHERE Typ = 'Sonstiges' "
|
+ "WHERE Typ = 'Sonstiges' "
|
||||||
+ "ORDER BY Name");
|
+ "ORDER BY Name");
|
||||||
|
} else {
|
||||||
|
result = stmt.executeQuery(String.format(
|
||||||
|
"SELECT Publikation_Id, Name, Verlag, Jahr, Link, Beschreibung, Abteilung_Id, Sichtbarkeit, ErschienenIn "
|
||||||
|
+ "FROM publikation "
|
||||||
|
+ "WHERE Typ = 'Sonstiges' AND Timestamp > '%s' "
|
||||||
|
+ "ORDER BY Name", timestamp));
|
||||||
|
}
|
||||||
result.last();
|
result.last();
|
||||||
number = result.getRow();
|
number = result.getRow();
|
||||||
result.beforeFirst();
|
result.beforeFirst();
|
||||||
|
|
@ -1643,8 +1760,14 @@ public class DaBInImporter extends Program {
|
||||||
ResultSet result;
|
ResultSet result;
|
||||||
List<String> workingPaperIds = new ArrayList<String>();
|
List<String> workingPaperIds = new ArrayList<String>();
|
||||||
|
|
||||||
|
if (timestamp == null) {
|
||||||
result = stmt.executeQuery("SELECT DISTINCT Arbeitspapier_Id FROM arbeitspapier "
|
result = stmt.executeQuery("SELECT DISTINCT Arbeitspapier_Id FROM arbeitspapier "
|
||||||
+ "ORDER BY Jahr, Name");
|
+ "ORDER BY Jahr, Name");
|
||||||
|
} else {
|
||||||
|
result = stmt.executeQuery(String.format("SELECT DISTINCT Arbeitspapier_Id FROM arbeitspapier "
|
||||||
|
+ "WHERE Timestamp > '%s'"
|
||||||
|
+ "ORDER BY Jahr, Name", timestamp));
|
||||||
|
}
|
||||||
while (result.next()) {
|
while (result.next()) {
|
||||||
workingPaperIds.add(result.getString(1));
|
workingPaperIds.add(result.getString(1));
|
||||||
}
|
}
|
||||||
|
|
@ -1787,7 +1910,7 @@ public class DaBInImporter extends Program {
|
||||||
|
|
||||||
personDe.setContentSection(section);
|
personDe.setContentSection(section);
|
||||||
personEn.setContentSection(section);
|
personEn.setContentSection(section);
|
||||||
|
|
||||||
char letter;
|
char letter;
|
||||||
letter = personData.getSurname().toLowerCase().charAt(0);
|
letter = personData.getSurname().toLowerCase().charAt(0);
|
||||||
Map<Character, Folder> folders = null;
|
Map<Character, Folder> folders = null;
|
||||||
|
|
@ -2620,11 +2743,13 @@ public class DaBInImporter extends Program {
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
publicationDe.setLifecycle(createLifecycle(publicationsLifecycle));
|
publicationDe.setLifecycle(
|
||||||
|
createLifecycle(publicationsLifecycle));
|
||||||
publicationDe.setContentSection(publicationsSection);
|
publicationDe.setContentSection(publicationsSection);
|
||||||
publicationDe.setLanguage("de");
|
publicationDe.setLanguage("de");
|
||||||
publicationEn.setLanguage("en");
|
publicationEn.setLanguage("en");
|
||||||
publicationEn.setLifecycle(createLifecycle(publicationsLifecycle));
|
publicationEn.setLifecycle(
|
||||||
|
createLifecycle(publicationsLifecycle));
|
||||||
publicationEn.setContentSection(publicationsSection);
|
publicationEn.setContentSection(publicationsSection);
|
||||||
|
|
||||||
System.out.println("\tAssigning authors...\n");
|
System.out.println("\tAssigning authors...\n");
|
||||||
|
|
@ -2787,7 +2912,8 @@ public class DaBInImporter extends Program {
|
||||||
workingPaperDe.setPlace("Bremen");
|
workingPaperDe.setPlace("Bremen");
|
||||||
extractYearOfPublication(workingPaperData, workingPaperDe);
|
extractYearOfPublication(workingPaperData, workingPaperDe);
|
||||||
workingPaperDe.setLanguage("de");
|
workingPaperDe.setLanguage("de");
|
||||||
workingPaperDe.setLifecycle(createLifecycle(publicationsLifecycle));
|
workingPaperDe.setLifecycle(createLifecycle(
|
||||||
|
publicationsLifecycle));
|
||||||
workingPaperDe.setContentSection(publicationsSection);
|
workingPaperDe.setContentSection(publicationsSection);
|
||||||
workingPaperDe.save();
|
workingPaperDe.save();
|
||||||
System.out.println("OK");
|
System.out.println("OK");
|
||||||
|
|
@ -2825,7 +2951,8 @@ public class DaBInImporter extends Program {
|
||||||
workingPaperEn.setPlace("Bremen");
|
workingPaperEn.setPlace("Bremen");
|
||||||
extractYearOfPublication(workingPaperData, workingPaperEn);
|
extractYearOfPublication(workingPaperData, workingPaperEn);
|
||||||
workingPaperEn.setLanguage("En");
|
workingPaperEn.setLanguage("En");
|
||||||
workingPaperEn.setLifecycle(createLifecycle(publicationsLifecycle));
|
workingPaperEn.setLifecycle(createLifecycle(
|
||||||
|
publicationsLifecycle));
|
||||||
workingPaperEn.setContentSection(publicationsSection);
|
workingPaperEn.setContentSection(publicationsSection);
|
||||||
workingPaperEn.save();
|
workingPaperEn.save();
|
||||||
System.out.println("OK");
|
System.out.println("OK");
|
||||||
|
|
@ -2927,14 +3054,17 @@ public class DaBInImporter extends Program {
|
||||||
"application/pdf");
|
"application/pdf");
|
||||||
fsi.setFile(file);
|
fsi.setFile(file);
|
||||||
file.setContentSection(publicationsSection);
|
file.setContentSection(publicationsSection);
|
||||||
file.setLifecycle(createLifecycle(publicationsLifecycle));
|
file.setLifecycle(createLifecycle(
|
||||||
fsi.setLifecycle(createLifecycle(publicationsLifecycle));
|
publicationsLifecycle));
|
||||||
|
fsi.setLifecycle(createLifecycle(
|
||||||
|
publicationsLifecycle));
|
||||||
fsi.setContentSection(publicationsSection);
|
fsi.setContentSection(publicationsSection);
|
||||||
fsi.save();
|
fsi.save();
|
||||||
|
|
||||||
fsi.setLanguage("de");
|
fsi.setLanguage("de");
|
||||||
ContentBundle bundle = new ContentBundle(fsi);
|
ContentBundle bundle = new ContentBundle(fsi);
|
||||||
bundle.setLifecycle(createLifecycle(publicationsLifecycle));
|
bundle.setLifecycle(createLifecycle(
|
||||||
|
publicationsLifecycle));
|
||||||
bundle.setContentSection(publicationsSection);
|
bundle.setContentSection(publicationsSection);
|
||||||
bundle.setDefaultLanguage("de");
|
bundle.setDefaultLanguage("de");
|
||||||
//bundle.save();
|
//bundle.save();
|
||||||
|
|
@ -3184,11 +3314,10 @@ public class DaBInImporter extends Program {
|
||||||
|
|
||||||
int colonIndex = normalizedData.indexOf(':');
|
int colonIndex = normalizedData.indexOf(':');
|
||||||
if (colonIndex < 0) {
|
if (colonIndex < 0) {
|
||||||
publisher.setName(normalizedData.
|
publisher.setName(normalizedData.replace(",", "").
|
||||||
replace(",", "").
|
replace("/", "").
|
||||||
replace("/", "").
|
replaceAll("\\s\\s+", " ").
|
||||||
replaceAll("\\s\\s+", " ").
|
replace(' ', '-').toLowerCase());
|
||||||
replace(' ', '-').toLowerCase());
|
|
||||||
} else {
|
} else {
|
||||||
String name;
|
String name;
|
||||||
String place;
|
String place;
|
||||||
|
|
@ -3226,10 +3355,10 @@ public class DaBInImporter extends Program {
|
||||||
place = normalizedData.substring(prevDelimIndex, colonIndex);
|
place = normalizedData.substring(prevDelimIndex, colonIndex);
|
||||||
|
|
||||||
publisher.setName(name.trim().
|
publisher.setName(name.trim().
|
||||||
replace(",", "").
|
replace(",", "").
|
||||||
replace("/", "").
|
replace("/", "").
|
||||||
replaceAll("\\s\\s+", " ").
|
replaceAll("\\s\\s+", " ").
|
||||||
replace(' ', '-').toLowerCase());
|
replace(' ', '-').toLowerCase());
|
||||||
publisher.setPlace(place.trim());
|
publisher.setPlace(place.trim());
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
||||||
Loading…
Reference in New Issue