Revision 65b68496
Added by Andreas Müller over 7 years ago
cdmlib-model/src/main/java/eu/etaxonomy/cdm/model/common/MarkerType.java | ||
---|---|---|
44 | 44 |
private static final UUID uuidImported = UUID.fromString("96878790-4ceb-42a2-9738-a2242079b679"); |
45 | 45 |
private static final UUID uuidToBeChecked = UUID.fromString("34204192-b41d-4857-a1d4-28992bef2a2a"); |
46 | 46 |
private static final UUID uuidIsDoubtful = UUID.fromString("b51325c8-05fe-421a-832b-d86fc249ef6e"); |
47 |
private static final UUID uuidComplete = UUID.fromString("b4b1b2ab-89a8-4ce6-8110-d60b8b1bc433");
|
|
47 |
public static final UUID uuidComplete = UUID.fromString("b4b1b2ab-89a8-4ce6-8110-d60b8b1bc433");
|
|
48 | 48 |
private static final UUID uuidPublish = UUID.fromString("0522c2b3-b21c-400c-80fc-a251c3501dbc"); |
49 | 49 |
private static final UUID uuidInBibliography = UUID.fromString("2cdb492e-3b8b-4784-8c26-25159835231d"); |
50 | 50 |
private static final UUID uuidEndemic = UUID.fromString("efe95ade-8a6c-4a0e-800e-437c8b50c45e"); |
cdmlib-persistence/src/main/java/eu/etaxonomy/cdm/persistence/dao/common/IIdentifiableDao.java | ||
---|---|---|
18 | 18 |
import eu.etaxonomy.cdm.model.common.IdentifiableSource; |
19 | 19 |
import eu.etaxonomy.cdm.model.common.Identifier; |
20 | 20 |
import eu.etaxonomy.cdm.model.common.LSID; |
21 |
import eu.etaxonomy.cdm.model.common.MarkerType; |
|
21 | 22 |
import eu.etaxonomy.cdm.model.media.Rights; |
22 | 23 |
import eu.etaxonomy.cdm.persistence.dao.initializer.IBeanInitializer; |
23 | 24 |
import eu.etaxonomy.cdm.persistence.dto.UuidAndTitleCache; |
... | ... | |
213 | 214 |
*/ |
214 | 215 |
public <S extends T> List<Object[]> findByIdentifier(Class<S> clazz, String identifier, DefinedTerm identifierType, MatchMode matchmode, boolean includeCdmEntity, Integer pageSize, Integer pageNumber, List<String> propertyPaths); |
215 | 216 |
|
217 |
/** |
|
218 |
* @param clazz |
|
219 |
* @param markerType |
|
220 |
* @param markerValue |
|
221 |
* @param includeEntity |
|
222 |
* @param pageSize |
|
223 |
* @param pageNumber |
|
224 |
* @param propertyPaths |
|
225 |
* @return |
|
226 |
*/ |
|
227 |
public <S extends T> long countByMarker(Class<S> clazz, MarkerType markerType, Boolean markerValue); |
|
228 |
|
|
229 |
/** |
|
230 |
* @param clazz |
|
231 |
* @param markerType |
|
232 |
* @param markerValue |
|
233 |
* @param includeEntity |
|
234 |
* @param pageSize |
|
235 |
* @param pageNumber |
|
236 |
* @param propertyPaths |
|
237 |
* @return |
|
238 |
*/ |
|
239 |
public <S extends T> List<Object[]> findByMarker(Class<S> clazz, MarkerType markerType, Boolean markerValue, boolean includeEntity, |
|
240 |
Integer pageSize, Integer pageNumber, List<String> propertyPaths); |
|
241 |
|
|
216 | 242 |
} |
cdmlib-persistence/src/main/java/eu/etaxonomy/cdm/persistence/dao/hibernate/common/IdentifiableDaoBase.java | ||
---|---|---|
37 | 37 |
import eu.etaxonomy.cdm.model.common.IdentifiableEntity; |
38 | 38 |
import eu.etaxonomy.cdm.model.common.IdentifiableSource; |
39 | 39 |
import eu.etaxonomy.cdm.model.common.LSID; |
40 |
import eu.etaxonomy.cdm.model.common.MarkerType; |
|
40 | 41 |
import eu.etaxonomy.cdm.model.media.Rights; |
41 | 42 |
import eu.etaxonomy.cdm.persistence.dao.QueryParseException; |
42 | 43 |
import eu.etaxonomy.cdm.persistence.dao.common.IIdentifiableDao; |
... | ... | |
556 | 557 |
return results; |
557 | 558 |
} |
558 | 559 |
|
560 |
@Override |
|
561 |
public <S extends T> long countByMarker(Class<S> clazz, MarkerType markerType, |
|
562 |
Boolean markerValue) { |
|
563 |
checkNotInPriorView("IdentifiableDaoBase.countByMarker(T clazz, MarkerType markerType, Boolean markerValue)"); |
|
564 |
|
|
565 |
if (markerType == null){ |
|
566 |
return 0; |
|
567 |
} |
|
568 |
Class<?> clazzParam = clazz == null ? type : clazz; |
|
569 |
String queryString = "SELECT count(*) FROM " + clazzParam.getSimpleName() + " as c " + |
|
570 |
"INNER JOIN c.markers as mks " + |
|
571 |
"WHERE (1=1) "; |
|
572 |
|
|
573 |
if (markerValue != null){ |
|
574 |
queryString += " AND mks.flag = :flag"; |
|
575 |
} |
|
576 |
queryString += " AND mks.markerType = :type"; |
|
577 |
|
|
578 |
Query query = getSession().createQuery(queryString); |
|
579 |
query.setEntity("type", markerType); |
|
580 |
if (markerValue != null){ |
|
581 |
query.setBoolean("flag", markerValue); |
|
582 |
} |
|
583 |
|
|
584 |
Long c = (Long)query.uniqueResult(); |
|
585 |
return c; |
|
586 |
} |
|
559 | 587 |
|
588 |
@Override |
|
589 |
public <S extends T> List<Object[]> findByMarker( |
|
590 |
Class<S> clazz, MarkerType markerType, |
|
591 |
Boolean markerValue, boolean includeEntity, Integer pageSize, Integer pageNumber, |
|
592 |
List<String> propertyPaths) { |
|
593 |
|
|
594 |
checkNotInPriorView("IdentifiableDaoBase.findByMarker(T clazz, String identifier, DefinedTerm identifierType, MatchMode matchmode, Integer pageSize, Integer pageNumber, List<OrderHint> orderHints, List<String> propertyPaths)"); |
|
595 |
if (markerType == null){ |
|
596 |
return new ArrayList<Object[]>(); |
|
597 |
} |
|
598 |
|
|
599 |
Class<?> clazzParam = clazz == null ? type : clazz; |
|
600 |
String queryString = "SELECT mks.markerType, mks.flag, %s FROM %s as c " + |
|
601 |
" INNER JOIN c.markers as mks " + |
|
602 |
" WHERE (1=1) "; |
|
603 |
queryString = String.format(queryString, (includeEntity ? "c":"c.uuid, c.titleCache") , clazzParam.getSimpleName()); |
|
604 |
|
|
605 |
//Matchmode and identifier |
|
606 |
if (markerValue != null){ |
|
607 |
queryString += " AND mks.flag = :flag"; |
|
608 |
} |
|
609 |
queryString += " AND mks.markerType = :type"; |
|
610 |
|
|
611 |
//order |
|
612 |
queryString +=" ORDER BY mks.markerType.uuid, mks.flag, c.uuid "; |
|
613 |
|
|
614 |
Query query = getSession().createQuery(queryString); |
|
615 |
|
|
616 |
//parameters |
|
617 |
query.setEntity("type", markerType); |
|
618 |
if (markerValue != null){ |
|
619 |
query.setBoolean("flag", markerValue); |
|
620 |
} |
|
621 |
|
|
622 |
//paging |
|
623 |
setPagingParameter(query, pageSize, pageNumber); |
|
624 |
|
|
625 |
@SuppressWarnings("unchecked") |
|
626 |
List<Object[]> results = query.list(); |
|
627 |
//initialize |
|
628 |
if (includeEntity){ |
|
629 |
List<S> entities = new ArrayList<S>(); |
|
630 |
for (Object[] result : results){ |
|
631 |
entities.add((S)result[2]); |
|
632 |
} |
|
633 |
defaultBeanInitializer.initializeAll(entities, propertyPaths); |
|
634 |
} |
|
635 |
return results; |
|
636 |
} |
|
560 | 637 |
|
561 | 638 |
} |
cdmlib-persistence/src/main/java/eu/etaxonomy/cdm/persistence/dao/hibernate/taxon/TaxonDaoHibernateImpl.java | ||
---|---|---|
43 | 43 |
import eu.etaxonomy.cdm.model.common.DefinedTerm; |
44 | 44 |
import eu.etaxonomy.cdm.model.common.IdentifiableEntity; |
45 | 45 |
import eu.etaxonomy.cdm.model.common.LSID; |
46 |
import eu.etaxonomy.cdm.model.common.MarkerType; |
|
46 | 47 |
import eu.etaxonomy.cdm.model.common.OriginalSourceBase; |
47 | 48 |
import eu.etaxonomy.cdm.model.common.RelationshipBase; |
48 | 49 |
import eu.etaxonomy.cdm.model.common.RelationshipBase.Direction; |
... | ... | |
2083 | 2084 |
} |
2084 | 2085 |
|
2085 | 2086 |
Class<?> clazzParam = clazz == null ? type : clazz; |
2086 |
checkNotInPriorView("IdentifiableDaoBase.countByIdentifier(T clazz, String identifier, DefinedTerm identifierType, TaxonNode subMatchMode matchmode)");
|
|
2087 |
checkNotInPriorView("TaxonDaoHibernateImpl.countByIdentifier(T clazz, String identifier, DefinedTerm identifierType, TaxonNode subMatchMode matchmode)");
|
|
2087 | 2088 |
|
2088 | 2089 |
boolean isTaxon = clazzParam == Taxon.class || clazzParam == TaxonBase.class; |
2089 | 2090 |
boolean isSynonym = clazzParam == Synonym.class || clazzParam == TaxonBase.class; |
... | ... | |
2129 | 2130 |
MatchMode matchmode, boolean includeEntity, |
2130 | 2131 |
Integer pageSize, Integer pageNumber, List<String> propertyPaths) { |
2131 | 2132 |
|
2132 |
checkNotInPriorView("IdentifiableDaoBase.findByIdentifier(T clazz, String identifier, DefinedTerm identifierType, MatchMode matchmode, Integer pageSize, Integer pageNumber, List<OrderHint> orderHints, List<String> propertyPaths)");
|
|
2133 |
checkNotInPriorView("TaxonDaoHibernateImpl.findByIdentifier(T clazz, String identifier, DefinedTerm identifierType, MatchMode matchmode, Integer pageSize, Integer pageNumber, List<OrderHint> orderHints, List<String> propertyPaths)");
|
|
2133 | 2134 |
Class<?> clazzParam = clazz == null ? type : clazz; |
2134 | 2135 |
|
2135 | 2136 |
boolean isTaxon = clazzParam == Taxon.class || clazzParam == TaxonBase.class; |
... | ... | |
2186 | 2187 |
return results; |
2187 | 2188 |
} |
2188 | 2189 |
|
2190 |
/** |
|
2191 |
* {@inheritDoc} |
|
2192 |
* @see #countByIdentifier(Class, String, DefinedTerm, TaxonNode, MatchMode) |
|
2193 |
*/ |
|
2194 |
@Override |
|
2195 |
public <S extends TaxonBase> long countByMarker(Class<S> clazz, MarkerType markerType, |
|
2196 |
Boolean markerValue, TaxonNode subtreeFilter) { |
|
2197 |
if (markerType == null){ |
|
2198 |
return 0; |
|
2199 |
} |
|
2200 |
|
|
2201 |
if (subtreeFilter == null){ |
|
2202 |
return countByMarker(clazz, markerType, markerValue); |
|
2203 |
} |
|
2204 |
|
|
2205 |
Class<?> clazzParam = clazz == null ? type : clazz; |
|
2206 |
checkNotInPriorView("TaxonDaoHibernateImpl.countByMarker(Class<S> clazz, DefinedTerm markerType, boolean markerValue, TaxonNode subtreeFilter)"); |
|
2207 |
|
|
2208 |
boolean isTaxon = clazzParam == Taxon.class || clazzParam == TaxonBase.class; |
|
2209 |
boolean isSynonym = clazzParam == Synonym.class || clazzParam == TaxonBase.class; |
|
2210 |
|
|
2211 |
getSession().update(subtreeFilter); //to avoid LIE when retrieving treeindex |
|
2212 |
String filterStr = "'" + subtreeFilter.treeIndex() + "%%'"; |
|
2213 |
String accTreeJoin = isTaxon? " LEFT JOIN c.taxonNodes tn " : ""; |
|
2214 |
String synTreeJoin = isSynonym ? " LEFT JOIN c.synonymRelations sr LEFT JOIN sr.relatedTo as acc LEFT JOIN acc.taxonNodes synTn " : ""; |
|
2215 |
String accWhere = isTaxon ? "tn.treeIndex like " + filterStr : "(1=0)"; |
|
2216 |
String synWhere = isSynonym ? "synTn.treeIndex like " + filterStr : "(1=0)"; |
|
2217 |
|
|
2218 |
String queryString = "SELECT count(*) FROM %s as c " + |
|
2219 |
" INNER JOIN c.markers as mks " + |
|
2220 |
accTreeJoin + |
|
2221 |
synTreeJoin + |
|
2222 |
" WHERE (1=1) " + |
|
2223 |
" AND ( " + accWhere + " OR " + synWhere + ")"; |
|
2224 |
queryString = String.format(queryString, clazzParam.getSimpleName()); |
|
2225 |
|
|
2226 |
if (markerValue != null){ |
|
2227 |
queryString += " AND mks.flag = :flag"; |
|
2228 |
} |
|
2229 |
if (markerType != null){ |
|
2230 |
queryString += " AND mks.markerType = :type"; |
|
2231 |
} |
|
2232 |
|
|
2233 |
Query query = getSession().createQuery(queryString); |
|
2234 |
if (markerType != null){ |
|
2235 |
query.setEntity("type", markerType); |
|
2236 |
} |
|
2237 |
if (markerValue != null){ |
|
2238 |
query.setBoolean("flag", markerValue); |
|
2239 |
} |
|
2240 |
|
|
2241 |
Long c = (Long)query.uniqueResult(); |
|
2242 |
return c; |
|
2243 |
} |
|
2244 |
|
|
2245 |
/** |
|
2246 |
* {@inheritDoc} |
|
2247 |
*/ |
|
2248 |
@Override |
|
2249 |
public <S extends TaxonBase> List<Object[]> findByMarker(Class<S> clazz, MarkerType markerType, |
|
2250 |
Boolean markerValue, TaxonNode subtreeFilter, boolean includeEntity, Integer pageSize, Integer pageNumber, |
|
2251 |
List<String> propertyPaths) { |
|
2252 |
checkNotInPriorView("TaxonDaoHibernateImpl.findByMarker(T clazz, String identifier, DefinedTerm identifierType, MatchMode matchmode, Integer pageSize, Integer pageNumber, List<OrderHint> orderHints, List<String> propertyPaths)"); |
|
2253 |
if (markerType == null){ |
|
2254 |
return new ArrayList<Object[]>(); |
|
2255 |
} |
|
2256 |
|
|
2257 |
Class<?> clazzParam = clazz == null ? type : clazz; |
|
2258 |
|
|
2259 |
boolean isTaxon = clazzParam == Taxon.class || clazzParam == TaxonBase.class; |
|
2260 |
boolean isSynonym = clazzParam == Synonym.class || clazzParam == TaxonBase.class; |
|
2261 |
getSession().update(subtreeFilter); //to avoid LIE when retrieving treeindex |
|
2262 |
String filterStr = "'" + subtreeFilter.treeIndex() + "%%'"; |
|
2263 |
String accTreeJoin = isTaxon? " LEFT JOIN c.taxonNodes tn " : ""; |
|
2264 |
String synTreeJoin = isSynonym ? " LEFT JOIN c.synonymRelations sr LEFT JOIN sr.relatedTo as acc LEFT JOIN acc.taxonNodes synTn " : ""; |
|
2265 |
String accWhere = isTaxon ? "tn.treeIndex like " + filterStr : "(1=0)"; |
|
2266 |
String synWhere = isSynonym ? "synTn.treeIndex like " + filterStr : "(1=0)"; |
|
2267 |
|
|
2268 |
String queryString = "SELECT mks.markerType, mks.flag, %s " + |
|
2269 |
" FROM %s as c " + |
|
2270 |
" INNER JOIN c.markers as mks " + |
|
2271 |
accTreeJoin + |
|
2272 |
synTreeJoin + |
|
2273 |
" WHERE (1=1) " + |
|
2274 |
" AND ( " + accWhere + " OR " + synWhere + ")"; |
|
2275 |
queryString = String.format(queryString, (includeEntity ? "c":"c.uuid, c.titleCache") , clazzParam.getSimpleName()); |
|
2276 |
|
|
2277 |
//type and value |
|
2278 |
if (markerValue != null){ |
|
2279 |
queryString += " AND mks.flag = :flag"; |
|
2280 |
} |
|
2281 |
queryString += " AND mks.markerType = :type"; |
|
2282 |
//order |
|
2283 |
queryString +=" ORDER BY mks.markerType.uuid, mks.flag, c.uuid "; |
|
2284 |
|
|
2285 |
Query query = getSession().createQuery(queryString); |
|
2286 |
|
|
2287 |
//parameters |
|
2288 |
query.setEntity("type", markerType); |
|
2289 |
if (markerValue != null){ |
|
2290 |
query.setBoolean("flag", markerValue); |
|
2291 |
} |
|
2292 |
|
|
2293 |
//paging |
|
2294 |
setPagingParameter(query, pageSize, pageNumber); |
|
2295 |
|
|
2296 |
List<Object[]> results = query.list(); |
|
2297 |
//initialize |
|
2298 |
if (includeEntity){ |
|
2299 |
List<S> entities = new ArrayList<S>(); |
|
2300 |
for (Object[] result : results){ |
|
2301 |
entities.add((S)result[2]); |
|
2302 |
} |
|
2303 |
defaultBeanInitializer.initializeAll(entities, propertyPaths); |
|
2304 |
} |
|
2305 |
return results; |
|
2306 |
} |
|
2307 |
|
|
2189 | 2308 |
} |
cdmlib-persistence/src/main/java/eu/etaxonomy/cdm/persistence/dao/taxon/ITaxonDao.java | ||
---|---|---|
17 | 17 |
|
18 | 18 |
import eu.etaxonomy.cdm.model.common.DefinedTerm; |
19 | 19 |
import eu.etaxonomy.cdm.model.common.IdentifiableEntity; |
20 |
import eu.etaxonomy.cdm.model.common.MarkerType; |
|
20 | 21 |
import eu.etaxonomy.cdm.model.common.RelationshipBase; |
21 | 22 |
import eu.etaxonomy.cdm.model.common.RelationshipBase.Direction; |
22 | 23 |
import eu.etaxonomy.cdm.model.location.NamedArea; |
... | ... | |
439 | 440 |
DefinedTerm identifierType, TaxonNode subtreeFilter, MatchMode matchmode, |
440 | 441 |
boolean includeEntity, Integer pageSize, Integer pageNumber, List<String> propertyPaths); |
441 | 442 |
|
443 |
/** |
|
444 |
* Counts all taxa which match the given identifier (identifier type, identifier string and match mode). |
|
445 |
* Optionally a subtreefilter can be defined. |
|
446 |
* |
|
447 |
* @param clazz optional, the TaxonBase subclass |
|
448 |
* @param identifier the identifier string |
|
449 |
* @param identifierType the identifier type |
|
450 |
* @param matchmode the match mode for the identifier string |
|
451 |
* @param subtreeFilter the subtree filter as taxon node |
|
452 |
* @return |
|
453 |
*/ |
|
442 | 454 |
public <S extends TaxonBase> int countByIdentifier(Class<S> clazz, |
443 | 455 |
String identifier, DefinedTerm identifierType, TaxonNode subtreeFilter, MatchMode matchmode); |
444 | 456 |
|
457 |
/** |
|
458 |
* Counts all taxa which have the given marker of type markerType and with value markerValue. |
|
459 |
* Additionally an optional subtreefilter can be defined. |
|
460 |
* |
|
461 |
* @param clazz |
|
462 |
* @param markerType |
|
463 |
* @param markerValue |
|
464 |
* @param subtreeFilter |
|
465 |
* @return |
|
466 |
*/ |
|
467 |
public <S extends TaxonBase> long countByMarker(Class<S> clazz, MarkerType markerType, |
|
468 |
Boolean markerValue, TaxonNode subtreeFilter); |
|
469 |
|
|
470 |
/** |
|
471 |
* @param clazz |
|
472 |
* @param markerType |
|
473 |
* @param markerValue |
|
474 |
* @param subtreeFilter |
|
475 |
* @param includeEntity |
|
476 |
* @param pageSize |
|
477 |
* @param pageNumber |
|
478 |
* @param propertyPaths |
|
479 |
* @return |
|
480 |
*/ |
|
481 |
public <S extends TaxonBase> List<Object[]> findByMarker(Class<S> clazz, MarkerType markerType, |
|
482 |
Boolean markerValue, TaxonNode subtreeFilter, boolean includeEntity, |
|
483 |
Integer pageSize, Integer pageNumber, List<String> propertyPaths); |
|
484 |
|
|
445 | 485 |
/** |
446 | 486 |
* @param classification |
447 | 487 |
* @param excludeUuid |
cdmlib-remote/src/main/java/eu/etaxonomy/cdm/remote/controller/IdentifiableListController.java | ||
---|---|---|
26 | 26 |
import eu.etaxonomy.cdm.api.service.IIdentifiableEntityService; |
27 | 27 |
import eu.etaxonomy.cdm.api.service.ITermService; |
28 | 28 |
import eu.etaxonomy.cdm.api.service.dto.FindByIdentifierDTO; |
29 |
import eu.etaxonomy.cdm.api.service.dto.FindByMarkerDTO; |
|
29 | 30 |
import eu.etaxonomy.cdm.api.service.pager.Pager; |
30 | 31 |
import eu.etaxonomy.cdm.model.common.CdmBase; |
31 | 32 |
import eu.etaxonomy.cdm.model.common.DefinedTerm; |
33 |
import eu.etaxonomy.cdm.model.common.DefinedTermBase; |
|
32 | 34 |
import eu.etaxonomy.cdm.model.common.IdentifiableEntity; |
35 |
import eu.etaxonomy.cdm.model.common.MarkerType; |
|
33 | 36 |
import eu.etaxonomy.cdm.persistence.query.MatchMode; |
34 | 37 |
import eu.etaxonomy.cdm.remote.controller.util.PagerParameters; |
35 | 38 |
import eu.etaxonomy.cdm.remote.editor.MatchModePropertyEditor; |
... | ... | |
41 | 44 |
*/ |
42 | 45 |
public abstract class IdentifiableListController <T extends IdentifiableEntity, SERVICE extends IIdentifiableEntityService<T>> extends BaseListController<T,SERVICE> { |
43 | 46 |
|
44 |
|
|
47 |
|
|
45 | 48 |
@InitBinder |
46 | 49 |
@Override |
47 | 50 |
public void initBinder(WebDataBinder binder) { |
48 | 51 |
super.initBinder(binder); |
49 | 52 |
binder.registerCustomEditor(MatchMode.class, new MatchModePropertyEditor()); |
50 | 53 |
} |
51 |
|
|
54 |
|
|
52 | 55 |
@Autowired |
53 |
private ITermService termservice;
|
|
56 |
private ITermService termService;
|
|
54 | 57 |
|
55 | 58 |
/** |
56 | 59 |
* Find IdentifiableEntity objects by name |
... | ... | |
98 | 101 |
|
99 | 102 |
/** |
100 | 103 |
* list IdentifiableEntity objects by identifiers |
101 |
*
|
|
104 |
* |
|
102 | 105 |
* @param type |
103 | 106 |
* @param identifierType |
104 | 107 |
* @param identifier |
... | ... | |
129 | 132 |
if(StringUtils.isNotBlank(identifierType)){ |
130 | 133 |
identifierType = StringUtils.trim(identifierType); |
131 | 134 |
UUID identifierTypeUUID = UUID.fromString(identifierType); |
132 |
definedTerm = CdmBase.deproxy(termservice.find(identifierTypeUUID), DefinedTerm.class);
|
|
135 |
definedTerm = CdmBase.deproxy(termService.find(identifierTypeUUID), DefinedTerm.class);
|
|
133 | 136 |
} |
134 |
|
|
137 |
|
|
135 | 138 |
logger.info("doFind : " + request.getRequestURI() + "?" + request.getQueryString() ); |
136 | 139 |
|
137 | 140 |
PagerParameters pagerParams = new PagerParameters(pageSize, pageNumber).normalizeAndValidate(response); |
... | ... | |
140 | 143 |
boolean includeCdmEntity = includeEntity == null || includeEntity == true ? true : false; |
141 | 144 |
return service.findByIdentifier(type, identifier, definedTerm , matchMode, includeCdmEntity, pagerParams.getPageSize(), pagerParams.getPageIndex(), initializationStrategy); |
142 | 145 |
} |
143 |
|
|
144 |
|
|
146 |
|
|
147 |
/** |
|
148 |
* List identifiable entities by markers |
|
149 |
* |
|
150 |
* @param type |
|
151 |
* @param markerType |
|
152 |
* @param value |
|
153 |
* @param pageNumber |
|
154 |
* @param pageSize |
|
155 |
* @param request |
|
156 |
* @param response |
|
157 |
* @return |
|
158 |
* @see IdentifiableListController#doFindByIdentifier(Class, String, String, Integer, Integer, MatchMode, Boolean, HttpServletRequest, HttpServletResponse) |
|
159 |
* @throws IOException |
|
160 |
*/ |
|
161 |
@RequestMapping(method = RequestMethod.GET, value={"findByMarker"}, params={"subtree"}) |
|
162 |
public Pager<FindByMarkerDTO<T>> doFindByMarker( |
|
163 |
@RequestParam(value = "class", required = false) Class<T> type, |
|
164 |
@RequestParam(value = "markerType", required = true) UUID markerTypeUuid, |
|
165 |
@RequestParam(value = "value", required = false) Boolean value, |
|
166 |
@RequestParam(value = "pageNumber", required = false) Integer pageNumber, |
|
167 |
@RequestParam(value = "pageSize", required = false) Integer pageSize, |
|
168 |
@RequestParam(value = "includeEntity", required = false, defaultValue="true") Boolean includeEntity, //TODO true only for debuging |
|
169 |
HttpServletRequest request, |
|
170 |
HttpServletResponse response |
|
171 |
) |
|
172 |
throws IOException { |
|
173 |
|
|
174 |
MarkerType markerType = null; |
|
175 |
if(markerTypeUuid != null){ |
|
176 |
DefinedTermBase<?> term = CdmBase.deproxy(termService.find(markerTypeUuid), MarkerType.class); |
|
177 |
if (term != null && term.isInstanceOf(MarkerType.class)){ |
|
178 |
markerType = CdmBase.deproxy(term, MarkerType.class); |
|
179 |
} |
|
180 |
} |
|
181 |
|
|
182 |
if (logger.isDebugEnabled()){logger.info("doFindByMarker [subtreeUuid] : " + request.getRequestURI() + "?" + request.getQueryString() );} |
|
183 |
|
|
184 |
PagerParameters pagerParams = new PagerParameters(pageSize, pageNumber).normalizeAndValidate(response); |
|
185 |
|
|
186 |
return service.findByMarker(type, markerType, value, includeEntity, pagerParams.getPageSize(), pagerParams.getPageIndex(), initializationStrategy); |
|
187 |
} |
|
188 |
|
|
189 |
|
|
145 | 190 |
} |
cdmlib-remote/src/main/java/eu/etaxonomy/cdm/remote/controller/TaxonListController.java | ||
---|---|---|
9 | 9 |
|
10 | 10 |
package eu.etaxonomy.cdm.remote.controller; |
11 | 11 |
|
12 |
import io.swagger.annotations.Api; |
|
13 |
|
|
14 | 12 |
import java.io.IOException; |
15 | 13 |
import java.util.ArrayList; |
16 | 14 |
import java.util.Arrays; |
... | ... | |
42 | 40 |
import eu.etaxonomy.cdm.api.service.config.FindTaxaAndNamesConfiguratorImpl; |
43 | 41 |
import eu.etaxonomy.cdm.api.service.config.IFindTaxaAndNamesConfigurator; |
44 | 42 |
import eu.etaxonomy.cdm.api.service.dto.FindByIdentifierDTO; |
43 |
import eu.etaxonomy.cdm.api.service.dto.FindByMarkerDTO; |
|
45 | 44 |
import eu.etaxonomy.cdm.api.service.pager.Pager; |
46 | 45 |
import eu.etaxonomy.cdm.api.service.search.LuceneMultiSearchException; |
47 | 46 |
import eu.etaxonomy.cdm.api.service.search.SearchResult; |
... | ... | |
50 | 49 |
import eu.etaxonomy.cdm.model.common.DefinedTermBase; |
51 | 50 |
import eu.etaxonomy.cdm.model.common.IdentifiableEntity; |
52 | 51 |
import eu.etaxonomy.cdm.model.common.Language; |
52 |
import eu.etaxonomy.cdm.model.common.MarkerType; |
|
53 | 53 |
import eu.etaxonomy.cdm.model.description.DescriptionElementBase; |
54 | 54 |
import eu.etaxonomy.cdm.model.description.Feature; |
55 | 55 |
import eu.etaxonomy.cdm.model.description.PresenceAbsenceTerm; |
... | ... | |
69 | 69 |
import eu.etaxonomy.cdm.remote.editor.TermBaseListPropertyEditor; |
70 | 70 |
import eu.etaxonomy.cdm.remote.editor.TermBasePropertyEditor; |
71 | 71 |
import eu.etaxonomy.cdm.remote.editor.UuidList; |
72 |
import io.swagger.annotations.Api; |
|
72 | 73 |
|
73 | 74 |
/** |
74 | 75 |
* TODO write controller documentation |
... | ... | |
504 | 505 |
return service.findByIdentifier(type, identifier, definedTerm , subTree, matchMode, includeEntity, pagerParams.getPageSize(), pagerParams.getPageIndex(), initializationStrategy); |
505 | 506 |
} |
506 | 507 |
|
508 |
/** |
|
509 |
* List taxa by markers using a subtree filter |
|
510 |
* |
|
511 |
* @param type |
|
512 |
* @param markerType |
|
513 |
* @param value |
|
514 |
* @param pageNumber |
|
515 |
* @param pageSize |
|
516 |
* @param request |
|
517 |
* @param response |
|
518 |
* @return |
|
519 |
* @see IdentifiableListController#doFindByMarker(Class, UUID, Boolean, Integer, Integer, Boolean, HttpServletRequest, HttpServletResponse) |
|
520 |
* @see TaxonListController#doFindByIdentifier(Class, UUID, String, Integer, Integer, MatchMode, Boolean, UUID, HttpServletRequest, HttpServletResponse) |
|
521 |
* @see IdentifiableListController#doFindByIdentifier(Class, String, String, Integer, Integer, MatchMode, Boolean, HttpServletRequest, HttpServletResponse) |
|
522 |
* @throws IOException |
|
523 |
*/ |
|
524 |
@RequestMapping(method = RequestMethod.GET, value={"findByMarker"}, params={"subtree"}) |
|
525 |
public <T extends TaxonBase> Pager<FindByMarkerDTO<T>> doFindByMarker( |
|
526 |
@RequestParam(value = "class", required = false) Class<T> type, |
|
527 |
@RequestParam(value = "markerType", required = true) UUID markerTypeUuid, |
|
528 |
@RequestParam(value = "value", required = false) Boolean value, |
|
529 |
@RequestParam(value = "pageNumber", required = false) Integer pageNumber, |
|
530 |
@RequestParam(value = "pageSize", required = false) Integer pageSize, |
|
531 |
@RequestParam(value = "includeEntity", required = false, defaultValue="true") Boolean includeEntity, //TODO true only for debuging |
|
532 |
@RequestParam(value = "subtree", required = true) UUID subtreeUuid, |
|
533 |
HttpServletRequest request, |
|
534 |
HttpServletResponse response |
|
535 |
) |
|
536 |
throws IOException { |
|
537 |
|
|
538 |
MarkerType markerType = null; |
|
539 |
if(markerTypeUuid != null){ |
|
540 |
DefinedTermBase<?> term = CdmBase.deproxy(termService.find(markerTypeUuid), MarkerType.class); |
|
541 |
if (term != null && term.isInstanceOf(MarkerType.class)){ |
|
542 |
markerType = CdmBase.deproxy(term, MarkerType.class); |
|
543 |
} |
|
544 |
} |
|
545 |
|
|
546 |
TaxonNode subTree; |
|
547 |
Classification cl = classificationService.load(subtreeUuid); |
|
548 |
if (cl != null){ |
|
549 |
subTree = cl.getRootNode(); |
|
550 |
}else{ |
|
551 |
subTree = taxonNodeService.find(subtreeUuid); |
|
552 |
} |
|
553 |
|
|
554 |
if (logger.isDebugEnabled()){logger.info("doFindByMarker [subtreeUuid] : " + request.getRequestURI() + "?" + request.getQueryString() );} |
|
555 |
|
|
556 |
PagerParameters pagerParams = new PagerParameters(pageSize, pageNumber).normalizeAndValidate(response); |
|
557 |
|
|
558 |
return service.findByMarker(type, markerType, value, subTree, includeEntity, pagerParams.getPageSize(), pagerParams.getPageIndex(), initializationStrategy); |
|
559 |
} |
|
560 |
|
|
507 | 561 |
@RequestMapping(value = "doFindByNameParts", method = RequestMethod.GET) |
508 | 562 |
public Pager<TaxonBase> doFindByNameParts( |
509 | 563 |
@RequestParam(value = "genusOrUninomial", required = false) String genusOrUninomial, |
cdmlib-services/src/main/java/eu/etaxonomy/cdm/api/service/IIdentifiableEntityService.java | ||
---|---|---|
16 | 16 |
|
17 | 17 |
import eu.etaxonomy.cdm.api.service.config.IIdentifiableEntityServiceConfigurator; |
18 | 18 |
import eu.etaxonomy.cdm.api.service.dto.FindByIdentifierDTO; |
19 |
import eu.etaxonomy.cdm.api.service.dto.FindByMarkerDTO; |
|
19 | 20 |
import eu.etaxonomy.cdm.api.service.pager.Pager; |
20 | 21 |
import eu.etaxonomy.cdm.common.monitor.IProgressMonitor; |
21 | 22 |
import eu.etaxonomy.cdm.model.common.DefinedTerm; |
... | ... | |
23 | 24 |
import eu.etaxonomy.cdm.model.common.IdentifiableEntity; |
24 | 25 |
import eu.etaxonomy.cdm.model.common.IdentifiableSource; |
25 | 26 |
import eu.etaxonomy.cdm.model.common.LSID; |
27 |
import eu.etaxonomy.cdm.model.common.MarkerType; |
|
26 | 28 |
import eu.etaxonomy.cdm.model.media.Rights; |
27 | 29 |
import eu.etaxonomy.cdm.persistence.dao.initializer.IBeanInitializer; |
28 | 30 |
import eu.etaxonomy.cdm.persistence.dto.UuidAndTitleCache; |
... | ... | |
262 | 264 |
* Returns a Pager for {@link FindByIdentifierDTO DTOs} that hold the identifier including type, title and uuid |
263 | 265 |
* and the according CDM Object information (uuid, title and the object itself (optional)). |
264 | 266 |
* |
265 |
* all {@link IdentifiableEntity identifiable entities} which have the according |
|
266 |
* identifier attached |
|
267 | 267 |
* @param clazz the identifiable entity subclass, may be null |
268 | 268 |
* @param identifier the identifier as {@link String} |
269 | 269 |
* @param identifierType the identifier type, maybe null |
... | ... | |
272 | 272 |
* @param pageSize |
273 | 273 |
* @param pageNumber |
274 | 274 |
* @param propertyPaths |
275 |
* @return |
|
275 |
* @return all {@link IdentifiableEntity identifiable entities} which have the according |
|
276 |
* identifier attached |
|
276 | 277 |
*/ |
277 |
public <S extends T> Pager<FindByIdentifierDTO<S>> findByIdentifier(Class<S> clazz, String identifier, DefinedTerm identifierType, MatchMode matchmode, boolean includeCdmEntity, Integer pageSize, Integer pageNumber, List<String> propertyPaths); |
|
278 |
public <S extends T> Pager<FindByIdentifierDTO<S>> findByIdentifier( |
|
279 |
Class<S> clazz, String identifier, DefinedTerm identifierType, |
|
280 |
MatchMode matchmode, boolean includeCdmEntity, |
|
281 |
Integer pageSize, Integer pageNumber, List<String> propertyPaths); |
|
278 | 282 |
|
283 |
/** |
|
284 |
* Returns a Pager for {@link FindByMarkerDTO DTOs} that hold the marker including type, title and uuid |
|
285 |
* and the according CDM object information (uuid, title and the object itself (optional)). |
|
286 |
* |
|
287 |
* @param clazz |
|
288 |
* @param markerType |
|
289 |
* @param markerValue |
|
290 |
* @param includeEntity |
|
291 |
* @param pageSize |
|
292 |
* @param pageNumber |
|
293 |
* @param propertyPaths |
|
294 |
* @return all {@link IdentifiableEntity identifiable entities} which have the according |
|
295 |
* marker with the given flag value attached |
|
296 |
*/ |
|
297 |
public <S extends T> Pager<FindByMarkerDTO<S>> findByMarker( |
|
298 |
Class<S> clazz, MarkerType markerType, Boolean markerValue, |
|
299 |
boolean includeEntity, Integer pageSize, |
|
300 |
Integer pageNumber, List<String> propertyPaths); |
|
279 | 301 |
} |
cdmlib-services/src/main/java/eu/etaxonomy/cdm/api/service/ITaxonService.java | ||
---|---|---|
25 | 25 |
import eu.etaxonomy.cdm.api.service.config.SynonymDeletionConfigurator; |
26 | 26 |
import eu.etaxonomy.cdm.api.service.config.TaxonDeletionConfigurator; |
27 | 27 |
import eu.etaxonomy.cdm.api.service.dto.FindByIdentifierDTO; |
28 |
import eu.etaxonomy.cdm.api.service.dto.FindByMarkerDTO; |
|
28 | 29 |
import eu.etaxonomy.cdm.api.service.dto.IncludedTaxaDTO; |
29 | 30 |
import eu.etaxonomy.cdm.api.service.exception.DataChangeNoRollbackException; |
30 | 31 |
import eu.etaxonomy.cdm.api.service.exception.HomotypicalGroupChangeException; |
... | ... | |
35 | 36 |
import eu.etaxonomy.cdm.model.common.DefinedTerm; |
36 | 37 |
import eu.etaxonomy.cdm.model.common.IdentifiableEntity; |
37 | 38 |
import eu.etaxonomy.cdm.model.common.Language; |
39 |
import eu.etaxonomy.cdm.model.common.MarkerType; |
|
38 | 40 |
import eu.etaxonomy.cdm.model.common.RelationshipBase; |
39 | 41 |
import eu.etaxonomy.cdm.model.common.RelationshipBase.Direction; |
40 | 42 |
import eu.etaxonomy.cdm.model.description.DescriptionElementBase; |
... | ... | |
894 | 896 |
public List<TaxonBase> findTaxaByName(MatchingTaxonConfigurator config); |
895 | 897 |
|
896 | 898 |
|
899 |
/** |
|
900 |
* @param clazz the optional {@link TaxonBase} subclass |
|
901 |
* @param identifier the identifier string |
|
902 |
* @param identifierType the identifier type |
|
903 |
* @param subtreeFilter filter on a classification subtree (TaxonNode) |
|
904 |
* @param matchmode the match mode for the identifier string |
|
905 |
* @param includeEntity should the taxon as an object be included in the result |
|
906 |
* @param pageSize page size |
|
907 |
* @param pageNumber page number |
|
908 |
* @param propertyPaths property path for initializing the returned taxon object (requires includeEntity=true) |
|
909 |
* @return the resulting {@link FindByIdentifierDTO} pager |
|
910 |
* @see IIdentifiableEntityService#findByIdentifier(Class, String, DefinedTerm, MatchMode, boolean, Integer, Integer, List) |
|
911 |
*/ |
|
897 | 912 |
public <S extends TaxonBase> Pager<FindByIdentifierDTO<S>> findByIdentifier( |
898 | 913 |
Class<S> clazz, String identifier, DefinedTerm identifierType, TaxonNode subtreeFilter, |
899 | 914 |
MatchMode matchmode, boolean includeEntity, Integer pageSize, |
900 | 915 |
Integer pageNumber, List<String> propertyPaths); |
901 | 916 |
|
917 |
/** |
|
918 |
* Returns a pager for {@link FindByMarkerDTO DTOs} that hold the marker including type, title and uuid |
|
919 |
* and the according {@link TaxonBase} information (uuid, title and the taxon object itself (optional)). |
|
920 |
* |
|
921 |
* @param clazz The optional {@link TaxonBase} subclass |
|
922 |
* @param markerType the obligatory marker type, if not given, the results will always be empty |
|
923 |
* @param markerValue the optional |
|
924 |
* @param subtreeFilter filter on a classification subtree (TaxonNode) |
|
925 |
* @param includeEntity should the taxon as an object be included in the result |
|
926 |
* @param pageSize page size |
|
927 |
* @param pageNumber page number |
|
928 |
* @param propertyPaths property path for initializing the returned taxon object (requires includeEntity=true) |
|
929 |
* @return the resulting {@link FindByMarkerDTO} pager |
|
930 |
* @see IIdentifiableEntityService#findByMarker(Class, MarkerType, Boolean, boolean, Integer, Integer, List) |
|
931 |
*/ |
|
932 |
public <S extends TaxonBase> Pager<FindByMarkerDTO<S>> findByMarker( |
|
933 |
Class<S> clazz, MarkerType markerType, Boolean markerValue, |
|
934 |
TaxonNode subtreeFilter, boolean includeEntity, Integer pageSize, |
|
935 |
Integer pageNumber, List<String> propertyPaths); |
|
902 | 936 |
|
903 | 937 |
/** |
904 | 938 |
* @param synonymUuid |
cdmlib-services/src/main/java/eu/etaxonomy/cdm/api/service/IdentifiableServiceBase.java | ||
---|---|---|
25 | 25 |
|
26 | 26 |
import eu.etaxonomy.cdm.api.service.config.IIdentifiableEntityServiceConfigurator; |
27 | 27 |
import eu.etaxonomy.cdm.api.service.dto.FindByIdentifierDTO; |
28 |
import eu.etaxonomy.cdm.api.service.dto.FindByMarkerDTO; |
|
28 | 29 |
import eu.etaxonomy.cdm.api.service.pager.Pager; |
29 | 30 |
import eu.etaxonomy.cdm.api.service.pager.impl.DefaultPagerImpl; |
30 | 31 |
import eu.etaxonomy.cdm.common.monitor.DefaultProgressMonitor; |
... | ... | |
36 | 37 |
import eu.etaxonomy.cdm.model.common.IdentifiableEntity; |
37 | 38 |
import eu.etaxonomy.cdm.model.common.IdentifiableSource; |
38 | 39 |
import eu.etaxonomy.cdm.model.common.LSID; |
40 |
import eu.etaxonomy.cdm.model.common.MarkerType; |
|
39 | 41 |
import eu.etaxonomy.cdm.model.media.Rights; |
40 | 42 |
import eu.etaxonomy.cdm.model.name.NonViralName; |
41 | 43 |
import eu.etaxonomy.cdm.model.reference.Reference; |
... | ... | |
603 | 605 |
return new DefaultPagerImpl<FindByIdentifierDTO<S>>(pageNumber, numberOfResults, pageSize, result); |
604 | 606 |
} |
605 | 607 |
|
608 |
@Override |
|
609 |
@Transactional(readOnly = true) |
|
610 |
public <S extends T> Pager<FindByMarkerDTO<S>> findByMarker( |
|
611 |
Class<S> clazz, MarkerType markerType, Boolean markerValue, |
|
612 |
boolean includeEntity, Integer pageSize, |
|
613 |
Integer pageNumber, List<String> propertyPaths) { |
|
606 | 614 |
|
615 |
Long numberOfResults = dao.countByMarker(clazz, markerType, markerValue); |
|
616 |
List<Object[]> daoResults = new ArrayList<>(); |
|
617 |
if(numberOfResults > 0) { // no point checking again |
|
618 |
daoResults = dao.findByMarker(clazz, markerType, markerValue, includeEntity, |
|
619 |
pageSize, pageNumber, propertyPaths); |
|
620 |
} |
|
621 |
|
|
622 |
List<FindByMarkerDTO<S>> result = new ArrayList<>(); |
|
623 |
for (Object[] daoObj : daoResults){ |
|
624 |
if (includeEntity){ |
|
625 |
result.add(new FindByMarkerDTO<S>((MarkerType)daoObj[0], (Boolean)daoObj[1], (S)daoObj[2])); |
|
626 |
}else{ |
|
627 |
result.add(new FindByMarkerDTO<S>((MarkerType)daoObj[0], (Boolean)daoObj[1], (UUID)daoObj[2], (String)daoObj[3])); |
|
628 |
} |
|
629 |
} |
|
630 |
return new DefaultPagerImpl<FindByMarkerDTO<S>>(pageNumber, numberOfResults, pageSize, result); |
|
631 |
} |
|
607 | 632 |
} |
608 | 633 |
|
cdmlib-services/src/main/java/eu/etaxonomy/cdm/api/service/TaxonServiceImpl.java | ||
---|---|---|
47 | 47 |
import eu.etaxonomy.cdm.api.service.config.SynonymDeletionConfigurator; |
48 | 48 |
import eu.etaxonomy.cdm.api.service.config.TaxonDeletionConfigurator; |
49 | 49 |
import eu.etaxonomy.cdm.api.service.dto.FindByIdentifierDTO; |
50 |
import eu.etaxonomy.cdm.api.service.dto.FindByMarkerDTO; |
|
50 | 51 |
import eu.etaxonomy.cdm.api.service.dto.IncludedTaxaDTO; |
51 | 52 |
import eu.etaxonomy.cdm.api.service.exception.DataChangeNoRollbackException; |
52 | 53 |
import eu.etaxonomy.cdm.api.service.exception.HomotypicalGroupChangeException; |
... | ... | |
75 | 76 |
import eu.etaxonomy.cdm.model.common.IdentifiableEntity; |
76 | 77 |
import eu.etaxonomy.cdm.model.common.IdentifiableSource; |
77 | 78 |
import eu.etaxonomy.cdm.model.common.Language; |
79 |
import eu.etaxonomy.cdm.model.common.MarkerType; |
|
78 | 80 |
import eu.etaxonomy.cdm.model.common.OriginalSourceType; |
79 | 81 |
import eu.etaxonomy.cdm.model.common.RelationshipBase; |
80 | 82 |
import eu.etaxonomy.cdm.model.common.RelationshipBase.Direction; |
... | ... | |
3225 | 3227 |
} |
3226 | 3228 |
|
3227 | 3229 |
@Override |
3230 |
@Transactional(readOnly = true) |
|
3231 |
public <S extends TaxonBase> Pager<FindByMarkerDTO<S>> findByMarker( |
|
3232 |
Class<S> clazz, MarkerType markerType, Boolean markerValue, |
|
3233 |
TaxonNode subtreeFilter, boolean includeEntity, Integer pageSize, |
|
3234 |
Integer pageNumber, List<String> propertyPaths) { |
|
3235 |
if (subtreeFilter == null){ |
|
3236 |
return super.findByMarker (clazz, markerType, markerValue, includeEntity, pageSize, pageNumber, propertyPaths); |
|
3237 |
} |
|
3238 |
|
|
3239 |
Long numberOfResults = dao.countByMarker(clazz, markerType, markerValue, subtreeFilter); |
|
3240 |
List<Object[]> daoResults = new ArrayList<Object[]>(); |
|
3241 |
if(numberOfResults > 0) { // no point checking again |
|
3242 |
daoResults = dao.findByMarker(clazz, markerType, markerValue, subtreeFilter, |
|
3243 |
includeEntity, pageSize, pageNumber, propertyPaths); |
|
3244 |
} |
|
3245 |
|
|
3246 |
List<FindByMarkerDTO<S>> result = new ArrayList<>(); |
|
3247 |
for (Object[] daoObj : daoResults){ |
|
3248 |
if (includeEntity){ |
|
3249 |
result.add(new FindByMarkerDTO<S>((MarkerType)daoObj[0], (Boolean)daoObj[1], (S)daoObj[2])); |
|
3250 |
}else{ |
|
3251 |
result.add(new FindByMarkerDTO<S>((MarkerType)daoObj[0], (Boolean)daoObj[1], (UUID)daoObj[2], (String)daoObj[3])); |
|
3252 |
} |
|
3253 |
} |
|
3254 |
return new DefaultPagerImpl<FindByMarkerDTO<S>>(pageNumber, numberOfResults, pageSize, result); |
|
3255 |
} |
|
3256 |
|
|
3257 |
@Override |
|
3228 | 3258 |
@Transactional(readOnly = false) |
3229 | 3259 |
public UpdateResult moveSynonymToAnotherTaxon(SynonymRelationship oldSynonymRelation, UUID newTaxonUUID, boolean moveHomotypicGroup, |
3230 | 3260 |
SynonymRelationshipType newSynonymRelationshipType, Reference reference, String referenceDetail, boolean keepReference) throws HomotypicalGroupChangeException { |
cdmlib-services/src/main/java/eu/etaxonomy/cdm/api/service/dto/FindByMarkerDTO.java | ||
---|---|---|
1 |
// $Id$ |
|
2 |
/** |
|
3 |
* Copyright (C) 2014 EDIT |
|
4 |
* European Distributed Institute of Taxonomy |
|
5 |
* http://www.e-taxonomy.eu |
|
6 |
* |
|
7 |
* The contents of this file are subject to the Mozilla Public License Version 1.1 |
|
8 |
* See LICENSE.TXT at the top of this package for the full license terms. |
|
9 |
*/ |
|
10 |
package eu.etaxonomy.cdm.api.service.dto; |
|
11 |
|
|
12 |
import java.util.UUID; |
|
13 |
|
|
14 |
import eu.etaxonomy.cdm.model.common.IdentifiableEntity; |
|
15 |
import eu.etaxonomy.cdm.model.common.MarkerType; |
|
16 |
|
|
17 |
/** |
|
18 |
* DTO for IdentifiableEntities matching a certain marker. |
|
19 |
* |
|
20 |
* @author a.mueller |
|
21 |
* @date 2016-09-16 |
|
22 |
* |
|
23 |
*/ |
|
24 |
public class FindByMarkerDTO<T extends IdentifiableEntity<?>> { |
|
25 |
|
|
26 |
public class Marker{ |
|
27 |
UUID typeUuid; |
|
28 |
String typeLabel; |
|
29 |
Boolean flag; |
|
30 |
public Marker(MarkerType markerType, Boolean flag) { |
|
31 |
this.typeUuid = markerType.getUuid(); |
|
32 |
this.typeLabel = markerType.getTitleCache(); |
|
33 |
this.flag = flag; |
|
34 |
} |
|
35 |
public UUID getTypeUuid() {return typeUuid;} |
|
36 |
public String getTypeLabel() {return typeLabel;} |
|
37 |
public Boolean getFlag() {return flag;} |
|
38 |
} |
|
39 |
|
|
40 |
public class CdmEntity{ |
|
41 |
UUID cdmUuid; |
|
42 |
String titleCache; |
|
43 |
T entity; |
|
44 |
public CdmEntity(UUID cdmUuid, String titleCache, T entity) { |
|
45 |
this.cdmUuid = cdmUuid; |
|
46 |
this.titleCache = titleCache; |
|
47 |
this.entity = entity; |
|
48 |
} |
|
49 |
public UUID getCdmUuid() {return cdmUuid;} |
|
50 |
public String getTitleCache() {return titleCache;} |
|
51 |
public T getEntity() {return entity;} |
|
52 |
|
|
53 |
} |
|
54 |
|
|
55 |
private Marker marker; |
|
56 |
|
|
57 |
private CdmEntity cdmEntity; |
|
58 |
|
|
59 |
public FindByMarkerDTO(MarkerType markerType, Boolean flag, T entity){ |
|
60 |
this.marker = new Marker(markerType, flag); |
|
61 |
this.cdmEntity = new CdmEntity(entity.getUuid(), entity.getTitleCache(), entity); |
|
62 |
} |
|
63 |
|
|
64 |
public FindByMarkerDTO(MarkerType markerType, Boolean flag, UUID entityUuid, String titleCache){ |
|
65 |
this.marker = new Marker(markerType, flag); |
|
66 |
this.cdmEntity = new CdmEntity(entityUuid, titleCache, null); |
|
67 |
} |
|
68 |
|
|
69 |
public Marker getMarker() { |
|
70 |
return marker; |
|
71 |
} |
|
72 |
|
|
73 |
public CdmEntity getCdmEntity() { |
|
74 |
return cdmEntity; |
|
75 |
} |
|
76 |
|
|
77 |
/** |
|
78 |
* {@inheritDoc} |
|
79 |
*/ |
|
80 |
@Override |
|
81 |
public String toString() { |
|
82 |
return "(" + marker.typeLabel + "; " + cdmEntity.getTitleCache() + "; " + cdmEntity.cdmUuid + ")"; |
|
83 |
} |
|
84 |
|
|
85 |
|
|
86 |
} |
cdmlib-services/src/main/java/eu/etaxonomy/cdm/api/service/pager/impl/AbstractPagerImpl.java | ||
---|---|---|
23 | 23 |
|
24 | 24 |
public abstract class AbstractPagerImpl<T> implements Pager<T>, Serializable { |
25 | 25 |
|
26 |
protected static Integer MAX_PAGE_LABELS = 3; |
|
26 |
private static final long serialVersionUID = -1869488482336439083L; |
|
27 |
|
|
28 |
protected static Integer MAX_PAGE_LABELS = 3; |
|
27 | 29 |
protected static String LABEL_DIVIDER = " - "; |
28 | 30 |
private static Log log = LogFactory.getLog(DefaultPagerImpl.class); |
29 | 31 |
protected Integer pagesAvailable; |
cdmlib-services/src/test/java/eu/etaxonomy/cdm/api/service/IdentifiableServiceBaseTest.java | ||
---|---|---|
22 | 22 |
import org.unitils.spring.annotation.SpringBeanByType; |
23 | 23 |
|
24 | 24 |
import eu.etaxonomy.cdm.api.service.dto.FindByIdentifierDTO; |
25 |
import eu.etaxonomy.cdm.api.service.dto.FindByMarkerDTO; |
|
25 | 26 |
import eu.etaxonomy.cdm.api.service.pager.Pager; |
26 | 27 |
import eu.etaxonomy.cdm.model.common.CdmBase; |
27 | 28 |
import eu.etaxonomy.cdm.model.common.DefinedTerm; |
28 | 29 |
import eu.etaxonomy.cdm.model.common.Identifier; |
30 |
import eu.etaxonomy.cdm.model.common.MarkerType; |
|
29 | 31 |
import eu.etaxonomy.cdm.model.common.TermVocabulary; |
30 | 32 |
import eu.etaxonomy.cdm.model.common.VocabularyEnum; |
31 | 33 |
import eu.etaxonomy.cdm.model.name.BotanicalName; |
... | ... | |
87 | 89 |
|
88 | 90 |
|
89 | 91 |
@Test |
90 |
@DataSet(value="IdentifiableServiceBaseTest.testFindByIdentifier.xml") |
|
91 |
public final void testListByIdentifier(){
|
|
92 |
@DataSet(value="IdentifiableServiceBaseTest.testFindByIdentifierOrMarker.xml")
|
|
93 |
public final void testFindByIdentifier(){
|
|
92 | 94 |
UUID uuidIdentifierType1 = UUID.fromString("02bb62db-a229-4eeb-83e6-a9a093943d5e"); |
93 | 95 |
UUID uuidIdentifierType2 = UUID.fromString("ef6e960f-5289-456c-b25c-cff7f4de2f63"); |
94 | 96 |
|
... | ... | |
158 | 160 |
} |
159 | 161 |
|
160 | 162 |
@Test |
161 |
@DataSet(value="IdentifiableServiceBaseTest.testFindByIdentifier.xml") |
|
162 |
public final void testListByIdentifierClassification(){
|
|
163 |
@DataSet(value="IdentifiableServiceBaseTest.testFindByIdentifierOrMarker.xml")
|
|
164 |
public final void testFindByIdentifierClassification(){
|
|
163 | 165 |
//classification Filter |
164 | 166 |
Classification classification = classificationService.find(5000); |
165 | 167 |
TaxonNode rootNode = classification.getRootNode(); |
... | ... | |
193 | 195 |
|
194 | 196 |
} |
195 | 197 |
|
198 |
@Test |
|
199 |
@DataSet(value="IdentifiableServiceBaseTest.testFindByIdentifierOrMarker.xml") |
|
200 |
public final void testFindByMarker(){ |
|
201 |
//classification Filter |
|
202 |
Classification classification = classificationService.find(5000); |
|
203 |
TaxonNode rootNode = classification.getRootNode(); |
|
204 |
Boolean markerValue = true; |
|
205 |
|
|
206 |
UUID uuidMarkerTypeCompleted = MarkerType.uuidComplete; |
|
207 |
UUID uuidMarkerTypeDoubtful = UUID.fromString("b51325c8-05fe-421a-832b-d86fc249ef6e"); |
|
208 |
|
|
209 |
MarkerType markerType1 = (MarkerType)termService.find(uuidMarkerTypeCompleted); |
|
210 |
MarkerType noMarkerType = null; |
|
211 |
MarkerType markerType2 = (MarkerType)termService.find(uuidMarkerTypeDoubtful); |
|
212 |
Assert.assertNotNull(markerType2); |
|
213 |
|
|
214 |
MarkerType markerType = markerType1; |
|
215 |
Pager<FindByMarkerDTO<Taxon>> taxonPager = taxonService.findByMarker(Taxon.class, markerType, markerValue, |
|
216 |
rootNode, true, null, null, null); |
|
217 |
Assert.assertEquals("Result size for 'marker1=true' should be 1", Long.valueOf(1), taxonPager.getCount()); |
|
218 |
Assert.assertEquals("Result size for 'marker1=true' should be 1", 1, taxonPager.getRecords().size()); |
|
219 |
FindByMarkerDTO<Taxon> dto = taxonPager.getRecords().get(0); |
|
220 |
FindByMarkerDTO<Taxon>.Marker marker = dto.getMarker(); |
|
221 |
Assert.assertTrue("Flag must be true", marker.getFlag()); |
|
222 |
Assert.assertEquals("Flag must be true", uuidMarkerTypeCompleted, marker.getTypeUuid()); |
|
223 |
Assert.assertNotNull("the CDM entity in the dto must not be empty if includeEntity=true", dto.getCdmEntity().getEntity()); |
|
224 |
Assert.assertEquals(5000, dto.getCdmEntity().getEntity().getId()); |
|
225 |
|
|
226 |
markerValue = false; |
|
227 |
taxonPager = taxonService.findByMarker(Taxon.class, markerType, markerValue, rootNode, false, null, null, null); |
|
228 |
Assert.assertEquals("Result size for 'marker1=false' should be 0", Long.valueOf(0), taxonPager.getCount()); |
|
229 |
|
|
230 |
markerValue = true; |
|
231 |
markerType = noMarkerType; |
|
232 |
taxonPager = taxonService.findByMarker(Taxon.class, markerType, markerValue, rootNode, false, null, null, null); |
|
233 |
Assert.assertEquals("Result size for not existing marker type should be 0", Long.valueOf(0), taxonPager.getCount()); |
|
234 |
|
|
235 |
markerType = markerType2; |
|
236 |
taxonPager = taxonService.findByMarker(Taxon.class, markerType, markerValue, rootNode, false, null, null, null); |
|
237 |
Assert.assertEquals("Result size for markerType2 should be 0", Long.valueOf(0), taxonPager.getCount()); |
|
238 |
|
|
239 |
rootNode = null; |
|
240 |
markerType = markerType1; |
|
241 |
taxonPager = taxonService.findByMarker(Taxon.class, markerType, markerValue, rootNode, false, null, null, null); |
|
242 |
Assert.assertEquals("Result size for no subtree should be 2", Long.valueOf(2), taxonPager.getCount()); |
|
243 |
|
|
244 |
Pager<FindByMarkerDTO<TaxonBase>> taxonBasePager = taxonService.findByMarker(TaxonBase.class, markerType, markerValue, rootNode, false, null, null, null); |
|
245 |
Assert.assertEquals("Result size for taxa and synonyms without subtree filter with flag = true should be 3", Long.valueOf(3), taxonBasePager.getCount()); |
|
246 |
|
|
247 |
markerValue = null; |
|
248 |
taxonBasePager = taxonService.findByMarker(TaxonBase.class, markerType, markerValue, rootNode, false, null, null, null); |
|
249 |
Assert.assertEquals("Result size for taxa and synonyms without subtree filter with any flag value should be 4", Long.valueOf(4), taxonBasePager.getCount()); |
|
250 |
|
|
251 |
markerValue = true; |
|
252 |
Pager<FindByMarkerDTO<TaxonNameBase>> namePager = nameService.findByMarker(TaxonNameBase.class, markerType, markerValue, false, null, null, null); |
|
253 |
Assert.assertEquals("Result size for names with flag = true should be 1", Long.valueOf(1), namePager.getCount()); |
|
254 |
|
|
255 |
} |
|
256 |
|
|
196 | 257 |
|
197 | 258 |
|
198 |
/* (non-Javadoc) |
|
199 |
* @see eu.etaxonomy.cdm.test.integration.CdmIntegrationTest#createTestData() |
|
200 |
*/ |
|
201 | 259 |
// @Test |
202 | 260 |
@Override |
203 | 261 |
public void createTestDataSet() throws FileNotFoundException { |
cdmlib-services/src/test/resources/eu/etaxonomy/cdm/api/service/IdentifiableServiceBaseTest.testFindByIdentifier.xml | ||
---|---|---|
1 |
<?xml version='1.0' encoding='UTF-8'?> |
|
2 |
<dataset> |
|
3 |
<TAXONBASE DTYPE="Taxon" ID="5000" CREATED="2015-01-07 21:54:20.0" UUID="888cded1-cadc-48de-8629-e32927919879" UPDATED="2015-01-07 21:54:20.76" LSID_AUTHORITY="[null]" LSID_LSID="[null]" LSID_NAMESPACE="[null]" LSID_OBJECT="[null]" LSID_REVISION="[null]" PROTECTEDTITLECACHE="false" TITLECACHE="Abies alba sec. ???" APPENDEDPHRASE="[null]" DOUBTFUL="false" PUBLISH="true" USENAMECACHE="false" EXCLUDED="false" TAXONSTATUSUNKNOWN="false" TAXONOMICCHILDRENCOUNT="0" UNPLACED="false" CREATEDBY_ID="[null]" UPDATEDBY_ID="[null]" NAME_ID="5000" SEC_ID="[null]" TAXONOMICPARENTCACHE_ID="[null]"/> |
|
4 |
<TAXONBASE DTYPE="Taxon" ID="5001" CREATED="2015-01-07 21:54:20.0" UUID="00f3ab3d-b8a7-4a28-95c1-e654f548bf7e" UPDATED="2015-01-07 21:54:20.76" LSID_AUTHORITY="[null]" LSID_LSID="[null]" LSID_NAMESPACE="[null]" LSID_OBJECT="[null]" LSID_REVISION="[null]" PROTECTEDTITLECACHE="true" TITLECACHE="Cached taxon" APPENDEDPHRASE="[null]" DOUBTFUL="false" PUBLISH="true" USENAMECACHE="false" EXCLUDED="false" TAXONSTATUSUNKNOWN="false" TAXONOMICCHILDRENCOUNT="0" UNPLACED="false" CREATEDBY_ID="[null]" UPDATEDBY_ID="[null]" NAME_ID="[null]" SEC_ID="[null]" TAXONOMICPARENTCACHE_ID="[null]"/> |
|
5 |
<TAXONBASE DTYPE="Synonym" ID="5002" CREATED="2015-01-22 01:56:08.0" UUID="b92f77bc-c61d-44e1-b44e-f3f4ba4e6ade" UPDATED="2015-01-22 01:56:08.134" LSID_AUTHORITY="[null]" LSID_LSID="[null]" LSID_NAMESPACE="[null]" LSID_OBJECT="[null]" LSID_REVISION="[null]" PROTECTEDTITLECACHE="false" TITLECACHE="Synonym#0<b92f77bc-c61d-44e1-b44e-f3f4ba4e6ade>" APPENDEDPHRASE="[null]" DOUBTFUL="false" PUBLISH="true" USENAMECACHE="false" EXCLUDED="[null]" TAXONSTATUSUNKNOWN="[null]" TAXONOMICCHILDRENCOUNT="[null]" UNPLACED="[null]" CREATEDBY_ID="[null]" UPDATEDBY_ID="[null]" NAME_ID="[null]" SEC_ID="[null]" TAXONOMICPARENTCACHE_ID="[null]"/> |
|
6 |
<TAXONBASE DTYPE="Synonym" ID="5003" CREATED="2015-01-22 01:56:08.0" UUID="d9f9a849-d75b-4a37-8434-df191ea083c3" UPDATED="2015-01-22 01:56:08.134" LSID_AUTHORITY="[null]" LSID_LSID="[null]" LSID_NAMESPACE="[null]" LSID_OBJECT="[null]" LSID_REVISION="[null]" PROTECTEDTITLECACHE="false" TITLECACHE="Synonym#0<b92f77bc-c61d-44e1-b44e-f3f4ba4e6ade>" APPENDEDPHRASE="[null]" DOUBTFUL="false" PUBLISH="true" USENAMECACHE="false" EXCLUDED="[null]" TAXONSTATUSUNKNOWN="[null]" TAXONOMICCHILDRENCOUNT="[null]" UNPLACED="[null]" CREATEDBY_ID="[null]" UPDATEDBY_ID="[null]" NAME_ID="[null]" SEC_ID="[null]" TAXONOMICPARENTCACHE_ID="[null]"/> |
|
7 |
<TAXONNAMEBASE DTYPE="BotanicalName" ID="5000" CREATED="2015-01-07 21:54:20.0" UUID="14697dc1-7786-4c21-b56d-1e6601327417" UPDATED="2015-01-07 21:54:20.76" LSID_AUTHORITY="[null]" LSID_LSID="[null]" LSID_NAMESPACE="[null]" LSID_OBJECT="[null]" LSID_REVISION="[null]" PROTECTEDTITLECACHE="true" TITLECACHE="Abies alba" APPENDEDPHRASE="[null]" FULLTITLECACHE="" NOMENCLATURALMICROREFERENCE="[null]" PARSINGPROBLEM="0" PROBLEMENDS="-1" PROBLEMSTARTS="-1" PROTECTEDFULLTITLECACHE="false" AUTHORSHIPCACHE="" BINOMHYBRID="false" GENUSORUNINOMIAL="[null]" HYBRIDFORMULA="false" INFRAGENERICEPITHET="[null]" INFRASPECIFICEPITHET="[null]" MONOMHYBRID="false" NAMECACHE="" PROTECTEDAUTHORSHIPCACHE="false" PROTECTEDNAMECACHE="false" SPECIFICEPITHET="[null]" TRINOMHYBRID="false" NAMEAPPROBATION="[null]" SUBGENUSAUTHORSHIP="[null]" ANAMORPHIC="false" CULTIVARNAME="[null]" ACRONYM="[null]" BREED="[null]" ORIGINALPUBLICATIONYEAR="[null]" PUBLICATIONYEAR="[null]" CREATEDBY_ID="[null]" UPDATEDBY_ID="[null]" HOMOTYPICALGROUP_ID="5000" NOMENCLATURALREFERENCE_ID="[null]" RANK_ID="765" BASIONYMAUTHORSHIP_ID="[null]" COMBINATIONAUTHORSHIP_ID="[null]" EXBASIONYMAUTHORSHIP_ID="[null]" EXCOMBINATIONAUTHORSHIP_ID="[null]"/> |
|
8 |
<IDENTIFIER ID="5000" UUID="f27ece3f-a94a-4748-b9a6-dc6ca3e9b589" CREATED="2015-01-07 21:54:20.0" UPDATED="2015-01-07 21:54:20.76" IDENTIFIER="ext-name12" CREATEDBY_ID="[null]" UPDATEDBY_ID="[null]" TYPE_ID="2062"/> |
|
9 |
<IDENTIFIER ID="5001" UUID="9f42987a-0cc3-49f8-a0df-83fafc1247f8" CREATED="2015-01-07 21:54:20.0" UPDATED="2015-01-07 21:54:20.76" IDENTIFIER="ext-1234" CREATEDBY_ID="[null]" UPDATEDBY_ID="[null]" TYPE_ID="2061"/> |
|
10 |
<IDENTIFIER ID="5002" UUID="433ad739-b62c-451f-bde9-f0c7ffa3d829" CREATED="2015-01-07 21:54:20.0" UPDATED="2015-01-07 21:54:20.76" IDENTIFIER="ext-cache1" CREATEDBY_ID="[null]" UPDATEDBY_ID="[null]" TYPE_ID="2062"/> |
|
11 |
<IDENTIFIER ID="5003" UUID="b08d005f-a1f1-41bb-a8bc-448bde2569dc" CREATED="2015-01-07 21:54:20.0" UPDATED="2015-01-07 21:54:20.76" IDENTIFIER="ext-syn1" CREATEDBY_ID="[null]" UPDATEDBY_ID="[null]" TYPE_ID="2062"/> |
|
12 |
<IDENTIFIER ID="5004" UUID="2d1fb00b-51fa-441a-81e7-79577bef4e2d" CREATED="2015-01-07 21:54:20.0" UPDATED="2015-01-07 21:54:20.76" IDENTIFIER="ext-syn2" CREATEDBY_ID="[null]" UPDATEDBY_ID="[null]" TYPE_ID="2062"/> |
|
13 |
<TAXONBASE_IDENTIFIER TAXONBASE_ID="5000" IDENTIFIERS_ID="5001" SORTINDEX="0"/> |
|
14 |
<TAXONBASE_IDENTIFIER TAXONBASE_ID="5001" IDENTIFIERS_ID="5002" SORTINDEX="0"/> |
|
15 |
<TAXONBASE_IDENTIFIER TAXONBASE_ID="5002" IDENTIFIERS_ID="5003" SORTINDEX="0"/> |
|
16 |
<TAXONBASE_IDENTIFIER TAXONBASE_ID="5003" IDENTIFIERS_ID="5004" SORTINDEX="0"/> |
|
17 |
<TAXONNAMEBASE_IDENTIFIER TAXONNAMEBASE_ID="5000" IDENTIFIERS_ID="5000" SORTINDEX="0"/> |
|
18 |
<CLASSIFICATION ID="5000" CREATED="2015-01-07 21:54:20.0" UUID="277ac532-b670-4a1b-927a-61063ecfeb5b" UPDATED="2015-01-07 21:54:20.76" LSID_AUTHORITY="[null]" LSID_LSID="[null]" LSID_NAMESPACE="[null]" LSID_OBJECT="[null]" LSID_REVISION="[null]" PROTECTEDTITLECACHE="true" TITLECACHE="My classification" MICROREFERENCE="[null]" TIMEPERIOD_START="[null]" TIMEPERIOD_FREETEXT="[null]" TIMEPERIOD_END="[null]" CREATEDBY_ID="[null]" UPDATEDBY_ID="[null]" NAME_ID="[null]" REFERENCE_ID="[null]" ROOTNODE_ID="5000"/> |
|
19 |
<TAXONNODE ID="5000" CREATED="2015-01-07 21:54:20.0" UUID="cf00cde1-efc8-4d3b-8c5c-71c3d6e692d9" UPDATED="2015-01-07 21:54:20.76" SORTINDEX="-1" TREEINDEX="#t5000#5000#" COUNTCHILDREN="1" MICROREFERENCEFORPARENTCHILDRELATION="[null]" CREATEDBY_ID="[null]" UPDATEDBY_ID="[null]" CLASSIFICATION_ID="5000" PARENT_ID="[null]" REFERENCEFORPARENTCHILDRELATION_ID="[null]" SYNONYMTOBEUSED_ID="[null]" TAXON_ID="[null]"/> |
|
20 |
<TAXONNODE ID="5001" CREATED="2015-01-07 21:54:20.0" UUID="73d8ece1-c511-48b7-9a1f-f6fab3149bf1" UPDATED="2015-01-07 21:54:20.76" SORTINDEX="0" TREEINDEX="#t5000#5000#5001#" COUNTCHILDREN="0" MICROREFERENCEFORPARENTCHILDRELATION="[null]" CREATEDBY_ID="[null]" UPDATEDBY_ID="[null]" CLASSIFICATION_ID="5000" PARENT_ID="5000" REFERENCEFORPARENTCHILDRELATION_ID="[null]" SYNONYMTOBEUSED_ID="[null]" TAXON_ID="5000"/> |
|
21 |
<HOMOTYPICALGROUP ID="5000" CREATED="2015-01-07 21:54:20.0" UUID="599e8459-4302-47d5-aa0b-9b69a0f329e4" UPDATED="2015-01-07 21:54:20.76" CREATEDBY_ID="[null]" UPDATEDBY_ID="[null]"/> |
|
22 |
<SYNONYMRELATIONSHIP ID="5000" CREATED="2015-01-22 01:56:08.0" UUID="946836b6-7b57-4d40-8abf-33f3ea0e1b4d" UPDATED="2015-01-22 01:56:08.134" CITATIONMICROREFERENCE="[null]" ORIGINALNAMESTRING="[null]" DOUBTFUL="false" PARTIAL="false" PROPARTE="false" CREATEDBY_ID="[null]" UPDATEDBY_ID="[null]" CITATION_ID="[null]" RELATEDFROM_ID="5002" RELATEDTO_ID="5000" TYPE_ID="847"/> |
|
23 |
<SYNONYMRELATIONSHIP ID="5001" CREATED="2015-01-22 01:56:08.0" UUID="38824018-4a6d-42af-8c97-8a10f94999cd" UPDATED="2015-01-22 01:56:08.134" CITATIONMICROREFERENCE="[null]" ORIGINALNAMESTRING="[null]" DOUBTFUL="false" PARTIAL="false" PROPARTE="false" CREATEDBY_ID="[null]" UPDATEDBY_ID="[null]" CITATION_ID="[null]" RELATEDFROM_ID="5003" RELATEDTO_ID="5001" TYPE_ID="847"/> |
|
24 |
|
|
25 |
<!-- <DEFINEDTERMBASE DTYPE="DefinedTerm" ID="5000" CREATED="2015-01-07 21:47:27.0" UUID="02bb62db-a229-4eeb-83e6-a9a093943d5e" UPDATED="[null]" TERMTYPE="IDE" IDINVOCABULARY="[null]" LSID_AUTHORITY="[null]" LSID_LSID="[null]" LSID_NAMESPACE="[null]" LSID_OBJECT="[null]" LSID_REVISION="[null]" PROTECTEDTITLECACHE="false" TITLECACHE="identifierType1" URI="[null]" ISO639_1="[null]" RANKCLASS="[null]" ISTECHNICAL="[null]" ABSENCETERM="[null]" ORDERINDEX="[null]" SYMMETRICAL="[null]" TRANSITIVE="[null]" DEFAULTCOLOR="[null]" SUPPORTSCATEGORICALDATA="[null]" SUPPORTSCOMMONTAXONNAME="[null]" SUPPORTSDISTRIBUTION="[null]" SUPPORTSINDIVIDUALASSOCIATION="[null]" SUPPORTSQUANTITATIVEDATA="[null]" SUPPORTSTAXONINTERACTION="[null]" SUPPORTSTEXTDATA="[null]" POINTAPPROXIMATION_ERRORRADIUS="[null]" POINTAPPROXIMATION_LATITUDE="[null]" POINTAPPROXIMATION_LONGITUDE="[null]" VALIDPERIOD_END="[null]" VALIDPERIOD_FREETEXT="[null]" VALIDPERIOD_START="[null]" ISO3166_A2="[null]" CREATEDBY_ID="[null]" UPDATEDBY_ID="[null]" KINDOF_ID="[null]" PARTOF_ID="[null]" VOCABULARY_ID="48" LEVEL_ID="[null]" POINTAPPROXIMATION_REFERENCESYSTEM_ID="[null]" SHAPE_ID="[null]" TYPE_ID="[null]"/> --> |
|
26 |
<!-- <DEFINEDTERMBASE DTYPE="DefinedTerm" ID="5001" CREATED="2015-01-07 21:47:27.0" UUID="ef6e960f-5289-456c-b25c-cff7f4de2f63" UPDATED="[null]" TERMTYPE="IDE" IDINVOCABULARY="[null]" LSID_AUTHORITY="[null]" LSID_LSID="[null]" LSID_NAMESPACE="[null]" LSID_OBJECT="[null]" LSID_REVISION="[null]" PROTECTEDTITLECACHE="false" TITLECACHE="identifierType2" URI="[null]" ISO639_1="[null]" RANKCLASS="[null]" ISTECHNICAL="[null]" ABSENCETERM="[null]" ORDERINDEX="[null]" SYMMETRICAL="[null]" TRANSITIVE="[null]" DEFAULTCOLOR="[null]" SUPPORTSCATEGORICALDATA="[null]" SUPPORTSCOMMONTAXONNAME="[null]" SUPPORTSDISTRIBUTION="[null]" SUPPORTSINDIVIDUALASSOCIATION="[null]" SUPPORTSQUANTITATIVEDATA="[null]" SUPPORTSTAXONINTERACTION="[null]" SUPPORTSTEXTDATA="[null]" POINTAPPROXIMATION_ERRORRADIUS="[null]" POINTAPPROXIMATION_LATITUDE="[null]" POINTAPPROXIMATION_LONGITUDE="[null]" VALIDPERIOD_END="[null]" VALIDPERIOD_FREETEXT="[null]" VALIDPERIOD_START="[null]" ISO3166_A2="[null]" CREATEDBY_ID="[null]" UPDATEDBY_ID="[null]" KINDOF_ID="[null]" PARTOF_ID="[null]" VOCABULARY_ID="48" LEVEL_ID="[null]" POINTAPPROXIMATION_REFERENCESYSTEM_ID="[null]" SHAPE_ID="[null]" TYPE_ID="[null]"/> --> |
|
27 |
<!-- <DEFINEDTERMBASE DTYPE="DefinedTerm" ID="5000" CREATED="2015-01-07 21:47:27.0" UUID="02bb62db-a229-4eeb-83e6-a9a093943d5e" UPDATED="[null]" TERMTYPE="IDE" IDINVOCABULARY="[null]" PROTECTEDTITLECACHE="false" TITLECACHE="identifierType1" URI="[null]" ISO639_1="[null]" ISTECHNICAL="[null]" ABSENCETERM="[null]" SYMMETRICAL="[null]" TRANSITIVE="[null]" VOCABULARY_ID="48" /> --> |
|
28 |
<!-- <DEFINEDTERMBASE DTYPE="DefinedTerm" ID="5001" CREATED="2015-01-07 21:47:27.0" UUID="ef6e960f-5289-456c-b25c-cff7f4de2f63" UPDATED="[null]" TERMTYPE="IDE" IDINVOCABULARY="[null]" PROTECTEDTITLECACHE="false" TITLECACHE="identifierType2" URI="[null]" ISO639_1="[null]" ISTECHNICAL="[null]" ABSENCETERM="[null]" SYMMETRICAL="[null]" TRANSITIVE="[null]" VOCABULARY_ID="48"/> --> |
|
29 |
|
|
30 |
</dataset> |
cdmlib-services/src/test/resources/eu/etaxonomy/cdm/api/service/IdentifiableServiceBaseTest.testFindByIdentifierOrMarker.xml | ||
---|---|---|
1 |
<?xml version='1.0' encoding='UTF-8'?> |
|
2 |
<dataset> |
|
3 |
<TAXONBASE DTYPE="Taxon" ID="5000" CREATED="2015-01-07 21:54:20.0" UUID="888cded1-cadc-48de-8629-e32927919879" UPDATED="2015-01-07 21:54:20.76" LSID_AUTHORITY="[null]" LSID_LSID="[null]" LSID_NAMESPACE="[null]" LSID_OBJECT="[null]" LSID_REVISION="[null]" PROTECTEDTITLECACHE="false" TITLECACHE="Abies alba sec. ???" APPENDEDPHRASE="[null]" DOUBTFUL="false" PUBLISH="true" USENAMECACHE="false" EXCLUDED="false" TAXONSTATUSUNKNOWN="false" TAXONOMICCHILDRENCOUNT="0" UNPLACED="false" CREATEDBY_ID="[null]" UPDATEDBY_ID="[null]" NAME_ID="5000" SEC_ID="[null]" TAXONOMICPARENTCACHE_ID="[null]"/> |
|
4 |
<TAXONBASE DTYPE="Taxon" ID="5001" CREATED="2015-01-07 21:54:20.0" UUID="00f3ab3d-b8a7-4a28-95c1-e654f548bf7e" UPDATED="2015-01-07 21:54:20.76" LSID_AUTHORITY="[null]" LSID_LSID="[null]" LSID_NAMESPACE="[null]" LSID_OBJECT="[null]" LSID_REVISION="[null]" PROTECTEDTITLECACHE="true" TITLECACHE="Cached taxon" APPENDEDPHRASE="[null]" DOUBTFUL="false" PUBLISH="true" USENAMECACHE="false" EXCLUDED="false" TAXONSTATUSUNKNOWN="false" TAXONOMICCHILDRENCOUNT="0" UNPLACED="false" CREATEDBY_ID="[null]" UPDATEDBY_ID="[null]" NAME_ID="[null]" SEC_ID="[null]" TAXONOMICPARENTCACHE_ID="[null]"/> |
|
5 |
<TAXONBASE DTYPE="Synonym" ID="5002" CREATED="2015-01-22 01:56:08.0" UUID="b92f77bc-c61d-44e1-b44e-f3f4ba4e6ade" UPDATED="2015-01-22 01:56:08.134" LSID_AUTHORITY="[null]" LSID_LSID="[null]" LSID_NAMESPACE="[null]" LSID_OBJECT="[null]" LSID_REVISION="[null]" PROTECTEDTITLECACHE="false" TITLECACHE="Synonym#0<b92f77bc-c61d-44e1-b44e-f3f4ba4e6ade>" APPENDEDPHRASE="[null]" DOUBTFUL="false" PUBLISH="true" USENAMECACHE="false" EXCLUDED="[null]" TAXONSTATUSUNKNOWN="[null]" TAXONOMICCHILDRENCOUNT="[null]" UNPLACED="[null]" CREATEDBY_ID="[null]" UPDATEDBY_ID="[null]" NAME_ID="[null]" SEC_ID="[null]" TAXONOMICPARENTCACHE_ID="[null]"/> |
|
6 |
<TAXONBASE DTYPE="Synonym" ID="5003" CREATED="2015-01-22 01:56:08.0" UUID="d9f9a849-d75b-4a37-8434-df191ea083c3" UPDATED="2015-01-22 01:56:08.134" LSID_AUTHORITY="[null]" LSID_LSID="[null]" LSID_NAMESPACE="[null]" LSID_OBJECT="[null]" LSID_REVISION="[null]" PROTECTEDTITLECACHE="false" TITLECACHE="Synonym#0<b92f77bc-c61d-44e1-b44e-f3f4ba4e6ade>" APPENDEDPHRASE="[null]" DOUBTFUL="false" PUBLISH="true" USENAMECACHE="false" EXCLUDED="[null]" TAXONSTATUSUNKNOWN="[null]" TAXONOMICCHILDRENCOUNT="[null]" UNPLACED="[null]" CREATEDBY_ID="[null]" UPDATEDBY_ID="[null]" NAME_ID="[null]" SEC_ID="[null]" TAXONOMICPARENTCACHE_ID="[null]"/> |
|
7 |
<TAXONNAMEBASE DTYPE="BotanicalName" ID="5000" CREATED="2015-01-07 21:54:20.0" UUID="14697dc1-7786-4c21-b56d-1e6601327417" UPDATED="2015-01-07 21:54:20.76" LSID_AUTHORITY="[null]" LSID_LSID="[null]" LSID_NAMESPACE="[null]" LSID_OBJECT="[null]" LSID_REVISION="[null]" PROTECTEDTITLECACHE="true" TITLECACHE="Abies alba" APPENDEDPHRASE="[null]" FULLTITLECACHE="" NOMENCLATURALMICROREFERENCE="[null]" PARSINGPROBLEM="0" PROBLEMENDS="-1" PROBLEMSTARTS="-1" PROTECTEDFULLTITLECACHE="false" AUTHORSHIPCACHE="" BINOMHYBRID="false" GENUSORUNINOMIAL="[null]" HYBRIDFORMULA="false" INFRAGENERICEPITHET="[null]" INFRASPECIFICEPITHET="[null]" MONOMHYBRID="false" NAMECACHE="" PROTECTEDAUTHORSHIPCACHE="false" PROTECTEDNAMECACHE="false" SPECIFICEPITHET="[null]" TRINOMHYBRID="false" NAMEAPPROBATION="[null]" SUBGENUSAUTHORSHIP="[null]" ANAMORPHIC="false" CULTIVARNAME="[null]" ACRONYM="[null]" BREED="[null]" ORIGINALPUBLICATIONYEAR="[null]" PUBLICATIONYEAR="[null]" CREATEDBY_ID="[null]" UPDATEDBY_ID="[null]" HOMOTYPICALGROUP_ID="5000" NOMENCLATURALREFERENCE_ID="[null]" RANK_ID="765" BASIONYMAUTHORSHIP_ID="[null]" COMBINATIONAUTHORSHIP_ID="[null]" EXBASIONYMAUTHORSHIP_ID="[null]" EXCOMBINATIONAUTHORSHIP_ID="[null]"/> |
|
8 |
<IDENTIFIER ID="5000" UUID="f27ece3f-a94a-4748-b9a6-dc6ca3e9b589" CREATED="2015-01-07 21:54:20.0" IDENTIFIER="ext-name12" CREATEDBY_ID="[null]" UPDATEDBY_ID="[null]" TYPE_ID="2062"/> |
|
9 |
<IDENTIFIER ID="5001" UUID="9f42987a-0cc3-49f8-a0df-83fafc1247f8" CREATED="2015-01-07 21:54:20.0" IDENTIFIER="ext-1234" CREATEDBY_ID="[null]" UPDATEDBY_ID="[null]" TYPE_ID="2061"/> |
|
10 |
<IDENTIFIER ID="5002" UUID="433ad739-b62c-451f-bde9-f0c7ffa3d829" CREATED="2015-01-07 21:54:20.0" IDENTIFIER="ext-cache1" CREATEDBY_ID="[null]" UPDATEDBY_ID="[null]" TYPE_ID="2062"/> |
|
11 |
<IDENTIFIER ID="5003" UUID="b08d005f-a1f1-41bb-a8bc-448bde2569dc" CREATED="2015-01-07 21:54:20.0" IDENTIFIER="ext-syn1" CREATEDBY_ID="[null]" UPDATEDBY_ID="[null]" TYPE_ID="2062"/> |
|
12 |
<IDENTIFIER ID="5004" UUID="2d1fb00b-51fa-441a-81e7-79577bef4e2d" CREATED="2015-01-07 21:54:20.0" IDENTIFIER="ext-syn2" CREATEDBY_ID="[null]" UPDATEDBY_ID="[null]" TYPE_ID="2062"/> |
|
13 |
<MARKER ID="5000" UUID="2aecee45-4930-4f16-bdc6-8e41d657b74f" CREATED="2016-09-16 21:54:20.0" FLAG="true" MARKERTYPE_ID="890"/> |
|
14 |
<MARKER ID="5001" UUID="5cf0d264-48f3-4ad1-8294-6649dba4d259" CREATED="2016-09-16 21:54:20.0" FLAG="true" MARKERTYPE_ID="890"/> |
|
15 |
<MARKER ID="5002" UUID="f7064d00-3d29-45f1-8188-c132cb701b7b" CREATED="2016-09-16 21:54:20.0" FLAG="true" MARKERTYPE_ID="890"/> |
|
16 |
<MARKER ID="5003" UUID="ae683ce1-cbef-425e-9b0b-6bfffcf912d1" CREATED="2016-09-16 21:54:20.0" FLAG="true" MARKERTYPE_ID="890"/> |
|
17 |
<MARKER ID="5004" UUID="dc011c6c-345c-4042-9cca-ee22af29ffea" CREATED="2016-09-16 21:54:20.0" FLAG="false" MARKERTYPE_ID="890"/> |
|
18 |
|
|
19 |
<TAXONBASE_IDENTIFIER TAXONBASE_ID="5000" IDENTIFIERS_ID="5001" SORTINDEX="0"/> |
|
20 |
<TAXONBASE_IDENTIFIER TAXONBASE_ID="5001" IDENTIFIERS_ID="5002" SORTINDEX="0"/> |
|
21 |
<TAXONBASE_IDENTIFIER TAXONBASE_ID="5002" IDENTIFIERS_ID="5003" SORTINDEX="0"/> |
|
22 |
<TAXONBASE_IDENTIFIER TAXONBASE_ID="5003" IDENTIFIERS_ID="5004" SORTINDEX="0"/> |
|
23 |
<TAXONBASE_MARKER TAXONBASE_ID="5000" MARKERS_ID="5001"/> |
|
24 |
<TAXONBASE_MARKER TAXONBASE_ID="5001" MARKERS_ID="5002"/> |
|
25 |
<TAXONBASE_MARKER TAXONBASE_ID="5002" MARKERS_ID="5003"/> |
|
26 |
<TAXONBASE_MARKER TAXONBASE_ID="5003" MARKERS_ID="5004"/> |
|
27 |
<TAXONNAMEBASE_IDENTIFIER TAXONNAMEBASE_ID="5000" IDENTIFIERS_ID="5000" SORTINDEX="0"/> |
|
28 |
<TAXONNAMEBASE_MARKER TAXONNAMEBASE_ID="5000" MARKERS_ID="5000"/> |
|
29 |
|
|
30 |
<CLASSIFICATION ID="5000" CREATED="2015-01-07 21:54:20.0" UUID="277ac532-b670-4a1b-927a-61063ecfeb5b" UPDATED="2015-01-07 21:54:20.76" LSID_AUTHORITY="[null]" LSID_LSID="[null]" LSID_NAMESPACE="[null]" LSID_OBJECT="[null]" LSID_REVISION="[null]" PROTECTEDTITLECACHE="true" TITLECACHE="My classification" MICROREFERENCE="[null]" TIMEPERIOD_START="[null]" TIMEPERIOD_FREETEXT="[null]" TIMEPERIOD_END="[null]" CREATEDBY_ID="[null]" UPDATEDBY_ID="[null]" NAME_ID="[null]" REFERENCE_ID="[null]" ROOTNODE_ID="5000"/> |
|
31 |
<TAXONNODE ID="5000" CREATED="2015-01-07 21:54:20.0" UUID="cf00cde1-efc8-4d3b-8c5c-71c3d6e692d9" UPDATED="2015-01-07 21:54:20.76" SORTINDEX="-1" TREEINDEX="#t5000#5000#" COUNTCHILDREN="1" MICROREFERENCEFORPARENTCHILDRELATION="[null]" CREATEDBY_ID="[null]" UPDATEDBY_ID="[null]" CLASSIFICATION_ID="5000" PARENT_ID="[null]" REFERENCEFORPARENTCHILDRELATION_ID="[null]" SYNONYMTOBEUSED_ID="[null]" TAXON_ID="[null]"/> |
|
32 |
<TAXONNODE ID="5001" CREATED="2015-01-07 21:54:20.0" UUID="73d8ece1-c511-48b7-9a1f-f6fab3149bf1" UPDATED="2015-01-07 21:54:20.76" SORTINDEX="0" TREEINDEX="#t5000#5000#5001#" COUNTCHILDREN="0" MICROREFERENCEFORPARENTCHILDRELATION="[null]" CREATEDBY_ID="[null]" UPDATEDBY_ID="[null]" CLASSIFICATION_ID="5000" PARENT_ID="5000" REFERENCEFORPARENTCHILDRELATION_ID="[null]" SYNONYMTOBEUSED_ID="[null]" TAXON_ID="5000"/> |
|
33 |
<HOMOTYPICALGROUP ID="5000" CREATED="2015-01-07 21:54:20.0" UUID="599e8459-4302-47d5-aa0b-9b69a0f329e4" UPDATED="2015-01-07 21:54:20.76" CREATEDBY_ID="[null]" UPDATEDBY_ID="[null]"/> |
|
34 |
<SYNONYMRELATIONSHIP ID="5000" CREATED="2015-01-22 01:56:08.0" UUID="946836b6-7b57-4d40-8abf-33f3ea0e1b4d" UPDATED="2015-01-22 01:56:08.134" CITATIONMICROREFERENCE="[null]" ORIGINALNAMESTRING="[null]" DOUBTFUL="false" PARTIAL="false" PROPARTE="false" CREATEDBY_ID="[null]" UPDATEDBY_ID="[null]" CITATION_ID="[null]" RELATEDFROM_ID="5002" RELATEDTO_ID="5000" TYPE_ID="847"/> |
|
35 |
<SYNONYMRELATIONSHIP ID="5001" CREATED="2015-01-22 01:56:08.0" UUID="38824018-4a6d-42af-8c97-8a10f94999cd" UPDATED="2015-01-22 01:56:08.134" CITATIONMICROREFERENCE="[null]" ORIGINALNAMESTRING="[null]" DOUBTFUL="false" PARTIAL="false" PROPARTE="false" CREATEDBY_ID="[null]" UPDATEDBY_ID="[null]" CITATION_ID="[null]" RELATEDFROM_ID="5003" RELATEDTO_ID="5001" TYPE_ID="847"/> |
|
36 |
|
|
37 |
</dataset> |
Also available in: Unified diff
fix #6072 Implement findIdentifiableEntityByMarkers