comparison src/main/java/de/mpiwg/itgroup/ismi/auxObjects/AliasListenerObject.java @ 112:59f26a5ef2b3

AliasListenerObject adds aliases to ListenerObject. Change all forms to enable ALIAS for (historical) PLACE fields. Remove REPOSITORY from event forms.
author casties
date Tue, 13 Dec 2016 19:04:45 +0100
parents 22a18bfc66b0
children
comparison
equal deleted inserted replaced
111:22a18bfc66b0 112:59f26a5ef2b3
8 8
9 import org.mpi.openmind.repository.bo.Attribute; 9 import org.mpi.openmind.repository.bo.Attribute;
10 import org.mpi.openmind.repository.bo.Entity; 10 import org.mpi.openmind.repository.bo.Entity;
11 11
12 /** 12 /**
13 * ListenerObject that searches in Entity Attributes and ALIASes with a given Relation. 13 * ListenerObject that searches in Entity Attributes and ALIASes connected by a given Relation.
14 * 14 *
15 * @author casties 15 * @author casties
16 * 16 *
17 */ 17 */
18 public class AliasListenerObject extends ListenerObject { 18 public class AliasListenerObject extends ListenerObject {
20 private static final long serialVersionUID = 2072530246758155955L; 20 private static final long serialVersionUID = 2072530246758155955L;
21 21
22 public String aliasRelName; 22 public String aliasRelName;
23 23
24 /** 24 /**
25 * ListenerObject that searches in Entity Attributes and also in ALIASes connected by a given Relation.
26 *
27 * Uses relation ALIAS - aliasRelName -> ENTITY (usually "is_alias_name_of").
28 *
25 * @param classObj 29 * @param classObj
26 * @param attName 30 * @param attName
27 * @param aliasRelName 31 * @param aliasRelName
28 */ 32 */
29 public AliasListenerObject(String classObj, String attName, String aliasRelName) { 33 public AliasListenerObject(String classObj, String attName, String aliasRelName) {
30 super(classObj, attName); 34 super(classObj, attName);
31 this.aliasRelName = aliasRelName; 35 this.aliasRelName = aliasRelName;
36 }
37
38 /**
39 * Sets the current entity and displays the selected attribute if it is not already set.
40 * This is meant not to overwrite an entity already set by an alias.
41 *
42 * @see de.mpiwg.itgroup.ismi.auxObjects.ListenerObject#setEntityAndAttribute(org.mpi.openmind.repository.bo.Entity)
43 */
44 public void setEntityAndAttributeIfEmpty(Entity ent) {
45 if ((this.entity == null) || (this.entity.getObjectClass() == null)) {
46 super.setEntityAndAttribute(ent);
47 }
32 } 48 }
33 49
34 /* (non-Javadoc) 50 /* (non-Javadoc)
35 * @see de.mpiwg.itgroup.ismi.auxObjects.AbstractListenerObject#updateSuggestedItems(java.lang.String, java.lang.String, java.lang.String) 51 * @see de.mpiwg.itgroup.ismi.auxObjects.AbstractListenerObject#updateSuggestedItems(java.lang.String, java.lang.String, java.lang.String)
36 */ 52 */