Mercurial > hg > ismi-richfaces
comparison 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 |
comparison
equal
deleted
inserted
replaced
187:be6bc580b137 | 188:34ac2e1b323a |
---|---|
95 */ | 95 */ |
96 List<Entity> resultList = getWrapper().getEntitiesByDef(this.objectClass); | 96 List<Entity> resultList = getWrapper().getEntitiesByDef(this.objectClass); |
97 // sort List (by attribute) | 97 // sort List (by attribute) |
98 Collections.sort(resultList, | 98 Collections.sort(resultList, |
99 getEntityAttributeComparator(this.sortAttributeName, this.sortAttributeNumerically)); | 99 getEntityAttributeComparator(this.sortAttributeName, this.sortAttributeNumerically)); |
100 | |
101 updateEntities(resultList); | |
102 logger.debug("Done sortByAttributes."); | |
103 } | |
104 | |
105 /** | |
106 * Update paginator and summary message with new entities list. | |
107 * | |
108 * @param resultList | |
109 */ | |
110 public void updateEntities(List<Entity> resultList) { | |
100 this.entities = resultList; | 111 this.entities = resultList; |
101 | 112 if (resultList.size() > 0) { |
102 if (resultList.size() > 0) { | 113 int entitiesCount = this.entities.size(); |
103 this.resultSummaryMsg = resultList.size() + " items were found!"; | 114 this.resultSummaryMsg = entitiesCount + " items were found!"; |
104 this.advancedPaginator.setCurrentPage(0); | 115 this.advancedPaginator.setCurrentPage(0); |
105 int entitiesCount = this.entities.size(); | |
106 this.advancedPaginator.resetNumberOfPages(entitiesCount); | 116 this.advancedPaginator.resetNumberOfPages(entitiesCount); |
107 this.updateAdvancedEntities(); | 117 this.updateAdvancedEntities(); |
108 } else { | 118 } else { |
109 this.resultSummaryMsg = "No items were found!"; | 119 this.resultSummaryMsg = "No items were found!"; |
110 } | 120 this.currentEntities = resultList; |
111 logger.debug("Done sortByAttributes."); | 121 } |
112 } | 122 } |
113 | 123 |
114 /** | 124 /** |
115 * Returns Comparator for Entities that uses the Attribute attname. | 125 * Returns Comparator for Entities that uses the Attribute attname. |
116 * | 126 * |
117 * Sorts as integer if numerically. | 127 * Sorts as integer if numerically. |
228 } | 238 } |
229 } | 239 } |
230 | 240 |
231 // sort List (by ownValue) | 241 // sort List (by ownValue) |
232 Collections.sort(entities); | 242 Collections.sort(entities); |
233 | 243 |
234 if (entities.size() > 0) { | 244 updateEntities(entities); |
235 int entitiesCount = entities.size(); | |
236 this.resultSummaryMsg = entitiesCount + " items were found!"; | |
237 this.advancedPaginator.setCurrentPage(0); | |
238 this.advancedPaginator.resetNumberOfPages(entitiesCount); | |
239 this.updateAdvancedEntities(); | |
240 } else { | |
241 this.resultSummaryMsg = "No items were found!"; | |
242 } | |
243 logger.debug("Done searchByRelations."); | 245 logger.debug("Done searchByRelations."); |
244 } | 246 } |
245 | 247 |
246 /** | 248 /** |
247 * @return the sortAttributeName | 249 * @return the sortAttributeName |