Mercurial > hg > ismi-richfaces
changeset 164:d5ae699a4152 public_by_author
Merge from HEAD
1611da70e43e5ad66084ce17dba0402c3a310c71
author | Robert Casties <casties@mpiwg-berlin.mpg.de> |
---|---|
date | Tue, 22 May 2018 18:49:10 +0200 |
parents | 92c4c9f7312a (current diff) 1611da70e43e (diff) |
children | 85fdcca37a0d |
files | |
diffstat | 9 files changed, 140 insertions(+), 28 deletions(-) [+] |
line wrap: on
line diff
--- a/src/main/java/de/mpiwg/itgroup/ismi/entry/beans/AbstractISMIBean.java Fri Oct 20 16:59:48 2017 +0200 +++ b/src/main/java/de/mpiwg/itgroup/ismi/entry/beans/AbstractISMIBean.java Tue May 22 18:49:10 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";
--- a/src/main/java/de/mpiwg/itgroup/ismi/entry/beans/CurrentCodexBean.java Fri Oct 20 16:59:48 2017 +0200 +++ b/src/main/java/de/mpiwg/itgroup/ismi/entry/beans/CurrentCodexBean.java Tue May 22 18:49:10 2018 +0200 @@ -32,7 +32,8 @@ private List<Entity> 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; }
--- a/src/main/java/de/mpiwg/itgroup/ismi/entry/beans/CurrentPersonBean.java Fri Oct 20 16:59:48 2017 +0200 +++ b/src/main/java/de/mpiwg/itgroup/ismi/entry/beans/CurrentPersonBean.java Tue May 22 18:49:10 2018 +0200 @@ -66,7 +66,7 @@ PERSON, // attributes new String[]{"name", "name_translit", "birth_date", "birth_date_text", "death_date", "death_date_text", - "url", "authority_id", "notes", "notes_old"}, + "url", "authority_id", "notes", "notes_old", "mams_number"}, // source relations new String[]{"was_born_in", "was_born_in_as", "died_in", "died_in_as", "lived_in", "lived_in_as", "was_student_of", "has_floruit_date", "has_role"},
--- a/src/main/java/de/mpiwg/itgroup/ismi/entry/beans/CurrentWitnessBean.java Fri Oct 20 16:59:48 2017 +0200 +++ b/src/main/java/de/mpiwg/itgroup/ismi/entry/beans/CurrentWitnessBean.java Tue May 22 18:49:10 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; + } }
--- a/src/main/webapp/browse/entityDetails.xhtml Fri Oct 20 16:59:48 2017 +0200 +++ b/src/main/webapp/browse/entityDetails.xhtml Tue May 22 18:49:10 2018 +0200 @@ -50,12 +50,6 @@ rendered="#{Session.canEdit}" action="#{Session.entDetailsForm.actionEdit}" style="margin-right: 20px;" /> - <h:commandButton value="Remove" title="Remove this entity" - rendered="#{Session.canDelete}" - image="#{ApplicationBean1.imgRemove32}" - onclick="if(!confirm('Do you really want to remove this entity?')){ return; };" - action="#{Session.entDetailsForm.listenerDeleteEntity}" - style="margin-right: 20px;" /> <h:commandButton value="Query Builder" onclick="window.open('#{ApplicationBean1.generateQueryBrowserUrlForId(Session.entDetailsForm.entity.id)}')" title="Start Query Builder with this id" @@ -249,6 +243,15 @@ </h:column> </rich:dataTable> + <h:outputText value="Delete Entity" styleClass="titlePanel" + rendered="#{Session.canDelete}"/> + + <h:commandButton value="Delete this entity" title="Remove this entity" + rendered="#{Session.canDelete}" + image="#{ApplicationBean1.imgRemove32}" + onclick="if(confirm('ATTENTION: Do you really want to remove this entity?')){return true;}else{return false;};" + action="#{Session.entDetailsForm.listenerDeleteEntity}"/> + </h:panelGrid> </h:panelGrid> </h:panelGrid>
--- a/src/main/webapp/entry/codex.xhtml Fri Oct 20 16:59:48 2017 +0200 +++ b/src/main/webapp/entry/codex.xhtml Tue May 22 18:49:10 2018 +0200 @@ -104,6 +104,35 @@ <h:outputText /> <h:outputText /> + <h:outputText value="Alias Identifiers" /> + <h:panelGrid columns="1"> + <h:panelGrid columns="2"> + <h:dataTable value="#{CurrentCodex.aliasIdList.entities}" var="item" + rendered="#{!empty CurrentCodex.aliasIdList.entities}"> + <h:column> + <h:outputText value="#{item.ownValue}" /> + </h:column> + <h:column> + <h:selectBooleanCheckbox + value="#{CurrentCodex.aliasIdList.selections[item.id]}" /> + </h:column> + </h:dataTable> + <h:commandButton value="Remove Selected" + actionListener="#{CurrentCodex.aliasIdList.listenerRemoveSelection}" + rendered="#{!empty CurrentCodex.aliasIdList.entities}" /> + </h:panelGrid> + + <h:panelGrid columns="2"> + <h:inputText value="#{CurrentCodex.aliasIdList.input}" size="80"/> + <h:commandButton value="CREATE" + actionListener="#{CurrentCodex.aliasIdList.listenerCreate}" /> + </h:panelGrid> + </h:panelGrid> + <h:outputText value="Use schema 'catalogname: identifier', e.g. 'Ahlward: 7653'." /> + <h:outputText /> + + + </h:panelGrid> <h:panelGrid columns="2" styleClass="createPanel" @@ -262,10 +291,10 @@ <ismi:refWidget entityForm="#{CurrentCodex}" /> - <h:outputText value="Alias" styleClass="titlePanel"/> + <h:outputText value="Reproduction" styleClass="titlePanel"/> <h:panelGrid columns="2" styleClass="createPanel" columnClasses="createPanelFirstColumn"> - <h:outputText value="Is this codex alias?" /> + <h:outputText value="Is this codex a reproduction?" /> <h:selectBooleanCheckbox value="#{CurrentCodex.isAlias}"> <a4j:ajax event="click" render="codexAliasPanel" /> </h:selectBooleanCheckbox> @@ -274,7 +303,7 @@ <h:panelGrid columns="1" id="codexAliasPanel"> - <h:outputText value="Referenced Alias" + <h:outputText value="Original codex" rendered="#{CurrentCodex.isAlias}" styleClass="titlePanel"/>
--- a/src/main/webapp/entry/witness.xhtml Fri Oct 20 16:59:48 2017 +0200 +++ b/src/main/webapp/entry/witness.xhtml Tue May 22 18:49:10 2018 +0200 @@ -123,12 +123,39 @@ </h:panelGrid> - <h:panelGrid columns="2" styleClass="createPanel" + <h:panelGrid columns="3" styleClass="createPanel" columnClasses="createPanelFirstColumn,createPanelColumn02"> - <h:outputText value="Ahlwardt No." /> + <h:outputText value="Alias Catalog Identifiers" /> + <h:panelGrid columns="1"> + <h:panelGrid columns="2"> + <h:dataTable value="#{CurrentWitness.aliasIdList.entities}" var="item" + rendered="#{!empty CurrentWitness.aliasIdList.entities}"> + <h:column> + <h:outputText value="#{item.ownValue}" /> + </h:column> + <h:column> + <h:selectBooleanCheckbox + value="#{CurrentWitness.aliasIdList.selections[item.id]}" /> + </h:column> + </h:dataTable> + <h:commandButton value="Remove Selected" + actionListener="#{CurrentWitness.aliasIdList.listenerRemoveSelection}" + rendered="#{!empty CurrentWitness.aliasIdList.entities}" /> + </h:panelGrid> + + <h:panelGrid columns="2"> + <h:inputText value="#{CurrentWitness.aliasIdList.input}" size="80"/> + <h:commandButton value="CREATE" + actionListener="#{CurrentWitness.aliasIdList.listenerCreate}" /> + </h:panelGrid> + </h:panelGrid> + <h:outputText value="Use schema 'catalogname: identifier', e.g. 'Ahlward: 7653'." /> + + <h:outputText value="Ahlwardt No. (deprecated)" /> <h:inputText value="#{CurrentWitness.attributes['ahlwardt_no']}" style="width: 300px;" /> + <h:outputText /> </h:panelGrid>