annotate src/main/java/de/mpiwg/itgroup/ismi/browse/FullEntityRepositoryBean.java @ 188:34ac2e1b323a

new Clean UI to find non-public digitalizations of public codices and make them public.
author Robert Casties <casties@mpiwg-berlin.mpg.de>
date Tue, 06 Nov 2018 20:05:49 +0100
parents 0d31c8be7c31
children b36a57a452a6
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));
188
34ac2e1b323a new Clean UI to find non-public digitalizations of public codices and make them public.
Robert Casties <casties@mpiwg-berlin.mpg.de>
parents: 180
diff changeset
100
34ac2e1b323a new Clean UI to find non-public digitalizations of public codices and make them public.
Robert Casties <casties@mpiwg-berlin.mpg.de>
parents: 180
diff changeset
101 updateEntities(resultList);
34ac2e1b323a new Clean UI to find non-public digitalizations of public codices and make them public.
Robert Casties <casties@mpiwg-berlin.mpg.de>
parents: 180
diff changeset
102 logger.debug("Done sortByAttributes.");
34ac2e1b323a new Clean UI to find non-public digitalizations of public codices and make them public.
Robert Casties <casties@mpiwg-berlin.mpg.de>
parents: 180
diff changeset
103 }
173
aa564b1b5e1f publicByAuthor feature ui for selecting texts ready.
Robert Casties <casties@mpiwg-berlin.mpg.de>
parents: 169
diff changeset
104
188
34ac2e1b323a new Clean UI to find non-public digitalizations of public codices and make them public.
Robert Casties <casties@mpiwg-berlin.mpg.de>
parents: 180
diff changeset
105 /**
34ac2e1b323a new Clean UI to find non-public digitalizations of public codices and make them public.
Robert Casties <casties@mpiwg-berlin.mpg.de>
parents: 180
diff changeset
106 * Update paginator and summary message with new entities list.
34ac2e1b323a new Clean UI to find non-public digitalizations of public codices and make them public.
Robert Casties <casties@mpiwg-berlin.mpg.de>
parents: 180
diff changeset
107 *
34ac2e1b323a new Clean UI to find non-public digitalizations of public codices and make them public.
Robert Casties <casties@mpiwg-berlin.mpg.de>
parents: 180
diff changeset
108 * @param resultList
34ac2e1b323a new Clean UI to find non-public digitalizations of public codices and make them public.
Robert Casties <casties@mpiwg-berlin.mpg.de>
parents: 180
diff changeset
109 */
34ac2e1b323a new Clean UI to find non-public digitalizations of public codices and make them public.
Robert Casties <casties@mpiwg-berlin.mpg.de>
parents: 180
diff changeset
110 public void updateEntities(List<Entity> resultList) {
34ac2e1b323a new Clean UI to find non-public digitalizations of public codices and make them public.
Robert Casties <casties@mpiwg-berlin.mpg.de>
parents: 180
diff changeset
111 this.entities = resultList;
34ac2e1b323a new Clean UI to find non-public digitalizations of public codices and make them public.
Robert Casties <casties@mpiwg-berlin.mpg.de>
parents: 180
diff changeset
112 if (resultList.size() > 0) {
34ac2e1b323a new Clean UI to find non-public digitalizations of public codices and make them public.
Robert Casties <casties@mpiwg-berlin.mpg.de>
parents: 180
diff changeset
113 int entitiesCount = this.entities.size();
34ac2e1b323a new Clean UI to find non-public digitalizations of public codices and make them public.
Robert Casties <casties@mpiwg-berlin.mpg.de>
parents: 180
diff changeset
114 this.resultSummaryMsg = entitiesCount + " items were found!";
173
aa564b1b5e1f publicByAuthor feature ui for selecting texts ready.
Robert Casties <casties@mpiwg-berlin.mpg.de>
parents: 169
diff changeset
115 this.advancedPaginator.setCurrentPage(0);
aa564b1b5e1f publicByAuthor feature ui for selecting texts ready.
Robert Casties <casties@mpiwg-berlin.mpg.de>
parents: 169
diff changeset
116 this.advancedPaginator.resetNumberOfPages(entitiesCount);
aa564b1b5e1f publicByAuthor feature ui for selecting texts ready.
Robert Casties <casties@mpiwg-berlin.mpg.de>
parents: 169
diff changeset
117 this.updateAdvancedEntities();
aa564b1b5e1f publicByAuthor feature ui for selecting texts ready.
Robert Casties <casties@mpiwg-berlin.mpg.de>
parents: 169
diff changeset
118 } else {
aa564b1b5e1f publicByAuthor feature ui for selecting texts ready.
Robert Casties <casties@mpiwg-berlin.mpg.de>
parents: 169
diff changeset
119 this.resultSummaryMsg = "No items were found!";
188
34ac2e1b323a new Clean UI to find non-public digitalizations of public codices and make them public.
Robert Casties <casties@mpiwg-berlin.mpg.de>
parents: 180
diff changeset
120 this.currentEntities = resultList;
173
aa564b1b5e1f publicByAuthor feature ui for selecting texts ready.
Robert Casties <casties@mpiwg-berlin.mpg.de>
parents: 169
diff changeset
121 }
188
34ac2e1b323a new Clean UI to find non-public digitalizations of public codices and make them public.
Robert Casties <casties@mpiwg-berlin.mpg.de>
parents: 180
diff changeset
122 }
173
aa564b1b5e1f publicByAuthor feature ui for selecting texts ready.
Robert Casties <casties@mpiwg-berlin.mpg.de>
parents: 169
diff changeset
123
180
0d31c8be7c31 new MissingRelations feature and UI.
Robert Casties <casties@mpiwg-berlin.mpg.de>
parents: 173
diff changeset
124 /**
0d31c8be7c31 new MissingRelations feature and UI.
Robert Casties <casties@mpiwg-berlin.mpg.de>
parents: 173
diff changeset
125 * 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
126 *
0d31c8be7c31 new MissingRelations feature and UI.
Robert Casties <casties@mpiwg-berlin.mpg.de>
parents: 173
diff changeset
127 * Sorts as integer if numerically.
0d31c8be7c31 new MissingRelations feature and UI.
Robert Casties <casties@mpiwg-berlin.mpg.de>
parents: 173
diff changeset
128 *
0d31c8be7c31 new MissingRelations feature and UI.
Robert Casties <casties@mpiwg-berlin.mpg.de>
parents: 173
diff changeset
129 * @param attName
0d31c8be7c31 new MissingRelations feature and UI.
Robert Casties <casties@mpiwg-berlin.mpg.de>
parents: 173
diff changeset
130 * @param numerically
0d31c8be7c31 new MissingRelations feature and UI.
Robert Casties <casties@mpiwg-berlin.mpg.de>
parents: 173
diff changeset
131 * @return
0d31c8be7c31 new MissingRelations feature and UI.
Robert Casties <casties@mpiwg-berlin.mpg.de>
parents: 173
diff changeset
132 */
173
aa564b1b5e1f publicByAuthor feature ui for selecting texts ready.
Robert Casties <casties@mpiwg-berlin.mpg.de>
parents: 169
diff changeset
133 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
134 return new Comparator<Entity>() {
aa564b1b5e1f publicByAuthor feature ui for selecting texts ready.
Robert Casties <casties@mpiwg-berlin.mpg.de>
parents: 169
diff changeset
135 @Override
aa564b1b5e1f publicByAuthor feature ui for selecting texts ready.
Robert Casties <casties@mpiwg-berlin.mpg.de>
parents: 169
diff changeset
136 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
137 if (e1.isLightweight()) {
aa564b1b5e1f publicByAuthor feature ui for selecting texts ready.
Robert Casties <casties@mpiwg-berlin.mpg.de>
parents: 169
diff changeset
138 e1 = getWrapper().getEntityContent(e1);
aa564b1b5e1f publicByAuthor feature ui for selecting texts ready.
Robert Casties <casties@mpiwg-berlin.mpg.de>
parents: 169
diff changeset
139 }
aa564b1b5e1f publicByAuthor feature ui for selecting texts ready.
Robert Casties <casties@mpiwg-berlin.mpg.de>
parents: 169
diff changeset
140 Attribute att1 = e1.getAttributeByName(attName);
aa564b1b5e1f publicByAuthor feature ui for selecting texts ready.
Robert Casties <casties@mpiwg-berlin.mpg.de>
parents: 169
diff changeset
141 if (e2.isLightweight()) {
aa564b1b5e1f publicByAuthor feature ui for selecting texts ready.
Robert Casties <casties@mpiwg-berlin.mpg.de>
parents: 169
diff changeset
142 e2 = getWrapper().getEntityContent(e2);
aa564b1b5e1f publicByAuthor feature ui for selecting texts ready.
Robert Casties <casties@mpiwg-berlin.mpg.de>
parents: 169
diff changeset
143 }
aa564b1b5e1f publicByAuthor feature ui for selecting texts ready.
Robert Casties <casties@mpiwg-berlin.mpg.de>
parents: 169
diff changeset
144 Attribute att2 = e2.getAttributeByName(attName);
aa564b1b5e1f publicByAuthor feature ui for selecting texts ready.
Robert Casties <casties@mpiwg-berlin.mpg.de>
parents: 169
diff changeset
145 if (att1 == null && att2 != null) {
aa564b1b5e1f publicByAuthor feature ui for selecting texts ready.
Robert Casties <casties@mpiwg-berlin.mpg.de>
parents: 169
diff changeset
146 return 1;
aa564b1b5e1f publicByAuthor feature ui for selecting texts ready.
Robert Casties <casties@mpiwg-berlin.mpg.de>
parents: 169
diff changeset
147 } 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
148 return -1;
aa564b1b5e1f publicByAuthor feature ui for selecting texts ready.
Robert Casties <casties@mpiwg-berlin.mpg.de>
parents: 169
diff changeset
149 } 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
150 return 0;
aa564b1b5e1f publicByAuthor feature ui for selecting texts ready.
Robert Casties <casties@mpiwg-berlin.mpg.de>
parents: 169
diff changeset
151 }
aa564b1b5e1f publicByAuthor feature ui for selecting texts ready.
Robert Casties <casties@mpiwg-berlin.mpg.de>
parents: 169
diff changeset
152 if (numerically) {
aa564b1b5e1f publicByAuthor feature ui for selecting texts ready.
Robert Casties <casties@mpiwg-berlin.mpg.de>
parents: 169
diff changeset
153 Integer a1 = null;
aa564b1b5e1f publicByAuthor feature ui for selecting texts ready.
Robert Casties <casties@mpiwg-berlin.mpg.de>
parents: 169
diff changeset
154 Integer a2 = null;
aa564b1b5e1f publicByAuthor feature ui for selecting texts ready.
Robert Casties <casties@mpiwg-berlin.mpg.de>
parents: 169
diff changeset
155 try {
aa564b1b5e1f publicByAuthor feature ui for selecting texts ready.
Robert Casties <casties@mpiwg-berlin.mpg.de>
parents: 169
diff changeset
156 a1 = Integer.parseInt(att1.getValue());
aa564b1b5e1f publicByAuthor feature ui for selecting texts ready.
Robert Casties <casties@mpiwg-berlin.mpg.de>
parents: 169
diff changeset
157 } catch (Exception e) {
aa564b1b5e1f publicByAuthor feature ui for selecting texts ready.
Robert Casties <casties@mpiwg-berlin.mpg.de>
parents: 169
diff changeset
158 }
aa564b1b5e1f publicByAuthor feature ui for selecting texts ready.
Robert Casties <casties@mpiwg-berlin.mpg.de>
parents: 169
diff changeset
159 try {
aa564b1b5e1f publicByAuthor feature ui for selecting texts ready.
Robert Casties <casties@mpiwg-berlin.mpg.de>
parents: 169
diff changeset
160 a2 = Integer.parseInt(att2.getValue());
aa564b1b5e1f publicByAuthor feature ui for selecting texts ready.
Robert Casties <casties@mpiwg-berlin.mpg.de>
parents: 169
diff changeset
161 } catch (Exception e) {
aa564b1b5e1f publicByAuthor feature ui for selecting texts ready.
Robert Casties <casties@mpiwg-berlin.mpg.de>
parents: 169
diff changeset
162 }
aa564b1b5e1f publicByAuthor feature ui for selecting texts ready.
Robert Casties <casties@mpiwg-berlin.mpg.de>
parents: 169
diff changeset
163 if (a1 == null && a2 != null) {
aa564b1b5e1f publicByAuthor feature ui for selecting texts ready.
Robert Casties <casties@mpiwg-berlin.mpg.de>
parents: 169
diff changeset
164 return 1;
aa564b1b5e1f publicByAuthor feature ui for selecting texts ready.
Robert Casties <casties@mpiwg-berlin.mpg.de>
parents: 169
diff changeset
165 } 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
166 return -1;
aa564b1b5e1f publicByAuthor feature ui for selecting texts ready.
Robert Casties <casties@mpiwg-berlin.mpg.de>
parents: 169
diff changeset
167 } 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
168 return 0;
aa564b1b5e1f publicByAuthor feature ui for selecting texts ready.
Robert Casties <casties@mpiwg-berlin.mpg.de>
parents: 169
diff changeset
169 }
aa564b1b5e1f publicByAuthor feature ui for selecting texts ready.
Robert Casties <casties@mpiwg-berlin.mpg.de>
parents: 169
diff changeset
170 return Integer.compare(a1, a2);
aa564b1b5e1f publicByAuthor feature ui for selecting texts ready.
Robert Casties <casties@mpiwg-berlin.mpg.de>
parents: 169
diff changeset
171 } else {
aa564b1b5e1f publicByAuthor feature ui for selecting texts ready.
Robert Casties <casties@mpiwg-berlin.mpg.de>
parents: 169
diff changeset
172 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
173 }
aa564b1b5e1f publicByAuthor feature ui for selecting texts ready.
Robert Casties <casties@mpiwg-berlin.mpg.de>
parents: 169
diff changeset
174 }
aa564b1b5e1f publicByAuthor feature ui for selecting texts ready.
Robert Casties <casties@mpiwg-berlin.mpg.de>
parents: 169
diff changeset
175 };
aa564b1b5e1f publicByAuthor feature ui for selecting texts ready.
Robert Casties <casties@mpiwg-berlin.mpg.de>
parents: 169
diff changeset
176 }
180
0d31c8be7c31 new MissingRelations feature and UI.
Robert Casties <casties@mpiwg-berlin.mpg.de>
parents: 173
diff changeset
177
0d31c8be7c31 new MissingRelations feature and UI.
Robert Casties <casties@mpiwg-berlin.mpg.de>
parents: 173
diff changeset
178 /**
0d31c8be7c31 new MissingRelations feature and UI.
Robert Casties <casties@mpiwg-berlin.mpg.de>
parents: 173
diff changeset
179 * 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
180 *
0d31c8be7c31 new MissingRelations feature and UI.
Robert Casties <casties@mpiwg-berlin.mpg.de>
parents: 173
diff changeset
181 * 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
182 *
0d31c8be7c31 new MissingRelations feature and UI.
Robert Casties <casties@mpiwg-berlin.mpg.de>
parents: 173
diff changeset
183 * Requires all RelationFilters to match.
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 * @throws Exception
0d31c8be7c31 new MissingRelations feature and UI.
Robert Casties <casties@mpiwg-berlin.mpg.de>
parents: 173
diff changeset
186 */
0d31c8be7c31 new MissingRelations feature and UI.
Robert Casties <casties@mpiwg-berlin.mpg.de>
parents: 173
diff changeset
187 public void searchByRelations(List<RelationFilter> relationFilters) {
0d31c8be7c31 new MissingRelations feature and UI.
Robert Casties <casties@mpiwg-berlin.mpg.de>
parents: 173
diff changeset
188 logger.debug("Start searchByRelations...");
0d31c8be7c31 new MissingRelations feature and UI.
Robert Casties <casties@mpiwg-berlin.mpg.de>
parents: 173
diff changeset
189 this.resultMode = MODE_ADVANCED;
0d31c8be7c31 new MissingRelations feature and UI.
Robert Casties <casties@mpiwg-berlin.mpg.de>
parents: 173
diff changeset
190 this.setPage("");
0d31c8be7c31 new MissingRelations feature and UI.
Robert Casties <casties@mpiwg-berlin.mpg.de>
parents: 173
diff changeset
191 this.entities = new ArrayList<Entity>();
0d31c8be7c31 new MissingRelations feature and UI.
Robert Casties <casties@mpiwg-berlin.mpg.de>
parents: 173
diff changeset
192 this.currentEntities = new ArrayList<Entity>();
0d31c8be7c31 new MissingRelations feature and UI.
Robert Casties <casties@mpiwg-berlin.mpg.de>
parents: 173
diff changeset
193 this.resultSummaryMsg = "";
0d31c8be7c31 new MissingRelations feature and UI.
Robert Casties <casties@mpiwg-berlin.mpg.de>
parents: 173
diff changeset
194
0d31c8be7c31 new MissingRelations feature and UI.
Robert Casties <casties@mpiwg-berlin.mpg.de>
parents: 173
diff changeset
195 /*
0d31c8be7c31 new MissingRelations feature and UI.
Robert Casties <casties@mpiwg-berlin.mpg.de>
parents: 173
diff changeset
196 * 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
197 */
0d31c8be7c31 new MissingRelations feature and UI.
Robert Casties <casties@mpiwg-berlin.mpg.de>
parents: 173
diff changeset
198 List<Entity> resultList = getWrapper().getEntitiesByDef(this.objectClass);
0d31c8be7c31 new MissingRelations feature and UI.
Robert Casties <casties@mpiwg-berlin.mpg.de>
parents: 173
diff changeset
199 for (Entity entity : resultList) {
0d31c8be7c31 new MissingRelations feature and UI.
Robert Casties <casties@mpiwg-berlin.mpg.de>
parents: 173
diff changeset
200 if (entity.isLightweight()) {
0d31c8be7c31 new MissingRelations feature and UI.
Robert Casties <casties@mpiwg-berlin.mpg.de>
parents: 173
diff changeset
201 entity = getWrapper().getEntityContent(entity);
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 boolean condFailed = false;
0d31c8be7c31 new MissingRelations feature and UI.
Robert Casties <casties@mpiwg-berlin.mpg.de>
parents: 173
diff changeset
204 for (RelationFilter filter :relationFilters) {
0d31c8be7c31 new MissingRelations feature and UI.
Robert Casties <casties@mpiwg-berlin.mpg.de>
parents: 173
diff changeset
205 if (filter.tarObjectClass != null) {
0d31c8be7c31 new MissingRelations feature and UI.
Robert Casties <casties@mpiwg-berlin.mpg.de>
parents: 173
diff changeset
206 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
207 if (filter.relationMissing) {
0d31c8be7c31 new MissingRelations feature and UI.
Robert Casties <casties@mpiwg-berlin.mpg.de>
parents: 173
diff changeset
208 // is the relation missing?
0d31c8be7c31 new MissingRelations feature and UI.
Robert Casties <casties@mpiwg-berlin.mpg.de>
parents: 173
diff changeset
209 if (!rels.isEmpty()) {
0d31c8be7c31 new MissingRelations feature and UI.
Robert Casties <casties@mpiwg-berlin.mpg.de>
parents: 173
diff changeset
210 condFailed = true;
0d31c8be7c31 new MissingRelations feature and UI.
Robert Casties <casties@mpiwg-berlin.mpg.de>
parents: 173
diff changeset
211 break;
0d31c8be7c31 new MissingRelations feature and UI.
Robert Casties <casties@mpiwg-berlin.mpg.de>
parents: 173
diff changeset
212 }
0d31c8be7c31 new MissingRelations feature and UI.
Robert Casties <casties@mpiwg-berlin.mpg.de>
parents: 173
diff changeset
213 } else {
0d31c8be7c31 new MissingRelations feature and UI.
Robert Casties <casties@mpiwg-berlin.mpg.de>
parents: 173
diff changeset
214 if (rels.isEmpty()) {
0d31c8be7c31 new MissingRelations feature and UI.
Robert Casties <casties@mpiwg-berlin.mpg.de>
parents: 173
diff changeset
215 condFailed = true;
0d31c8be7c31 new MissingRelations feature and UI.
Robert Casties <casties@mpiwg-berlin.mpg.de>
parents: 173
diff changeset
216 break;
0d31c8be7c31 new MissingRelations feature and UI.
Robert Casties <casties@mpiwg-berlin.mpg.de>
parents: 173
diff changeset
217 }
0d31c8be7c31 new MissingRelations feature and UI.
Robert Casties <casties@mpiwg-berlin.mpg.de>
parents: 173
diff changeset
218 }
0d31c8be7c31 new MissingRelations feature and UI.
Robert Casties <casties@mpiwg-berlin.mpg.de>
parents: 173
diff changeset
219 } else if (filter.srcObjectClass != null) {
0d31c8be7c31 new MissingRelations feature and UI.
Robert Casties <casties@mpiwg-berlin.mpg.de>
parents: 173
diff changeset
220 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
221 if (filter.relationMissing) {
0d31c8be7c31 new MissingRelations feature and UI.
Robert Casties <casties@mpiwg-berlin.mpg.de>
parents: 173
diff changeset
222 // is the relation missing?
0d31c8be7c31 new MissingRelations feature and UI.
Robert Casties <casties@mpiwg-berlin.mpg.de>
parents: 173
diff changeset
223 if (!rels.isEmpty()) {
0d31c8be7c31 new MissingRelations feature and UI.
Robert Casties <casties@mpiwg-berlin.mpg.de>
parents: 173
diff changeset
224 condFailed = true;
0d31c8be7c31 new MissingRelations feature and UI.
Robert Casties <casties@mpiwg-berlin.mpg.de>
parents: 173
diff changeset
225 break;
0d31c8be7c31 new MissingRelations feature and UI.
Robert Casties <casties@mpiwg-berlin.mpg.de>
parents: 173
diff changeset
226 }
0d31c8be7c31 new MissingRelations feature and UI.
Robert Casties <casties@mpiwg-berlin.mpg.de>
parents: 173
diff changeset
227 } else {
0d31c8be7c31 new MissingRelations feature and UI.
Robert Casties <casties@mpiwg-berlin.mpg.de>
parents: 173
diff changeset
228 if (rels.isEmpty()) {
0d31c8be7c31 new MissingRelations feature and UI.
Robert Casties <casties@mpiwg-berlin.mpg.de>
parents: 173
diff changeset
229 condFailed = true;
0d31c8be7c31 new MissingRelations feature and UI.
Robert Casties <casties@mpiwg-berlin.mpg.de>
parents: 173
diff changeset
230 break;
0d31c8be7c31 new MissingRelations feature and UI.
Robert Casties <casties@mpiwg-berlin.mpg.de>
parents: 173
diff changeset
231 }
0d31c8be7c31 new MissingRelations feature and UI.
Robert Casties <casties@mpiwg-berlin.mpg.de>
parents: 173
diff changeset
232 }
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 }
0d31c8be7c31 new MissingRelations feature and UI.
Robert Casties <casties@mpiwg-berlin.mpg.de>
parents: 173
diff changeset
235 if (!condFailed) {
0d31c8be7c31 new MissingRelations feature and UI.
Robert Casties <casties@mpiwg-berlin.mpg.de>
parents: 173
diff changeset
236 // all conditions matched
0d31c8be7c31 new MissingRelations feature and UI.
Robert Casties <casties@mpiwg-berlin.mpg.de>
parents: 173
diff changeset
237 entities.add(entity);
0d31c8be7c31 new MissingRelations feature and UI.
Robert Casties <casties@mpiwg-berlin.mpg.de>
parents: 173
diff changeset
238 }
0d31c8be7c31 new MissingRelations feature and UI.
Robert Casties <casties@mpiwg-berlin.mpg.de>
parents: 173
diff changeset
239 }
0d31c8be7c31 new MissingRelations feature and UI.
Robert Casties <casties@mpiwg-berlin.mpg.de>
parents: 173
diff changeset
240
0d31c8be7c31 new MissingRelations feature and UI.
Robert Casties <casties@mpiwg-berlin.mpg.de>
parents: 173
diff changeset
241 // sort List (by ownValue)
0d31c8be7c31 new MissingRelations feature and UI.
Robert Casties <casties@mpiwg-berlin.mpg.de>
parents: 173
diff changeset
242 Collections.sort(entities);
188
34ac2e1b323a new Clean UI to find non-public digitalizations of public codices and make them public.
Robert Casties <casties@mpiwg-berlin.mpg.de>
parents: 180
diff changeset
243
34ac2e1b323a new Clean UI to find non-public digitalizations of public codices and make them public.
Robert Casties <casties@mpiwg-berlin.mpg.de>
parents: 180
diff changeset
244 updateEntities(entities);
180
0d31c8be7c31 new MissingRelations feature and UI.
Robert Casties <casties@mpiwg-berlin.mpg.de>
parents: 173
diff changeset
245 logger.debug("Done searchByRelations.");
0d31c8be7c31 new MissingRelations feature and UI.
Robert Casties <casties@mpiwg-berlin.mpg.de>
parents: 173
diff changeset
246 }
173
aa564b1b5e1f publicByAuthor feature ui for selecting texts ready.
Robert Casties <casties@mpiwg-berlin.mpg.de>
parents: 169
diff changeset
247
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 * @return the sortAttributeName
aa564b1b5e1f publicByAuthor feature ui for selecting texts ready.
Robert Casties <casties@mpiwg-berlin.mpg.de>
parents: 169
diff changeset
250 */
aa564b1b5e1f publicByAuthor feature ui for selecting texts ready.
Robert Casties <casties@mpiwg-berlin.mpg.de>
parents: 169
diff changeset
251 public String getSortAttributeName() {
aa564b1b5e1f publicByAuthor feature ui for selecting texts ready.
Robert Casties <casties@mpiwg-berlin.mpg.de>
parents: 169
diff changeset
252 return sortAttributeName;
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
aa564b1b5e1f publicByAuthor feature ui for selecting texts ready.
Robert Casties <casties@mpiwg-berlin.mpg.de>
parents: 169
diff changeset
255 /**
aa564b1b5e1f publicByAuthor feature ui for selecting texts ready.
Robert Casties <casties@mpiwg-berlin.mpg.de>
parents: 169
diff changeset
256 * @param sortAttributeName
aa564b1b5e1f publicByAuthor feature ui for selecting texts ready.
Robert Casties <casties@mpiwg-berlin.mpg.de>
parents: 169
diff changeset
257 * the sortAttributeName to set
aa564b1b5e1f publicByAuthor feature ui for selecting texts ready.
Robert Casties <casties@mpiwg-berlin.mpg.de>
parents: 169
diff changeset
258 */
aa564b1b5e1f publicByAuthor feature ui for selecting texts ready.
Robert Casties <casties@mpiwg-berlin.mpg.de>
parents: 169
diff changeset
259 public void setSortAttributeName(String sortAttributeName) {
aa564b1b5e1f publicByAuthor feature ui for selecting texts ready.
Robert Casties <casties@mpiwg-berlin.mpg.de>
parents: 169
diff changeset
260 this.sortAttributeName = sortAttributeName;
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
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 * @return the sortAttributeNumerical
aa564b1b5e1f publicByAuthor feature ui for selecting texts ready.
Robert Casties <casties@mpiwg-berlin.mpg.de>
parents: 169
diff changeset
265 */
aa564b1b5e1f publicByAuthor feature ui for selecting texts ready.
Robert Casties <casties@mpiwg-berlin.mpg.de>
parents: 169
diff changeset
266 public boolean isSortAttributeNumerically() {
aa564b1b5e1f publicByAuthor feature ui for selecting texts ready.
Robert Casties <casties@mpiwg-berlin.mpg.de>
parents: 169
diff changeset
267 return sortAttributeNumerically;
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
aa564b1b5e1f publicByAuthor feature ui for selecting texts ready.
Robert Casties <casties@mpiwg-berlin.mpg.de>
parents: 169
diff changeset
270 /**
aa564b1b5e1f publicByAuthor feature ui for selecting texts ready.
Robert Casties <casties@mpiwg-berlin.mpg.de>
parents: 169
diff changeset
271 * @param sortAttributeNumerical
aa564b1b5e1f publicByAuthor feature ui for selecting texts ready.
Robert Casties <casties@mpiwg-berlin.mpg.de>
parents: 169
diff changeset
272 * the sortAttributeNumerical to set
aa564b1b5e1f publicByAuthor feature ui for selecting texts ready.
Robert Casties <casties@mpiwg-berlin.mpg.de>
parents: 169
diff changeset
273 */
aa564b1b5e1f publicByAuthor feature ui for selecting texts ready.
Robert Casties <casties@mpiwg-berlin.mpg.de>
parents: 169
diff changeset
274 public void setSortAttributeNumerically(boolean sortAttributeNumerical) {
aa564b1b5e1f publicByAuthor feature ui for selecting texts ready.
Robert Casties <casties@mpiwg-berlin.mpg.de>
parents: 169
diff changeset
275 this.sortAttributeNumerically = sortAttributeNumerical;
aa564b1b5e1f publicByAuthor feature ui for selecting texts ready.
Robert Casties <casties@mpiwg-berlin.mpg.de>
parents: 169
diff changeset
276 }
169
0b5d02012299 more work on publicByAuthor feature.
Robert Casties <casties@mpiwg-berlin.mpg.de>
parents:
diff changeset
277 }