annotate src/main/java/de/mpiwg/itgroup/ismi/browse/FullEntityRepositoryBean.java @ 180:0d31c8be7c31

new MissingRelations feature and UI. including searchByRelations() with Filter in FullEntityRepositoryBean.
author Robert Casties <casties@mpiwg-berlin.mpg.de>
date Wed, 13 Jun 2018 14:57:13 +0200
parents aa564b1b5e1f
children 34ac2e1b323a
Ignore whitespace changes - Everywhere: Within whitespace: At end of lines:
rev   line source
169
0b5d02012299 more work on publicByAuthor feature.
Robert Casties <casties@mpiwg-berlin.mpg.de>
parents:
diff changeset
1 package de.mpiwg.itgroup.ismi.browse;
0b5d02012299 more work on publicByAuthor feature.
Robert Casties <casties@mpiwg-berlin.mpg.de>
parents:
diff changeset
2
0b5d02012299 more work on publicByAuthor feature.
Robert Casties <casties@mpiwg-berlin.mpg.de>
parents:
diff changeset
3 import java.util.ArrayList;
173
aa564b1b5e1f publicByAuthor feature ui for selecting texts ready.
Robert Casties <casties@mpiwg-berlin.mpg.de>
parents: 169
diff changeset
4 import java.util.Collections;
aa564b1b5e1f publicByAuthor feature ui for selecting texts ready.
Robert Casties <casties@mpiwg-berlin.mpg.de>
parents: 169
diff changeset
5 import java.util.Comparator;
aa564b1b5e1f publicByAuthor feature ui for selecting texts ready.
Robert Casties <casties@mpiwg-berlin.mpg.de>
parents: 169
diff changeset
6 import java.util.List;
169
0b5d02012299 more work on publicByAuthor feature.
Robert Casties <casties@mpiwg-berlin.mpg.de>
parents:
diff changeset
7
0b5d02012299 more work on publicByAuthor feature.
Robert Casties <casties@mpiwg-berlin.mpg.de>
parents:
diff changeset
8 import org.apache.commons.lang.StringUtils;
0b5d02012299 more work on publicByAuthor feature.
Robert Casties <casties@mpiwg-berlin.mpg.de>
parents:
diff changeset
9 import org.mpi.openmind.cache.WrapperService;
173
aa564b1b5e1f publicByAuthor feature ui for selecting texts ready.
Robert Casties <casties@mpiwg-berlin.mpg.de>
parents: 169
diff changeset
10 import org.mpi.openmind.repository.bo.Attribute;
169
0b5d02012299 more work on publicByAuthor feature.
Robert Casties <casties@mpiwg-berlin.mpg.de>
parents:
diff changeset
11 import org.mpi.openmind.repository.bo.Entity;
180
0d31c8be7c31 new MissingRelations feature and UI.
Robert Casties <casties@mpiwg-berlin.mpg.de>
parents: 173
diff changeset
12 import org.mpi.openmind.repository.bo.Relation;
0d31c8be7c31 new MissingRelations feature and UI.
Robert Casties <casties@mpiwg-berlin.mpg.de>
parents: 173
diff changeset
13 import org.mpi.openmind.repository.services.utils.RelationFilter;
169
0b5d02012299 more work on publicByAuthor feature.
Robert Casties <casties@mpiwg-berlin.mpg.de>
parents:
diff changeset
14
0b5d02012299 more work on publicByAuthor feature.
Robert Casties <casties@mpiwg-berlin.mpg.de>
parents:
diff changeset
15 /**
0b5d02012299 more work on publicByAuthor feature.
Robert Casties <casties@mpiwg-berlin.mpg.de>
parents:
diff changeset
16 * EntityRepositoryBean for full Entities with Attributes and Relations loaded.
0b5d02012299 more work on publicByAuthor feature.
Robert Casties <casties@mpiwg-berlin.mpg.de>
parents:
diff changeset
17 *
0b5d02012299 more work on publicByAuthor feature.
Robert Casties <casties@mpiwg-berlin.mpg.de>
parents:
diff changeset
18 * @author casties
0b5d02012299 more work on publicByAuthor feature.
Robert Casties <casties@mpiwg-berlin.mpg.de>
parents:
diff changeset
19 *
0b5d02012299 more work on publicByAuthor feature.
Robert Casties <casties@mpiwg-berlin.mpg.de>
parents:
diff changeset
20 */
0b5d02012299 more work on publicByAuthor feature.
Robert Casties <casties@mpiwg-berlin.mpg.de>
parents:
diff changeset
21 public class FullEntityRepositoryBean extends EntityRepositoryBean {
0b5d02012299 more work on publicByAuthor feature.
Robert Casties <casties@mpiwg-berlin.mpg.de>
parents:
diff changeset
22
0b5d02012299 more work on publicByAuthor feature.
Robert Casties <casties@mpiwg-berlin.mpg.de>
parents:
diff changeset
23 private static final long serialVersionUID = 8022526185079972610L;
0b5d02012299 more work on publicByAuthor feature.
Robert Casties <casties@mpiwg-berlin.mpg.de>
parents:
diff changeset
24
173
aa564b1b5e1f publicByAuthor feature ui for selecting texts ready.
Robert Casties <casties@mpiwg-berlin.mpg.de>
parents: 169
diff changeset
25 protected String sortAttributeName;
aa564b1b5e1f publicByAuthor feature ui for selecting texts ready.
Robert Casties <casties@mpiwg-berlin.mpg.de>
parents: 169
diff changeset
26
aa564b1b5e1f publicByAuthor feature ui for selecting texts ready.
Robert Casties <casties@mpiwg-berlin.mpg.de>
parents: 169
diff changeset
27 protected boolean sortAttributeNumerically = false;
aa564b1b5e1f publicByAuthor feature ui for selecting texts ready.
Robert Casties <casties@mpiwg-berlin.mpg.de>
parents: 169
diff changeset
28
180
0d31c8be7c31 new MissingRelations feature and UI.
Robert Casties <casties@mpiwg-berlin.mpg.de>
parents: 173
diff changeset
29 /**
0d31c8be7c31 new MissingRelations feature and UI.
Robert Casties <casties@mpiwg-berlin.mpg.de>
parents: 173
diff changeset
30 * updateAdvancedEntities() method that makes sure that the current Entities
0d31c8be7c31 new MissingRelations feature and UI.
Robert Casties <casties@mpiwg-berlin.mpg.de>
parents: 173
diff changeset
31 * are not lightweight.
173
aa564b1b5e1f publicByAuthor feature ui for selecting texts ready.
Robert Casties <casties@mpiwg-berlin.mpg.de>
parents: 169
diff changeset
32 *
aa564b1b5e1f publicByAuthor feature ui for selecting texts ready.
Robert Casties <casties@mpiwg-berlin.mpg.de>
parents: 169
diff changeset
33 * @see de.mpiwg.itgroup.ismi.browse.AbstractEntityRepositoryBean#
aa564b1b5e1f publicByAuthor feature ui for selecting texts ready.
Robert Casties <casties@mpiwg-berlin.mpg.de>
parents: 169
diff changeset
34 * updateAdvancedEntities()
169
0b5d02012299 more work on publicByAuthor feature.
Robert Casties <casties@mpiwg-berlin.mpg.de>
parents:
diff changeset
35 */
0b5d02012299 more work on publicByAuthor feature.
Robert Casties <casties@mpiwg-berlin.mpg.de>
parents:
diff changeset
36 @Override
0b5d02012299 more work on publicByAuthor feature.
Robert Casties <casties@mpiwg-berlin.mpg.de>
parents:
diff changeset
37 protected void updateAdvancedEntities() {
0b5d02012299 more work on publicByAuthor feature.
Robert Casties <casties@mpiwg-berlin.mpg.de>
parents:
diff changeset
38 if (StringUtils.isNotEmpty(getObjectClass())) {
0b5d02012299 more work on publicByAuthor feature.
Robert Casties <casties@mpiwg-berlin.mpg.de>
parents:
diff changeset
39 this.advancedPaginator.initCount();
0b5d02012299 more work on publicByAuthor feature.
Robert Casties <casties@mpiwg-berlin.mpg.de>
parents:
diff changeset
40 int startRecord = this.advancedPaginator.getCurrentPage() * this.advancedPaginator.getItemsPerPage();
0b5d02012299 more work on publicByAuthor feature.
Robert Casties <casties@mpiwg-berlin.mpg.de>
parents:
diff changeset
41 if ((this.advancedPaginator.getCurrentPage() + 1) == this.advancedPaginator.getNumberOfPages()) {
0b5d02012299 more work on publicByAuthor feature.
Robert Casties <casties@mpiwg-berlin.mpg.de>
parents:
diff changeset
42 int mod = this.entities.size() % advancedPaginator.getItemsPerPage();
0b5d02012299 more work on publicByAuthor feature.
Robert Casties <casties@mpiwg-berlin.mpg.de>
parents:
diff changeset
43 if (mod == 0) {
0b5d02012299 more work on publicByAuthor feature.
Robert Casties <casties@mpiwg-berlin.mpg.de>
parents:
diff changeset
44 this.currentEntities = entities.subList(startRecord,
0b5d02012299 more work on publicByAuthor feature.
Robert Casties <casties@mpiwg-berlin.mpg.de>
parents:
diff changeset
45 startRecord + this.advancedPaginator.getItemsPerPage());
0b5d02012299 more work on publicByAuthor feature.
Robert Casties <casties@mpiwg-berlin.mpg.de>
parents:
diff changeset
46 } else {
0b5d02012299 more work on publicByAuthor feature.
Robert Casties <casties@mpiwg-berlin.mpg.de>
parents:
diff changeset
47 this.currentEntities = entities.subList(startRecord, startRecord + mod);
0b5d02012299 more work on publicByAuthor feature.
Robert Casties <casties@mpiwg-berlin.mpg.de>
parents:
diff changeset
48 }
0b5d02012299 more work on publicByAuthor feature.
Robert Casties <casties@mpiwg-berlin.mpg.de>
parents:
diff changeset
49
0b5d02012299 more work on publicByAuthor feature.
Robert Casties <casties@mpiwg-berlin.mpg.de>
parents:
diff changeset
50 } else {
0b5d02012299 more work on publicByAuthor feature.
Robert Casties <casties@mpiwg-berlin.mpg.de>
parents:
diff changeset
51 this.currentEntities = entities.subList(startRecord,
0b5d02012299 more work on publicByAuthor feature.
Robert Casties <casties@mpiwg-berlin.mpg.de>
parents:
diff changeset
52 startRecord + this.advancedPaginator.getItemsPerPage());
0b5d02012299 more work on publicByAuthor feature.
Robert Casties <casties@mpiwg-berlin.mpg.de>
parents:
diff changeset
53 }
0b5d02012299 more work on publicByAuthor feature.
Robert Casties <casties@mpiwg-berlin.mpg.de>
parents:
diff changeset
54 } else {
0b5d02012299 more work on publicByAuthor feature.
Robert Casties <casties@mpiwg-berlin.mpg.de>
parents:
diff changeset
55 // empty object_class
0b5d02012299 more work on publicByAuthor feature.
Robert Casties <casties@mpiwg-berlin.mpg.de>
parents:
diff changeset
56 this.currentEntities = new ArrayList<Entity>();
0b5d02012299 more work on publicByAuthor feature.
Robert Casties <casties@mpiwg-berlin.mpg.de>
parents:
diff changeset
57 }
0b5d02012299 more work on publicByAuthor feature.
Robert Casties <casties@mpiwg-berlin.mpg.de>
parents:
diff changeset
58 // make sure all entities are loaded
0b5d02012299 more work on publicByAuthor feature.
Robert Casties <casties@mpiwg-berlin.mpg.de>
parents:
diff changeset
59 WrapperService store = getWrapper();
0b5d02012299 more work on publicByAuthor feature.
Robert Casties <casties@mpiwg-berlin.mpg.de>
parents:
diff changeset
60 for (Entity ent : this.currentEntities) {
0b5d02012299 more work on publicByAuthor feature.
Robert Casties <casties@mpiwg-berlin.mpg.de>
parents:
diff changeset
61 if (ent.isLightweight()) {
173
aa564b1b5e1f publicByAuthor feature ui for selecting texts ready.
Robert Casties <casties@mpiwg-berlin.mpg.de>
parents: 169
diff changeset
62 store.getEntityContent(ent);
169
0b5d02012299 more work on publicByAuthor feature.
Robert Casties <casties@mpiwg-berlin.mpg.de>
parents:
diff changeset
63 }
0b5d02012299 more work on publicByAuthor feature.
Robert Casties <casties@mpiwg-berlin.mpg.de>
parents:
diff changeset
64 }
0b5d02012299 more work on publicByAuthor feature.
Robert Casties <casties@mpiwg-berlin.mpg.de>
parents:
diff changeset
65 }
0b5d02012299 more work on publicByAuthor feature.
Robert Casties <casties@mpiwg-berlin.mpg.de>
parents:
diff changeset
66
173
aa564b1b5e1f publicByAuthor feature ui for selecting texts ready.
Robert Casties <casties@mpiwg-berlin.mpg.de>
parents: 169
diff changeset
67 public String actionSortByAttributes() {
aa564b1b5e1f publicByAuthor feature ui for selecting texts ready.
Robert Casties <casties@mpiwg-berlin.mpg.de>
parents: 169
diff changeset
68 try {
aa564b1b5e1f publicByAuthor feature ui for selecting texts ready.
Robert Casties <casties@mpiwg-berlin.mpg.de>
parents: 169
diff changeset
69 this.sortByAttributes();
aa564b1b5e1f publicByAuthor feature ui for selecting texts ready.
Robert Casties <casties@mpiwg-berlin.mpg.de>
parents: 169
diff changeset
70 } catch (Exception e) {
aa564b1b5e1f publicByAuthor feature ui for selecting texts ready.
Robert Casties <casties@mpiwg-berlin.mpg.de>
parents: 169
diff changeset
71 printInternalError(e);
aa564b1b5e1f publicByAuthor feature ui for selecting texts ready.
Robert Casties <casties@mpiwg-berlin.mpg.de>
parents: 169
diff changeset
72 logger.error(e.getMessage(), e);
aa564b1b5e1f publicByAuthor feature ui for selecting texts ready.
Robert Casties <casties@mpiwg-berlin.mpg.de>
parents: 169
diff changeset
73 }
aa564b1b5e1f publicByAuthor feature ui for selecting texts ready.
Robert Casties <casties@mpiwg-berlin.mpg.de>
parents: 169
diff changeset
74 return GOTO_ENTITY_REPOSITORY;
aa564b1b5e1f publicByAuthor feature ui for selecting texts ready.
Robert Casties <casties@mpiwg-berlin.mpg.de>
parents: 169
diff changeset
75 }
aa564b1b5e1f publicByAuthor feature ui for selecting texts ready.
Robert Casties <casties@mpiwg-berlin.mpg.de>
parents: 169
diff changeset
76
180
0d31c8be7c31 new MissingRelations feature and UI.
Robert Casties <casties@mpiwg-berlin.mpg.de>
parents: 173
diff changeset
77 /**
0d31c8be7c31 new MissingRelations feature and UI.
Robert Casties <casties@mpiwg-berlin.mpg.de>
parents: 173
diff changeset
78 * Loads all entities of this.objectClass and sorts by this.sortAttributeName.
0d31c8be7c31 new MissingRelations feature and UI.
Robert Casties <casties@mpiwg-berlin.mpg.de>
parents: 173
diff changeset
79 *
0d31c8be7c31 new MissingRelations feature and UI.
Robert Casties <casties@mpiwg-berlin.mpg.de>
parents: 173
diff changeset
80 * Sort attributes as integer if this.sortAttributeNumerically.
0d31c8be7c31 new MissingRelations feature and UI.
Robert Casties <casties@mpiwg-berlin.mpg.de>
parents: 173
diff changeset
81 *
0d31c8be7c31 new MissingRelations feature and UI.
Robert Casties <casties@mpiwg-berlin.mpg.de>
parents: 173
diff changeset
82 * @throws Exception
0d31c8be7c31 new MissingRelations feature and UI.
Robert Casties <casties@mpiwg-berlin.mpg.de>
parents: 173
diff changeset
83 */
173
aa564b1b5e1f publicByAuthor feature ui for selecting texts ready.
Robert Casties <casties@mpiwg-berlin.mpg.de>
parents: 169
diff changeset
84 public void sortByAttributes() throws Exception {
180
0d31c8be7c31 new MissingRelations feature and UI.
Robert Casties <casties@mpiwg-berlin.mpg.de>
parents: 173
diff changeset
85 logger.debug("Start sortByAttributes...");
173
aa564b1b5e1f publicByAuthor feature ui for selecting texts ready.
Robert Casties <casties@mpiwg-berlin.mpg.de>
parents: 169
diff changeset
86 this.resultMode = MODE_ADVANCED;
aa564b1b5e1f publicByAuthor feature ui for selecting texts ready.
Robert Casties <casties@mpiwg-berlin.mpg.de>
parents: 169
diff changeset
87 this.setPage("");
aa564b1b5e1f publicByAuthor feature ui for selecting texts ready.
Robert Casties <casties@mpiwg-berlin.mpg.de>
parents: 169
diff changeset
88 this.entities = new ArrayList<Entity>();
aa564b1b5e1f publicByAuthor feature ui for selecting texts ready.
Robert Casties <casties@mpiwg-berlin.mpg.de>
parents: 169
diff changeset
89 this.currentEntities = new ArrayList<Entity>();
aa564b1b5e1f publicByAuthor feature ui for selecting texts ready.
Robert Casties <casties@mpiwg-berlin.mpg.de>
parents: 169
diff changeset
90
aa564b1b5e1f publicByAuthor feature ui for selecting texts ready.
Robert Casties <casties@mpiwg-berlin.mpg.de>
parents: 169
diff changeset
91 this.resultSummaryMsg = "";
aa564b1b5e1f publicByAuthor feature ui for selecting texts ready.
Robert Casties <casties@mpiwg-berlin.mpg.de>
parents: 169
diff changeset
92
aa564b1b5e1f publicByAuthor feature ui for selecting texts ready.
Robert Casties <casties@mpiwg-berlin.mpg.de>
parents: 169
diff changeset
93 /*
aa564b1b5e1f publicByAuthor feature ui for selecting texts ready.
Robert Casties <casties@mpiwg-berlin.mpg.de>
parents: 169
diff changeset
94 * run search and sort result (by attribute)
aa564b1b5e1f publicByAuthor feature ui for selecting texts ready.
Robert Casties <casties@mpiwg-berlin.mpg.de>
parents: 169
diff changeset
95 */
aa564b1b5e1f publicByAuthor feature ui for selecting texts ready.
Robert Casties <casties@mpiwg-berlin.mpg.de>
parents: 169
diff changeset
96 List<Entity> resultList = getWrapper().getEntitiesByDef(this.objectClass);
180
0d31c8be7c31 new MissingRelations feature and UI.
Robert Casties <casties@mpiwg-berlin.mpg.de>
parents: 173
diff changeset
97 // sort List (by attribute)
173
aa564b1b5e1f publicByAuthor feature ui for selecting texts ready.
Robert Casties <casties@mpiwg-berlin.mpg.de>
parents: 169
diff changeset
98 Collections.sort(resultList,
aa564b1b5e1f publicByAuthor feature ui for selecting texts ready.
Robert Casties <casties@mpiwg-berlin.mpg.de>
parents: 169
diff changeset
99 getEntityAttributeComparator(this.sortAttributeName, this.sortAttributeNumerically));
aa564b1b5e1f publicByAuthor feature ui for selecting texts ready.
Robert Casties <casties@mpiwg-berlin.mpg.de>
parents: 169
diff changeset
100 this.entities = resultList;
aa564b1b5e1f publicByAuthor feature ui for selecting texts ready.
Robert Casties <casties@mpiwg-berlin.mpg.de>
parents: 169
diff changeset
101
aa564b1b5e1f publicByAuthor feature ui for selecting texts ready.
Robert Casties <casties@mpiwg-berlin.mpg.de>
parents: 169
diff changeset
102 if (resultList.size() > 0) {
aa564b1b5e1f publicByAuthor feature ui for selecting texts ready.
Robert Casties <casties@mpiwg-berlin.mpg.de>
parents: 169
diff changeset
103 this.resultSummaryMsg = resultList.size() + " items were found!";
aa564b1b5e1f publicByAuthor feature ui for selecting texts ready.
Robert Casties <casties@mpiwg-berlin.mpg.de>
parents: 169
diff changeset
104 this.advancedPaginator.setCurrentPage(0);
aa564b1b5e1f publicByAuthor feature ui for selecting texts ready.
Robert Casties <casties@mpiwg-berlin.mpg.de>
parents: 169
diff changeset
105 int entitiesCount = this.entities.size();
aa564b1b5e1f publicByAuthor feature ui for selecting texts ready.
Robert Casties <casties@mpiwg-berlin.mpg.de>
parents: 169
diff changeset
106 this.advancedPaginator.resetNumberOfPages(entitiesCount);
aa564b1b5e1f publicByAuthor feature ui for selecting texts ready.
Robert Casties <casties@mpiwg-berlin.mpg.de>
parents: 169
diff changeset
107 this.updateAdvancedEntities();
aa564b1b5e1f publicByAuthor feature ui for selecting texts ready.
Robert Casties <casties@mpiwg-berlin.mpg.de>
parents: 169
diff changeset
108 } else {
aa564b1b5e1f publicByAuthor feature ui for selecting texts ready.
Robert Casties <casties@mpiwg-berlin.mpg.de>
parents: 169
diff changeset
109 this.resultSummaryMsg = "No items were found!";
aa564b1b5e1f publicByAuthor feature ui for selecting texts ready.
Robert Casties <casties@mpiwg-berlin.mpg.de>
parents: 169
diff changeset
110 }
180
0d31c8be7c31 new MissingRelations feature and UI.
Robert Casties <casties@mpiwg-berlin.mpg.de>
parents: 173
diff changeset
111 logger.debug("Done sortByAttributes.");
173
aa564b1b5e1f publicByAuthor feature ui for selecting texts ready.
Robert Casties <casties@mpiwg-berlin.mpg.de>
parents: 169
diff changeset
112 }
aa564b1b5e1f publicByAuthor feature ui for selecting texts ready.
Robert Casties <casties@mpiwg-berlin.mpg.de>
parents: 169
diff changeset
113
180
0d31c8be7c31 new MissingRelations feature and UI.
Robert Casties <casties@mpiwg-berlin.mpg.de>
parents: 173
diff changeset
114 /**
0d31c8be7c31 new MissingRelations feature and UI.
Robert Casties <casties@mpiwg-berlin.mpg.de>
parents: 173
diff changeset
115 * Returns Comparator for Entities that uses the Attribute attname.
0d31c8be7c31 new MissingRelations feature and UI.
Robert Casties <casties@mpiwg-berlin.mpg.de>
parents: 173
diff changeset
116 *
0d31c8be7c31 new MissingRelations feature and UI.
Robert Casties <casties@mpiwg-berlin.mpg.de>
parents: 173
diff changeset
117 * Sorts as integer if numerically.
0d31c8be7c31 new MissingRelations feature and UI.
Robert Casties <casties@mpiwg-berlin.mpg.de>
parents: 173
diff changeset
118 *
0d31c8be7c31 new MissingRelations feature and UI.
Robert Casties <casties@mpiwg-berlin.mpg.de>
parents: 173
diff changeset
119 * @param attName
0d31c8be7c31 new MissingRelations feature and UI.
Robert Casties <casties@mpiwg-berlin.mpg.de>
parents: 173
diff changeset
120 * @param numerically
0d31c8be7c31 new MissingRelations feature and UI.
Robert Casties <casties@mpiwg-berlin.mpg.de>
parents: 173
diff changeset
121 * @return
0d31c8be7c31 new MissingRelations feature and UI.
Robert Casties <casties@mpiwg-berlin.mpg.de>
parents: 173
diff changeset
122 */
173
aa564b1b5e1f publicByAuthor feature ui for selecting texts ready.
Robert Casties <casties@mpiwg-berlin.mpg.de>
parents: 169
diff changeset
123 public Comparator<Entity> getEntityAttributeComparator(final String attName, final boolean numerically) {
aa564b1b5e1f publicByAuthor feature ui for selecting texts ready.
Robert Casties <casties@mpiwg-berlin.mpg.de>
parents: 169
diff changeset
124 return new Comparator<Entity>() {
aa564b1b5e1f publicByAuthor feature ui for selecting texts ready.
Robert Casties <casties@mpiwg-berlin.mpg.de>
parents: 169
diff changeset
125 @Override
aa564b1b5e1f publicByAuthor feature ui for selecting texts ready.
Robert Casties <casties@mpiwg-berlin.mpg.de>
parents: 169
diff changeset
126 public int compare(Entity e1, Entity e2) {
aa564b1b5e1f publicByAuthor feature ui for selecting texts ready.
Robert Casties <casties@mpiwg-berlin.mpg.de>
parents: 169
diff changeset
127 if (e1.isLightweight()) {
aa564b1b5e1f publicByAuthor feature ui for selecting texts ready.
Robert Casties <casties@mpiwg-berlin.mpg.de>
parents: 169
diff changeset
128 e1 = getWrapper().getEntityContent(e1);
aa564b1b5e1f publicByAuthor feature ui for selecting texts ready.
Robert Casties <casties@mpiwg-berlin.mpg.de>
parents: 169
diff changeset
129 }
aa564b1b5e1f publicByAuthor feature ui for selecting texts ready.
Robert Casties <casties@mpiwg-berlin.mpg.de>
parents: 169
diff changeset
130 Attribute att1 = e1.getAttributeByName(attName);
aa564b1b5e1f publicByAuthor feature ui for selecting texts ready.
Robert Casties <casties@mpiwg-berlin.mpg.de>
parents: 169
diff changeset
131 if (e2.isLightweight()) {
aa564b1b5e1f publicByAuthor feature ui for selecting texts ready.
Robert Casties <casties@mpiwg-berlin.mpg.de>
parents: 169
diff changeset
132 e2 = getWrapper().getEntityContent(e2);
aa564b1b5e1f publicByAuthor feature ui for selecting texts ready.
Robert Casties <casties@mpiwg-berlin.mpg.de>
parents: 169
diff changeset
133 }
aa564b1b5e1f publicByAuthor feature ui for selecting texts ready.
Robert Casties <casties@mpiwg-berlin.mpg.de>
parents: 169
diff changeset
134 Attribute att2 = e2.getAttributeByName(attName);
aa564b1b5e1f publicByAuthor feature ui for selecting texts ready.
Robert Casties <casties@mpiwg-berlin.mpg.de>
parents: 169
diff changeset
135 if (att1 == null && att2 != null) {
aa564b1b5e1f publicByAuthor feature ui for selecting texts ready.
Robert Casties <casties@mpiwg-berlin.mpg.de>
parents: 169
diff changeset
136 return 1;
aa564b1b5e1f publicByAuthor feature ui for selecting texts ready.
Robert Casties <casties@mpiwg-berlin.mpg.de>
parents: 169
diff changeset
137 } else if (att1 != null && att2 == null) {
aa564b1b5e1f publicByAuthor feature ui for selecting texts ready.
Robert Casties <casties@mpiwg-berlin.mpg.de>
parents: 169
diff changeset
138 return -1;
aa564b1b5e1f publicByAuthor feature ui for selecting texts ready.
Robert Casties <casties@mpiwg-berlin.mpg.de>
parents: 169
diff changeset
139 } else if (att1 == null && att2 == null) {
aa564b1b5e1f publicByAuthor feature ui for selecting texts ready.
Robert Casties <casties@mpiwg-berlin.mpg.de>
parents: 169
diff changeset
140 return 0;
aa564b1b5e1f publicByAuthor feature ui for selecting texts ready.
Robert Casties <casties@mpiwg-berlin.mpg.de>
parents: 169
diff changeset
141 }
aa564b1b5e1f publicByAuthor feature ui for selecting texts ready.
Robert Casties <casties@mpiwg-berlin.mpg.de>
parents: 169
diff changeset
142 if (numerically) {
aa564b1b5e1f publicByAuthor feature ui for selecting texts ready.
Robert Casties <casties@mpiwg-berlin.mpg.de>
parents: 169
diff changeset
143 Integer a1 = null;
aa564b1b5e1f publicByAuthor feature ui for selecting texts ready.
Robert Casties <casties@mpiwg-berlin.mpg.de>
parents: 169
diff changeset
144 Integer a2 = null;
aa564b1b5e1f publicByAuthor feature ui for selecting texts ready.
Robert Casties <casties@mpiwg-berlin.mpg.de>
parents: 169
diff changeset
145 try {
aa564b1b5e1f publicByAuthor feature ui for selecting texts ready.
Robert Casties <casties@mpiwg-berlin.mpg.de>
parents: 169
diff changeset
146 a1 = Integer.parseInt(att1.getValue());
aa564b1b5e1f publicByAuthor feature ui for selecting texts ready.
Robert Casties <casties@mpiwg-berlin.mpg.de>
parents: 169
diff changeset
147 } catch (Exception e) {
aa564b1b5e1f publicByAuthor feature ui for selecting texts ready.
Robert Casties <casties@mpiwg-berlin.mpg.de>
parents: 169
diff changeset
148 }
aa564b1b5e1f publicByAuthor feature ui for selecting texts ready.
Robert Casties <casties@mpiwg-berlin.mpg.de>
parents: 169
diff changeset
149 try {
aa564b1b5e1f publicByAuthor feature ui for selecting texts ready.
Robert Casties <casties@mpiwg-berlin.mpg.de>
parents: 169
diff changeset
150 a2 = Integer.parseInt(att2.getValue());
aa564b1b5e1f publicByAuthor feature ui for selecting texts ready.
Robert Casties <casties@mpiwg-berlin.mpg.de>
parents: 169
diff changeset
151 } catch (Exception e) {
aa564b1b5e1f publicByAuthor feature ui for selecting texts ready.
Robert Casties <casties@mpiwg-berlin.mpg.de>
parents: 169
diff changeset
152 }
aa564b1b5e1f publicByAuthor feature ui for selecting texts ready.
Robert Casties <casties@mpiwg-berlin.mpg.de>
parents: 169
diff changeset
153 if (a1 == null && a2 != null) {
aa564b1b5e1f publicByAuthor feature ui for selecting texts ready.
Robert Casties <casties@mpiwg-berlin.mpg.de>
parents: 169
diff changeset
154 return 1;
aa564b1b5e1f publicByAuthor feature ui for selecting texts ready.
Robert Casties <casties@mpiwg-berlin.mpg.de>
parents: 169
diff changeset
155 } else if (a1 != null && a2 == null) {
aa564b1b5e1f publicByAuthor feature ui for selecting texts ready.
Robert Casties <casties@mpiwg-berlin.mpg.de>
parents: 169
diff changeset
156 return -1;
aa564b1b5e1f publicByAuthor feature ui for selecting texts ready.
Robert Casties <casties@mpiwg-berlin.mpg.de>
parents: 169
diff changeset
157 } else if (a1 == null && a2 == null) {
aa564b1b5e1f publicByAuthor feature ui for selecting texts ready.
Robert Casties <casties@mpiwg-berlin.mpg.de>
parents: 169
diff changeset
158 return 0;
aa564b1b5e1f publicByAuthor feature ui for selecting texts ready.
Robert Casties <casties@mpiwg-berlin.mpg.de>
parents: 169
diff changeset
159 }
aa564b1b5e1f publicByAuthor feature ui for selecting texts ready.
Robert Casties <casties@mpiwg-berlin.mpg.de>
parents: 169
diff changeset
160 return Integer.compare(a1, a2);
aa564b1b5e1f publicByAuthor feature ui for selecting texts ready.
Robert Casties <casties@mpiwg-berlin.mpg.de>
parents: 169
diff changeset
161 } else {
aa564b1b5e1f publicByAuthor feature ui for selecting texts ready.
Robert Casties <casties@mpiwg-berlin.mpg.de>
parents: 169
diff changeset
162 return att1.getValue().compareTo(att2.getValue());
aa564b1b5e1f publicByAuthor feature ui for selecting texts ready.
Robert Casties <casties@mpiwg-berlin.mpg.de>
parents: 169
diff changeset
163 }
aa564b1b5e1f publicByAuthor feature ui for selecting texts ready.
Robert Casties <casties@mpiwg-berlin.mpg.de>
parents: 169
diff changeset
164 }
aa564b1b5e1f publicByAuthor feature ui for selecting texts ready.
Robert Casties <casties@mpiwg-berlin.mpg.de>
parents: 169
diff changeset
165 };
aa564b1b5e1f publicByAuthor feature ui for selecting texts ready.
Robert Casties <casties@mpiwg-berlin.mpg.de>
parents: 169
diff changeset
166 }
180
0d31c8be7c31 new MissingRelations feature and UI.
Robert Casties <casties@mpiwg-berlin.mpg.de>
parents: 173
diff changeset
167
0d31c8be7c31 new MissingRelations feature and UI.
Robert Casties <casties@mpiwg-berlin.mpg.de>
parents: 173
diff changeset
168 /**
0d31c8be7c31 new MissingRelations feature and UI.
Robert Casties <casties@mpiwg-berlin.mpg.de>
parents: 173
diff changeset
169 * Loads all entities of this.objectClass matching the given RelationFilters.
0d31c8be7c31 new MissingRelations feature and UI.
Robert Casties <casties@mpiwg-berlin.mpg.de>
parents: 173
diff changeset
170 *
0d31c8be7c31 new MissingRelations feature and UI.
Robert Casties <casties@mpiwg-berlin.mpg.de>
parents: 173
diff changeset
171 * Filters Relations by relObjectClass and either srcObjectClass or tarObjectClass.
0d31c8be7c31 new MissingRelations feature and UI.
Robert Casties <casties@mpiwg-berlin.mpg.de>
parents: 173
diff changeset
172 *
0d31c8be7c31 new MissingRelations feature and UI.
Robert Casties <casties@mpiwg-berlin.mpg.de>
parents: 173
diff changeset
173 * Requires all RelationFilters to match.
0d31c8be7c31 new MissingRelations feature and UI.
Robert Casties <casties@mpiwg-berlin.mpg.de>
parents: 173
diff changeset
174 *
0d31c8be7c31 new MissingRelations feature and UI.
Robert Casties <casties@mpiwg-berlin.mpg.de>
parents: 173
diff changeset
175 * @throws Exception
0d31c8be7c31 new MissingRelations feature and UI.
Robert Casties <casties@mpiwg-berlin.mpg.de>
parents: 173
diff changeset
176 */
0d31c8be7c31 new MissingRelations feature and UI.
Robert Casties <casties@mpiwg-berlin.mpg.de>
parents: 173
diff changeset
177 public void searchByRelations(List<RelationFilter> relationFilters) {
0d31c8be7c31 new MissingRelations feature and UI.
Robert Casties <casties@mpiwg-berlin.mpg.de>
parents: 173
diff changeset
178 logger.debug("Start searchByRelations...");
0d31c8be7c31 new MissingRelations feature and UI.
Robert Casties <casties@mpiwg-berlin.mpg.de>
parents: 173
diff changeset
179 this.resultMode = MODE_ADVANCED;
0d31c8be7c31 new MissingRelations feature and UI.
Robert Casties <casties@mpiwg-berlin.mpg.de>
parents: 173
diff changeset
180 this.setPage("");
0d31c8be7c31 new MissingRelations feature and UI.
Robert Casties <casties@mpiwg-berlin.mpg.de>
parents: 173
diff changeset
181 this.entities = new ArrayList<Entity>();
0d31c8be7c31 new MissingRelations feature and UI.
Robert Casties <casties@mpiwg-berlin.mpg.de>
parents: 173
diff changeset
182 this.currentEntities = new ArrayList<Entity>();
0d31c8be7c31 new MissingRelations feature and UI.
Robert Casties <casties@mpiwg-berlin.mpg.de>
parents: 173
diff changeset
183 this.resultSummaryMsg = "";
0d31c8be7c31 new MissingRelations feature and UI.
Robert Casties <casties@mpiwg-berlin.mpg.de>
parents: 173
diff changeset
184
0d31c8be7c31 new MissingRelations feature and UI.
Robert Casties <casties@mpiwg-berlin.mpg.de>
parents: 173
diff changeset
185 /*
0d31c8be7c31 new MissingRelations feature and UI.
Robert Casties <casties@mpiwg-berlin.mpg.de>
parents: 173
diff changeset
186 * get all entities and filter result (by relation)
0d31c8be7c31 new MissingRelations feature and UI.
Robert Casties <casties@mpiwg-berlin.mpg.de>
parents: 173
diff changeset
187 */
0d31c8be7c31 new MissingRelations feature and UI.
Robert Casties <casties@mpiwg-berlin.mpg.de>
parents: 173
diff changeset
188 List<Entity> resultList = getWrapper().getEntitiesByDef(this.objectClass);
0d31c8be7c31 new MissingRelations feature and UI.
Robert Casties <casties@mpiwg-berlin.mpg.de>
parents: 173
diff changeset
189 for (Entity entity : resultList) {
0d31c8be7c31 new MissingRelations feature and UI.
Robert Casties <casties@mpiwg-berlin.mpg.de>
parents: 173
diff changeset
190 if (entity.isLightweight()) {
0d31c8be7c31 new MissingRelations feature and UI.
Robert Casties <casties@mpiwg-berlin.mpg.de>
parents: 173
diff changeset
191 entity = getWrapper().getEntityContent(entity);
0d31c8be7c31 new MissingRelations feature and UI.
Robert Casties <casties@mpiwg-berlin.mpg.de>
parents: 173
diff changeset
192 }
0d31c8be7c31 new MissingRelations feature and UI.
Robert Casties <casties@mpiwg-berlin.mpg.de>
parents: 173
diff changeset
193 boolean condFailed = false;
0d31c8be7c31 new MissingRelations feature and UI.
Robert Casties <casties@mpiwg-berlin.mpg.de>
parents: 173
diff changeset
194 for (RelationFilter filter :relationFilters) {
0d31c8be7c31 new MissingRelations feature and UI.
Robert Casties <casties@mpiwg-berlin.mpg.de>
parents: 173
diff changeset
195 if (filter.tarObjectClass != null) {
0d31c8be7c31 new MissingRelations feature and UI.
Robert Casties <casties@mpiwg-berlin.mpg.de>
parents: 173
diff changeset
196 List<Relation> rels = entity.getSourceRelations(filter.relObjectClass, filter.tarObjectClass);
0d31c8be7c31 new MissingRelations feature and UI.
Robert Casties <casties@mpiwg-berlin.mpg.de>
parents: 173
diff changeset
197 if (filter.relationMissing) {
0d31c8be7c31 new MissingRelations feature and UI.
Robert Casties <casties@mpiwg-berlin.mpg.de>
parents: 173
diff changeset
198 // is the relation missing?
0d31c8be7c31 new MissingRelations feature and UI.
Robert Casties <casties@mpiwg-berlin.mpg.de>
parents: 173
diff changeset
199 if (!rels.isEmpty()) {
0d31c8be7c31 new MissingRelations feature and UI.
Robert Casties <casties@mpiwg-berlin.mpg.de>
parents: 173
diff changeset
200 condFailed = true;
0d31c8be7c31 new MissingRelations feature and UI.
Robert Casties <casties@mpiwg-berlin.mpg.de>
parents: 173
diff changeset
201 break;
0d31c8be7c31 new MissingRelations feature and UI.
Robert Casties <casties@mpiwg-berlin.mpg.de>
parents: 173
diff changeset
202 }
0d31c8be7c31 new MissingRelations feature and UI.
Robert Casties <casties@mpiwg-berlin.mpg.de>
parents: 173
diff changeset
203 } else {
0d31c8be7c31 new MissingRelations feature and UI.
Robert Casties <casties@mpiwg-berlin.mpg.de>
parents: 173
diff changeset
204 if (rels.isEmpty()) {
0d31c8be7c31 new MissingRelations feature and UI.
Robert Casties <casties@mpiwg-berlin.mpg.de>
parents: 173
diff changeset
205 condFailed = true;
0d31c8be7c31 new MissingRelations feature and UI.
Robert Casties <casties@mpiwg-berlin.mpg.de>
parents: 173
diff changeset
206 break;
0d31c8be7c31 new MissingRelations feature and UI.
Robert Casties <casties@mpiwg-berlin.mpg.de>
parents: 173
diff changeset
207 }
0d31c8be7c31 new MissingRelations feature and UI.
Robert Casties <casties@mpiwg-berlin.mpg.de>
parents: 173
diff changeset
208 }
0d31c8be7c31 new MissingRelations feature and UI.
Robert Casties <casties@mpiwg-berlin.mpg.de>
parents: 173
diff changeset
209 } else if (filter.srcObjectClass != null) {
0d31c8be7c31 new MissingRelations feature and UI.
Robert Casties <casties@mpiwg-berlin.mpg.de>
parents: 173
diff changeset
210 List<Relation> rels = entity.getTargetRelations(filter.relObjectClass, filter.srcObjectClass);
0d31c8be7c31 new MissingRelations feature and UI.
Robert Casties <casties@mpiwg-berlin.mpg.de>
parents: 173
diff changeset
211 if (filter.relationMissing) {
0d31c8be7c31 new MissingRelations feature and UI.
Robert Casties <casties@mpiwg-berlin.mpg.de>
parents: 173
diff changeset
212 // is the relation missing?
0d31c8be7c31 new MissingRelations feature and UI.
Robert Casties <casties@mpiwg-berlin.mpg.de>
parents: 173
diff changeset
213 if (!rels.isEmpty()) {
0d31c8be7c31 new MissingRelations feature and UI.
Robert Casties <casties@mpiwg-berlin.mpg.de>
parents: 173
diff changeset
214 condFailed = true;
0d31c8be7c31 new MissingRelations feature and UI.
Robert Casties <casties@mpiwg-berlin.mpg.de>
parents: 173
diff changeset
215 break;
0d31c8be7c31 new MissingRelations feature and UI.
Robert Casties <casties@mpiwg-berlin.mpg.de>
parents: 173
diff changeset
216 }
0d31c8be7c31 new MissingRelations feature and UI.
Robert Casties <casties@mpiwg-berlin.mpg.de>
parents: 173
diff changeset
217 } else {
0d31c8be7c31 new MissingRelations feature and UI.
Robert Casties <casties@mpiwg-berlin.mpg.de>
parents: 173
diff changeset
218 if (rels.isEmpty()) {
0d31c8be7c31 new MissingRelations feature and UI.
Robert Casties <casties@mpiwg-berlin.mpg.de>
parents: 173
diff changeset
219 condFailed = true;
0d31c8be7c31 new MissingRelations feature and UI.
Robert Casties <casties@mpiwg-berlin.mpg.de>
parents: 173
diff changeset
220 break;
0d31c8be7c31 new MissingRelations feature and UI.
Robert Casties <casties@mpiwg-berlin.mpg.de>
parents: 173
diff changeset
221 }
0d31c8be7c31 new MissingRelations feature and UI.
Robert Casties <casties@mpiwg-berlin.mpg.de>
parents: 173
diff changeset
222 }
0d31c8be7c31 new MissingRelations feature and UI.
Robert Casties <casties@mpiwg-berlin.mpg.de>
parents: 173
diff changeset
223 }
0d31c8be7c31 new MissingRelations feature and UI.
Robert Casties <casties@mpiwg-berlin.mpg.de>
parents: 173
diff changeset
224 }
0d31c8be7c31 new MissingRelations feature and UI.
Robert Casties <casties@mpiwg-berlin.mpg.de>
parents: 173
diff changeset
225 if (!condFailed) {
0d31c8be7c31 new MissingRelations feature and UI.
Robert Casties <casties@mpiwg-berlin.mpg.de>
parents: 173
diff changeset
226 // all conditions matched
0d31c8be7c31 new MissingRelations feature and UI.
Robert Casties <casties@mpiwg-berlin.mpg.de>
parents: 173
diff changeset
227 entities.add(entity);
0d31c8be7c31 new MissingRelations feature and UI.
Robert Casties <casties@mpiwg-berlin.mpg.de>
parents: 173
diff changeset
228 }
0d31c8be7c31 new MissingRelations feature and UI.
Robert Casties <casties@mpiwg-berlin.mpg.de>
parents: 173
diff changeset
229 }
0d31c8be7c31 new MissingRelations feature and UI.
Robert Casties <casties@mpiwg-berlin.mpg.de>
parents: 173
diff changeset
230
0d31c8be7c31 new MissingRelations feature and UI.
Robert Casties <casties@mpiwg-berlin.mpg.de>
parents: 173
diff changeset
231 // sort List (by ownValue)
0d31c8be7c31 new MissingRelations feature and UI.
Robert Casties <casties@mpiwg-berlin.mpg.de>
parents: 173
diff changeset
232 Collections.sort(entities);
0d31c8be7c31 new MissingRelations feature and UI.
Robert Casties <casties@mpiwg-berlin.mpg.de>
parents: 173
diff changeset
233
0d31c8be7c31 new MissingRelations feature and UI.
Robert Casties <casties@mpiwg-berlin.mpg.de>
parents: 173
diff changeset
234 if (entities.size() > 0) {
0d31c8be7c31 new MissingRelations feature and UI.
Robert Casties <casties@mpiwg-berlin.mpg.de>
parents: 173
diff changeset
235 int entitiesCount = entities.size();
0d31c8be7c31 new MissingRelations feature and UI.
Robert Casties <casties@mpiwg-berlin.mpg.de>
parents: 173
diff changeset
236 this.resultSummaryMsg = entitiesCount + " items were found!";
0d31c8be7c31 new MissingRelations feature and UI.
Robert Casties <casties@mpiwg-berlin.mpg.de>
parents: 173
diff changeset
237 this.advancedPaginator.setCurrentPage(0);
0d31c8be7c31 new MissingRelations feature and UI.
Robert Casties <casties@mpiwg-berlin.mpg.de>
parents: 173
diff changeset
238 this.advancedPaginator.resetNumberOfPages(entitiesCount);
0d31c8be7c31 new MissingRelations feature and UI.
Robert Casties <casties@mpiwg-berlin.mpg.de>
parents: 173
diff changeset
239 this.updateAdvancedEntities();
0d31c8be7c31 new MissingRelations feature and UI.
Robert Casties <casties@mpiwg-berlin.mpg.de>
parents: 173
diff changeset
240 } else {
0d31c8be7c31 new MissingRelations feature and UI.
Robert Casties <casties@mpiwg-berlin.mpg.de>
parents: 173
diff changeset
241 this.resultSummaryMsg = "No items were found!";
0d31c8be7c31 new MissingRelations feature and UI.
Robert Casties <casties@mpiwg-berlin.mpg.de>
parents: 173
diff changeset
242 }
0d31c8be7c31 new MissingRelations feature and UI.
Robert Casties <casties@mpiwg-berlin.mpg.de>
parents: 173
diff changeset
243 logger.debug("Done searchByRelations.");
0d31c8be7c31 new MissingRelations feature and UI.
Robert Casties <casties@mpiwg-berlin.mpg.de>
parents: 173
diff changeset
244 }
173
aa564b1b5e1f publicByAuthor feature ui for selecting texts ready.
Robert Casties <casties@mpiwg-berlin.mpg.de>
parents: 169
diff changeset
245
aa564b1b5e1f publicByAuthor feature ui for selecting texts ready.
Robert Casties <casties@mpiwg-berlin.mpg.de>
parents: 169
diff changeset
246 /**
aa564b1b5e1f publicByAuthor feature ui for selecting texts ready.
Robert Casties <casties@mpiwg-berlin.mpg.de>
parents: 169
diff changeset
247 * @return the sortAttributeName
aa564b1b5e1f publicByAuthor feature ui for selecting texts ready.
Robert Casties <casties@mpiwg-berlin.mpg.de>
parents: 169
diff changeset
248 */
aa564b1b5e1f publicByAuthor feature ui for selecting texts ready.
Robert Casties <casties@mpiwg-berlin.mpg.de>
parents: 169
diff changeset
249 public String getSortAttributeName() {
aa564b1b5e1f publicByAuthor feature ui for selecting texts ready.
Robert Casties <casties@mpiwg-berlin.mpg.de>
parents: 169
diff changeset
250 return sortAttributeName;
aa564b1b5e1f publicByAuthor feature ui for selecting texts ready.
Robert Casties <casties@mpiwg-berlin.mpg.de>
parents: 169
diff changeset
251 }
aa564b1b5e1f publicByAuthor feature ui for selecting texts ready.
Robert Casties <casties@mpiwg-berlin.mpg.de>
parents: 169
diff changeset
252
aa564b1b5e1f publicByAuthor feature ui for selecting texts ready.
Robert Casties <casties@mpiwg-berlin.mpg.de>
parents: 169
diff changeset
253 /**
aa564b1b5e1f publicByAuthor feature ui for selecting texts ready.
Robert Casties <casties@mpiwg-berlin.mpg.de>
parents: 169
diff changeset
254 * @param sortAttributeName
aa564b1b5e1f publicByAuthor feature ui for selecting texts ready.
Robert Casties <casties@mpiwg-berlin.mpg.de>
parents: 169
diff changeset
255 * the sortAttributeName to set
aa564b1b5e1f publicByAuthor feature ui for selecting texts ready.
Robert Casties <casties@mpiwg-berlin.mpg.de>
parents: 169
diff changeset
256 */
aa564b1b5e1f publicByAuthor feature ui for selecting texts ready.
Robert Casties <casties@mpiwg-berlin.mpg.de>
parents: 169
diff changeset
257 public void setSortAttributeName(String sortAttributeName) {
aa564b1b5e1f publicByAuthor feature ui for selecting texts ready.
Robert Casties <casties@mpiwg-berlin.mpg.de>
parents: 169
diff changeset
258 this.sortAttributeName = sortAttributeName;
aa564b1b5e1f publicByAuthor feature ui for selecting texts ready.
Robert Casties <casties@mpiwg-berlin.mpg.de>
parents: 169
diff changeset
259 }
aa564b1b5e1f publicByAuthor feature ui for selecting texts ready.
Robert Casties <casties@mpiwg-berlin.mpg.de>
parents: 169
diff changeset
260
aa564b1b5e1f publicByAuthor feature ui for selecting texts ready.
Robert Casties <casties@mpiwg-berlin.mpg.de>
parents: 169
diff changeset
261 /**
aa564b1b5e1f publicByAuthor feature ui for selecting texts ready.
Robert Casties <casties@mpiwg-berlin.mpg.de>
parents: 169
diff changeset
262 * @return the sortAttributeNumerical
aa564b1b5e1f publicByAuthor feature ui for selecting texts ready.
Robert Casties <casties@mpiwg-berlin.mpg.de>
parents: 169
diff changeset
263 */
aa564b1b5e1f publicByAuthor feature ui for selecting texts ready.
Robert Casties <casties@mpiwg-berlin.mpg.de>
parents: 169
diff changeset
264 public boolean isSortAttributeNumerically() {
aa564b1b5e1f publicByAuthor feature ui for selecting texts ready.
Robert Casties <casties@mpiwg-berlin.mpg.de>
parents: 169
diff changeset
265 return sortAttributeNumerically;
aa564b1b5e1f publicByAuthor feature ui for selecting texts ready.
Robert Casties <casties@mpiwg-berlin.mpg.de>
parents: 169
diff changeset
266 }
aa564b1b5e1f publicByAuthor feature ui for selecting texts ready.
Robert Casties <casties@mpiwg-berlin.mpg.de>
parents: 169
diff changeset
267
aa564b1b5e1f publicByAuthor feature ui for selecting texts ready.
Robert Casties <casties@mpiwg-berlin.mpg.de>
parents: 169
diff changeset
268 /**
aa564b1b5e1f publicByAuthor feature ui for selecting texts ready.
Robert Casties <casties@mpiwg-berlin.mpg.de>
parents: 169
diff changeset
269 * @param sortAttributeNumerical
aa564b1b5e1f publicByAuthor feature ui for selecting texts ready.
Robert Casties <casties@mpiwg-berlin.mpg.de>
parents: 169
diff changeset
270 * the sortAttributeNumerical to set
aa564b1b5e1f publicByAuthor feature ui for selecting texts ready.
Robert Casties <casties@mpiwg-berlin.mpg.de>
parents: 169
diff changeset
271 */
aa564b1b5e1f publicByAuthor feature ui for selecting texts ready.
Robert Casties <casties@mpiwg-berlin.mpg.de>
parents: 169
diff changeset
272 public void setSortAttributeNumerically(boolean sortAttributeNumerical) {
aa564b1b5e1f publicByAuthor feature ui for selecting texts ready.
Robert Casties <casties@mpiwg-berlin.mpg.de>
parents: 169
diff changeset
273 this.sortAttributeNumerically = sortAttributeNumerical;
aa564b1b5e1f publicByAuthor feature ui for selecting texts ready.
Robert Casties <casties@mpiwg-berlin.mpg.de>
parents: 169
diff changeset
274 }
169
0b5d02012299 more work on publicByAuthor feature.
Robert Casties <casties@mpiwg-berlin.mpg.de>
parents:
diff changeset
275 }