# HG changeset patch # User Robert Casties # Date 1524162912 -7200 # Node ID 8049becb05caa1d0fe56850d2ec4b3a424a24841 # Parent 1882f1c9974b96894f8caf39bbc83c629ba06c73 New ALIAS is_alias_identifier_of CODEX/WITNESS for diverse catalog numbers. diff -r 1882f1c9974b -r 8049becb05ca src/main/java/de/mpiwg/itgroup/ismi/entry/beans/AbstractISMIBean.java --- a/src/main/java/de/mpiwg/itgroup/ismi/entry/beans/AbstractISMIBean.java Fri Apr 13 12:58:36 2018 +0200 +++ b/src/main/java/de/mpiwg/itgroup/ismi/entry/beans/AbstractISMIBean.java Thu Apr 19 20:35:12 2018 +0200 @@ -71,6 +71,7 @@ public static String is_prime_alias_name_of = "is_prime_alias_name_of"; public static String is_alias_title_of = "is_alias_title_of"; public static String is_prime_alias_title_of = "is_prime_alias_title_of"; + public static String is_alias_identifier_of = "is_alias_identifier_of"; public static String alias = "alias"; public static String has_floruit_date = "has_floruit_date"; diff -r 1882f1c9974b -r 8049becb05ca src/main/java/de/mpiwg/itgroup/ismi/entry/beans/CurrentCodexBean.java --- a/src/main/java/de/mpiwg/itgroup/ismi/entry/beans/CurrentCodexBean.java Fri Apr 13 12:58:36 2018 +0200 +++ b/src/main/java/de/mpiwg/itgroup/ismi/entry/beans/CurrentCodexBean.java Thu Apr 19 20:35:12 2018 +0200 @@ -32,7 +32,8 @@ private List witnessInCurrentCodex; private boolean showWitnessInCurrentCodex; - + + private EntityList aliasIdList; private EntityList ownedByPeople; private EntityList readByPeople; @@ -51,7 +52,7 @@ // source relations new String[]{"is_part_of", "is_alias_of", "owned_by", "read_by"}, // target relations - new String[]{"is_alias_of", "is_reference_of"}); + new String[]{"is_alias_of", "is_reference_of", is_alias_identifier_of}); public CurrentCodexBean() { @@ -70,6 +71,8 @@ super.reset(); this.entity = new Entity(Node.TYPE_ABOX, CODEX, false); + this.aliasIdList = new EntityList(ALIAS, "alias", getWrapper(), getUserName()); + this.ownedByPeople = new EntityList(PERSON, "name_translit", true); this.readByPeople = new EntityList(PERSON, "name_translit", true); @@ -140,6 +143,11 @@ this.isAlias = false; } + for(Relation rel : getWrapper().getTargetRelations(codex, is_alias_identifier_of, ALIAS, -1)) { + Entity alias = getWrapper().getEntityById(rel.getSourceId()); + this.aliasIdList.add(alias); + } + for(Relation rel : getWrapper().getSourceRelations(codex, owned_by, PERSON, -1)) { this.ownedByPeople.add(getWrapper().getEntityById(rel.getTargetId()), rel.getAttributeByName("date")); } @@ -244,22 +252,22 @@ this.entity.replaceUniqueSourceRelation(this.getCollectionLo().entity, COLLECTION, is_part_of); - // CODEX -> owner_by (manyToMany) -> PERSON - this.entity.removeAllSourceRelationsByName(owned_by); - - // CODEX -> read_by (manyToMany) -> PERSON - this.entity.removeAllSourceRelationsByName("read_by"); - - //REFERENCE -> is_reference_of -> THIS - //this.entity = this.prepareReferencesToSave(this.entity); - this.saveReferences(); - + // ALIAS -> is_identifier_of -> CODEX + replaceMultipleTargetRelations(entity, aliasIdList.getEntities(), ALIAS, is_alias_identifier_of); + // CODEX -> owned_by -> PERSON replaceMultipleSourceRelations(entity, ownedByPeople.getEntities(), PERSON, owned_by); + // CODEX -> read_by -> PERSON replaceMultipleSourceRelations(entity, readByPeople.getEntities(), PERSON, "read_by"); /* TODO: currently ignoring date on relations + // CODEX -> owner_by (manyToMany) -> PERSON + this.entity.removeAllSourceRelationsByName(owned_by); + + // CODEX -> read_by (manyToMany) -> PERSON + this.entity.removeAllSourceRelationsByName("read_by"); + for (Entity owner : this.ownedByPeople.getEntities()) { if (owner.isLightweight()) { owner = getWrapper().getEntityByIdWithContent(owner.getId()); @@ -279,6 +287,11 @@ } */ + //REFERENCE -> is_reference_of -> THIS + //this.entity = this.prepareReferencesToSave(this.entity); + this.saveReferences(); + + // save this entity this.entity = getWrapper().saveEntity(this.entity, getSessionUser().getEmail(), editCodexIntent); @@ -356,7 +369,21 @@ } } - public EntityList getOwnedByPeople() { + /** + * @return the aliasIdList + */ + public EntityList getAliasIdList() { + return aliasIdList; + } + + /** + * @param aliasIdList the aliasIdList to set + */ + public void setAliasIdList(EntityList aliasIdList) { + this.aliasIdList = aliasIdList; + } + + public EntityList getOwnedByPeople() { return ownedByPeople; } diff -r 1882f1c9974b -r 8049becb05ca src/main/java/de/mpiwg/itgroup/ismi/entry/beans/CurrentWitnessBean.java --- a/src/main/java/de/mpiwg/itgroup/ismi/entry/beans/CurrentWitnessBean.java Fri Apr 13 12:58:36 2018 +0200 +++ b/src/main/java/de/mpiwg/itgroup/ismi/entry/beans/CurrentWitnessBean.java Thu Apr 19 20:35:12 2018 +0200 @@ -90,6 +90,7 @@ private boolean renderShowAllCodexCandidates = false; //private Entity witness_old; + private EntityList aliasIdList; private String newIdentifier; //private IslamicCalendar islamicCalCopyDate; @@ -114,7 +115,7 @@ "was_copied_in", "was_copied_in_as", "had_patron", "was_studied_by", "has_author_written_as", "has_title_written_as"}, // target relations - new String[] {"is_reference_of"}); + new String[] {"is_reference_of", is_alias_identifier_of}); public CurrentWitnessBean() { super(); @@ -188,7 +189,9 @@ this.createCodexRendered = false; this.renderShowAllCodexCandidates = false; - this.newIdentifier = ""; + this.aliasIdList = new EntityList(ALIAS, "alias", getWrapper(), getUserName()); + + this.newIdentifier = ""; //this.islamicCalCopyDate = new IslamicCalendar(); this.copyDate = new Calendar(); @@ -245,6 +248,8 @@ // WITNESS -> had_patron -> PERSON this.entity.replaceUniqueSourceRelation(this.patronageLo.entity, PERSON, rel_had_patron); + // ALIAS -> is_identifier_of -> CODEX + replaceMultipleTargetRelations(entity, aliasIdList.getEntities(), ALIAS, is_alias_identifier_of); /* * save misidentifications @@ -528,7 +533,13 @@ } } - //this.loadReferences(this.entity); + // ALIAS is_alias_identifier_of WITNESS + for(Relation rel : getWrapper().getTargetRelations(witness, is_alias_identifier_of, ALIAS, -1)) { + Entity alias = getWrapper().getEntityById(rel.getSourceId()); + this.aliasIdList.add(alias); + } + + //this.loadReferences(this.entity); this.loadEndNoteRefs(); this.setCurrentId(this.entity.getId().toString()); @@ -1131,6 +1142,20 @@ public void setMisidentTable(MisidentificationTable misidentTable) { this.misidentTable = misidentTable; } + + /** + * @return the aliasIdList + */ + public EntityList getAliasIdList() { + return aliasIdList; + } + + /** + * @param aliasIdList the aliasIdList to set + */ + public void setAliasIdList(EntityList aliasIdList) { + this.aliasIdList = aliasIdList; + } } diff -r 1882f1c9974b -r 8049becb05ca src/main/webapp/entry/codex.xhtml --- a/src/main/webapp/entry/codex.xhtml Fri Apr 13 12:58:36 2018 +0200 +++ b/src/main/webapp/entry/codex.xhtml Thu Apr 19 20:35:12 2018 +0200 @@ -104,6 +104,35 @@ + + + + + + + + + + + + + + + + + + + + + + + + - - + + + + + + + + + + + + + + + + + + + + + + +