# HG changeset patch # User jurzua # Date 1414673433 0 # Node ID 54c1bb63a713b724dad8e0e876286192d3281ab0 # Parent 764f47286679d54b7b63e5924b905c6831efb5f4 diff -r 764f47286679 -r 54c1bb63a713 src/main/java/de/mpiwg/itgroup/ismi/publicView/pages/JSPDynamicPage.java --- a/src/main/java/de/mpiwg/itgroup/ismi/publicView/pages/JSPDynamicPage.java Wed Oct 29 14:28:34 2014 +0000 +++ b/src/main/java/de/mpiwg/itgroup/ismi/publicView/pages/JSPDynamicPage.java Thu Oct 30 12:50:33 2014 +0000 @@ -9,6 +9,7 @@ import org.mpi.openmind.repository.bo.ViewerAttribute; import org.mpi.openmind.repository.bo.ViewerPage; import org.mpi.openmind.repository.utils.OMUtils; +import org.mpi.openmind.repository.utils.RomanizationLoC; import de.mpiwg.itgroup.diva.jsp.AbsJSPWrapper; @@ -58,7 +59,7 @@ if(att.getDisplayMode() != ViewerAttribute.HIDE){ this.attMapTextAlign.put(att.getLabel(), att.getTextAlign()); List values = OMUtils.resolveQuery(currentEntId, att.getQuery(), getWrapper(), att.getContentType()); - + values = romanizeList(values); if(values.size() > 0 || att.getDisplayMode() == ViewerAttribute.SHOW_ALWAYS){ this.attMap.put(att.getLabel(), values); this.labelList.add(att.getLabel()); @@ -73,6 +74,14 @@ } System.out.println(""); } + + public List romanizeList(List list){ + List rs = new ArrayList(); + for(String s : list){ + rs.add(RomanizationLoC.convert(s)); + } + return rs; + } public Long getCurrentEntId() { return currentEntId; diff -r 764f47286679 -r 54c1bb63a713 src/main/java/de/mpiwg/itgroup/ismi/utils/templates/TitleTemplate.java --- a/src/main/java/de/mpiwg/itgroup/ismi/utils/templates/TitleTemplate.java Wed Oct 29 14:28:34 2014 +0000 +++ b/src/main/java/de/mpiwg/itgroup/ismi/utils/templates/TitleTemplate.java Thu Oct 30 12:50:33 2014 +0000 @@ -54,52 +54,45 @@ this.privacity = entity.getPrivacity(); - //attributes - Attribute att = om.getAttributeByName(entity.getId(), "full_title"); - this.fullTitle = (att != null) ? att.getOwnValue() : null; - this.fullTitle = (useRomanization) ? RomanizationLoC.convert(fullTitle) : fullTitle; + Attribute att = null; + Long entId = entity.getId(); - att = om.getAttributeByName(entity.getId(), "full_title_translit"); - this.fullTitleTranslit = (att != null) ? att.getOwnValue() : null; - this.fullTitleTranslit = (useRomanization) ? RomanizationLoC.convert(fullTitleTranslit) : fullTitleTranslit; + //attributes + this.fullTitle = om.getAttributeOVByName(entId, "full_title", useRomanization); - att = om.getAttributeByName(entity.getId(), "creation_date"); + this.fullTitleTranslit = om.getAttributeOVByName(entId, "full_title_translit", useRomanization); + + att = om.getAttributeByName(entId, "creation_date"); if(att != null){ Calendar creationDate = new Calendar(att.getOwnValue()); this.creationDate = creationDate.getCalendarAsHtml(); } - att = om.getAttributeByName(entity.getId(), "language"); - this.language = (att != null) ? att.getOwnValue() : null; + this.language = om.getAttributeOVByName(entId, "language", useRomanization); + + this.notes = om.getAttributeOVByName(entId, "notes", useRomanization); - att = om.getAttributeByName(entity.getId(), "notes"); - this.notes = (att != null) ? att.getOwnValue() : null; + this.incipit = om.getAttributeOVByName(entId, "incipit", useRomanization); - att = om.getAttributeByName(entity.getId(), "incipit"); - this.incipit = (att != null) ? att.getOwnValue() : null; + this.explicit = om.getAttributeOVByName(entId, "explicit", useRomanization); - att = om.getAttributeByName(entity.getId(), "explicit"); - this.explicit = (att != null) ? att.getOwnValue() : null; + this.dedication = om.getAttributeOVByName(entId, "dedication", useRomanization); - att = om.getAttributeByName(entity.getId(), "dedication"); - this.dedication = (att != null) ? att.getOwnValue() : null; + this.tableOfContents = om.getAttributeOVByName(entId, "table_of_contents", useRomanization); - att = om.getAttributeByName(entity.getId(), "table_of_contents"); - this.tableOfContents = (att != null) ? att.getOwnValue() : null; - - List tarList = om.getTargetsForSourceRelation(entity.getId(), "has_subject", "SUBJECT", 1); - this.category = (tarList.size() > 0) ? tarList.get(0).getOwnValue() : null ; + List tarList = om.getTargetsForSourceRelation(entId, "has_subject", "SUBJECT", 1); + this.category = (tarList.size() > 0) ? tarList.get(0).getOwnValue() : null ; + this.category = (useRomanization) ? RomanizationLoC.convert(category) : category; tarList = om.getTargetsForSourceRelation(entity.getId(), "was_created_in", "PLACE", 1); this.createIn = (tarList.size() > 0) ? tarList.get(0).getOwnValue() : null ; + this.createIn = (useRomanization) ? RomanizationLoC.convert(createIn) : createIn; List list0 = om.getSourcesForTargetRelation(entity.getId(), "is_reference_of", "REFERENCE", -1); for(Entity ref : list0){ this.refEntityList.add(om.getEntityContent(ref)); } - - list0 = om.getTargetsForSourceRelation(entity.getId(), "was_created_by", "PERSON", -1); if(list0.size() > 0){ this.author = list0.get(0).getOwnValue(); @@ -111,7 +104,8 @@ list0 = om.getSourcesForTargetRelation(entity, "is_alias_title_of", "ALIAS", -1); for(Entity alias : list0){ - this.aliasList.add(alias.getOwnValue()); + String alias0 = (useRomanization) ? RomanizationLoC.convert(alias.getOwnValue()) : alias.getOwnValue(); + this.aliasList.add(alias0); } list0 = om.getTargetsForSourceRelation(entity, "has_author_misattribution", "MISATTRIBUTION", -1); diff -r 764f47286679 -r 54c1bb63a713 src/main/java/de/mpiwg/itgroup/ismi/utils/templates/WitnessTemplate.java --- a/src/main/java/de/mpiwg/itgroup/ismi/utils/templates/WitnessTemplate.java Wed Oct 29 14:28:34 2014 +0000 +++ b/src/main/java/de/mpiwg/itgroup/ismi/utils/templates/WitnessTemplate.java Thu Oct 30 12:50:33 2014 +0000 @@ -12,7 +12,6 @@ import org.mpi.openmind.repository.bo.Attribute; import org.mpi.openmind.repository.bo.Entity; import org.mpi.openmind.repository.bo.Relation; -import org.mpi.openmind.repository.services.PersistenceService; import org.mpi.openmind.repository.utils.RomanizationLoC; import de.mpiwg.itgroup.ismi.entry.beans.AbstractISMIBean; @@ -111,83 +110,35 @@ this.status = witness.getStatus(); } - Attribute att0 = om.getAttributeByName(witness.getId(), "start_page"); - this.startPage = (att0 != null) ? att0.getValue() : null; - - att0 = om.getAttributeByName(witness.getId(), - "end_page"); - this.endPage = (att0 != null) ? att0.getValue() : null; - att0 = om.getAttributeByName(witness.getId(), - "folios"); - this.folios = (att0 != null) ? att0.getValue() : null; - - att0 = om.getAttributeByName(witness.getId(), - "ahlwardt_no"); - this.ahlwardtNo = (att0 != null) ? att0.getValue() : null; - - att0 = om.getAttributeByName(witness.getId(), "colophon"); - this.colophon = (att0 != null) ? att0.getValue() : null; + this.startPage = om.getAttributeOVByName(id, "start_page", false); + this.endPage = om.getAttributeOVByName(id, "end_page", false); - att0 = om.getAttributeByName(witness.getId(), "page_dimensions"); - this.page_dimensions = (att0 != null) ? att0.getValue() : null; - - att0 = om.getAttributeByName(witness.getId(), "written_area_dimensions"); - this.written_area_dimensions = (att0 != null) ? att0.getValue() : null; - - att0 = om.getAttributeByName(witness.getId(), "lines_per_page"); - this.lines_per_page = (att0 != null) ? att0.getValue() : null; + + this.folios = om.getAttributeOVByName(id, "folios", useRomanization); + this.ahlwardtNo = om.getAttributeOVByName(id, "ahlwardt_no", useRomanization); + this.colophon = om.getAttributeOVByName(id, "colophon", useRomanization); + this.page_dimensions = om.getAttributeOVByName(id, "page_dimensions", useRomanization); + this.written_area_dimensions = om.getAttributeOVByName(id, "written_area_dimensions", useRomanization); + this.lines_per_page = om.getAttributeOVByName(id, "lines_per_page", useRomanization); + this.page_layout = om.getAttributeOVByName(id, "page_layout", useRomanization); + this.script = om.getAttributeOVByName(id, "script", useRomanization); + this.writing_surface = om.getAttributeOVByName(id, "writing_surface", useRomanization); - att0 = om.getAttributeByName(witness.getId(), "page_layout"); - this.page_layout = (att0 != null) ? att0.getValue() : null; - - att0 = om.getAttributeByName(witness.getId(), "script"); - this.script = (att0 != null) ? att0.getValue() : null; - - att0 = om.getAttributeByName(witness.getId(), "writing_surface"); - this.writing_surface = (att0 != null) ? att0.getValue() : null; - - att0 = om.getAttributeByName(witness.getId(), "creation_date"); + Attribute att0 = om.getAttributeByName(witness.getId(), "creation_date"); Calendar creationDate0 = AbstractISMIBean.updateCalendar(att0); this.creationDate = creationDate0.getCalendarAsHtml(); if(extended){ - Attribute incipit = om.getAttributeByName(witness.getId(), - "incipit"); - this.incipit = (incipit != null) ? incipit.getValue() : null; - - Attribute explicit = om.getAttributeByName(witness.getId(), - "explicit"); - this.explicit = (explicit != null) ? explicit.getValue() : null; + this.incipit = om.getAttributeOVByName(id, "incipit", useRomanization); + this.explicit = om.getAttributeOVByName(id, "explicit", useRomanization); } - Attribute table_of_contents = om.getAttributeByName( - witness.getId(), "table_of_contents"); - this.tableOfContents = (table_of_contents != null) ? table_of_contents - .getValue() : null; - - Attribute notes_on_title_author = om.getAttributeByName( - witness.getId(), "notes_on_title_author"); - if (notes_on_title_author != null) { - this.notesOnTitleAuthor = notes_on_title_author.getValue(); - } - - Attribute notes_on_collation_and_corrections = om - .getAttributeByName(witness.getId(), - "notes_on_collation_and_corrections"); - if (notes_on_collation_and_corrections != null) { - this.notesOnCollationAndCorrections = notes_on_collation_and_corrections - .getValue(); - } - - Attribute notes_on_ownership = om.getAttributeByName( - witness.getId(), "notes_on_ownership"); - if (notes_on_ownership != null) { - this.notesOnOwnership = notes_on_ownership.getValue(); - } - - att0 = om.getAttributeByName(witness.getId(), "notes"); - this.notes = (att0 != null) ? att0.getValue() : null; + this.tableOfContents = om.getAttributeOVByName(id, "table_of_contents", useRomanization); + this.notesOnTitleAuthor = om.getAttributeOVByName(id, "notes_on_title_author", useRomanization); + this.notesOnCollationAndCorrections = om.getAttributeOVByName(id, "notes_on_collation_and_corrections", useRomanization); + this.notesOnOwnership = om.getAttributeOVByName(id, "notes_on_ownership", useRomanization); + this.notes = om.getAttributeOVByName(id, "notes", useRomanization); List list0 = om.getTargetsForSourceRelation(witness.getId(), "is_exemplar_of", "TEXT", 1); if (list0.size() > 0) { @@ -218,6 +169,7 @@ //Attribute subject = om.getAttributeByName(witness.getId(), "subject"); list0 = om.getTargetsForSourceRelation(this.titleId, "has_subject", "SUBJECT", 1); this.subject = (!list0.isEmpty()) ? list0.get(0).getOwnValue() : null; + this.subject = (useRomanization) ? RomanizationLoC.convert(subject) : subject; } } @@ -246,8 +198,9 @@ this.wasStudiedByList.add((useRomanization) ? RomanizationLoC.convert(ent.getOwnValue()) : ent.getOwnValue()); } - List list = om.getTargetsForSourceRelation( - witness.getId(), "is_part_of", "CODEX", 1); + //**** Getting the Codices + List list = + om.getTargetsForSourceRelation(witness.getId(), "is_part_of", "CODEX", 1); if (list.size() > 0) { Entity codex = list.get(0); @@ -257,12 +210,11 @@ this.codex = att.getValue(); } - for (Relation rel : om.getSourceRelations(codex, - "owned_by", "PERSON", -1)) { + for (Relation rel : om.getSourceRelations(codex, "owned_by", "PERSON", -1)) { String date = (rel.getAttributeByName("date") != null) ? new Calendar( rel.getAttributeByName("date").getOwnValue()) .getCalendarAsHtml() : ""; - String ov = om.getEntityById(rel.getTargetId()).getOwnValue(); + String ov = om.getEntityById(rel.getTargetId()).getOwnValue(); String ownedLabel = (useRomanization) ? RomanizationLoC.convert(ov) : ov; this.ownedByMap.put(ownedLabel, date); } @@ -371,10 +323,6 @@ return country; } - /* - * public List getReferenceList() { return referenceList; } - */ - public Map getOwnedByMap() { return ownedByMap; } diff -r 764f47286679 -r 54c1bb63a713 src/main/resources/hibernate.cfg.xml --- a/src/main/resources/hibernate.cfg.xml Wed Oct 29 14:28:34 2014 +0000 +++ b/src/main/resources/hibernate.cfg.xml Thu Oct 30 12:50:33 2014 +0000 @@ -22,7 +22,7 @@ jdbc:mysql://localhost/openmind?characterEncoding=UTF-8 UTF-8 root - e1nste1n + admin