Project

General

Profile

Actions

task #8437

open

ITermTreeService provides a list method which supports filtering by TermTree.termType,

Added by Andreas Kohlbecker over 4 years ago. Updated over 4 years ago.

Status:
Resolved
Priority:
Priority14
Category:
cdmlib
Target version:
Start date:
Due date:
% Done:

80%

Estimated time:
Severity:
normal

Description

e.g.:


public List<TermTree> list(TermType termType, Integer limit, Integer start, List<OrderHint> orderHints, List<String> propertyPaths);


public Pager<TermTree> page(TermType termType, Integer pageSize, Integer pageIndex, List<OrderHint> orderHints, List<String> propertyPaths);

Related issues

Precedes EDIT - task #8436: featureTree/* services should filter the termTrees by the TermType FeatureClosedAndreas Kohlbecker

Actions
Actions #1

Updated by Andreas Kohlbecker over 4 years ago

  • Precedes task #8436: featureTree/* services should filter the termTrees by the TermType Feature added
Actions #2

Updated by Andreas Müller over 4 years ago

  • Status changed from New to In Progress
  • Priority changed from New to Priority14
  • Target version changed from Unassigned CDM tickets to Release 5.9
  • % Done changed from 0 to 40

implemented but no tests yet, but maybe you can integrate into controller already

Actions #3

Updated by Andreas Kohlbecker over 4 years ago

  • Status changed from In Progress to Resolved
  • % Done changed from 40 to 50

please can you review my changes?

Actions #4

Updated by Andreas Müller over 4 years ago

  • Status changed from Resolved to Feedback
  • Assignee changed from Andreas Müller to Andreas Kohlbecker

Have you tested with termType = Character which is a subtype for Feature. I don't think the "Restrictions" implementation will manage this correctly.

Actions #5

Updated by Andreas Müller over 4 years ago

So we definetely should write tests before closing.

Actions #6

Updated by Andreas Kohlbecker over 4 years ago

  • Assignee changed from Andreas Kohlbecker to Andreas Müller

Andreas Müller wrote:

Have you tested with termType = Character which is a subtype for Feature. I don't think the "Restrictions" implementation will manage this correctly.

I did not understand this as requirement and I see two problems whith this:

  1. From the TermTypes enum which is being used as filter it is not clear that using Feature will also include Character.
  2. How would it be possible to get TermTrees for Feature without Character ?

Therefore I suggest to allow passing a Set of TermTypes as filter:

public List<TermTree> list(Set<TermType> termType, Integer limit, Integer start, List<OrderHint> orderHints, List<String> propertyPaths);


public Pager<TermTree> page(Set<TermType> termType, Integer pageSize, Integer pageIndex, List<OrderHint> orderHints, List<String> propertyPaths);

which is supported by the restrictions api out of the box.

Actions #7

Updated by Andreas Müller over 4 years ago

  • Assignee changed from Andreas Müller to Andreas Kohlbecker

Andreas Kohlbecker wrote:

Andreas Müller wrote:

Have you tested with termType = Character which is a subtype for Feature. I don't think the "Restrictions" implementation will manage this correctly.

I did not understand this as requirement and I see two problems whith this:

  1. From the TermTypes enum which is being used as filter it is not clear that using Feature will also include Character.
  2. How would it be possible to get TermTrees for Feature without Character ?

Therefore I suggest to allow passing a Set of TermTypes as filter:

public List<TermTree> list(Set<TermType> termType, Integer limit, Integer start, List<OrderHint> orderHints, List<String> propertyPaths);


public Pager<TermTree> page(Set<TermType> termType, Integer pageSize, Integer pageIndex, List<OrderHint> orderHints, List<String> propertyPaths);

which is supported by the restrictions api out of the box.

The javadoc says "Is subtype of {@link #Feature}" which to me is clear. Also the idea of the term types is to replace classes as classes are difficult to handle sometimes. But the semantics should be the same. Therefore if using list(class, ....) you also do not expect that you need to pass all the subclasses as a collection of classes. This is exactely the same behavior as for classes and it is by intention. Therefore I do not agree with the above solution.

Actions #8

Updated by Andreas Kohlbecker over 4 years ago

  • Status changed from Feedback to Resolved
  • Assignee changed from Andreas Kohlbecker to Andreas Müller

Agreed ... and implemented in the way you pointed out.

Actions #9

Updated by Andreas Müller over 4 years ago

To me it looks like commit 1a5b2194 is not related to this ticket. Can you please check?

Actions #10

Updated by Andreas Müller over 4 years ago

  • Status changed from Resolved to Feedback
  • Assignee changed from Andreas Müller to Andreas Kohlbecker
  • % Done changed from 50 to 70

Andreas Kohlbecker wrote:

Agreed ... and implemented in the way you pointed out.

The current implementation is not generic as my first implementation was. It handles Characters as an explicit case. My first implementation did handle ALL sub-types. Currently only this 1 subtype exists, but in future there might be more.

Also it might be nice to have a little test that it works. Have you tested in some environment?

Actions #11

Updated by Andreas Kohlbecker over 4 years ago

  • Status changed from Feedback to Resolved
  • Assignee changed from Andreas Kohlbecker to Andreas Müller
  • % Done changed from 70 to 80

my implementation now is generic.

Also it might be nice to have a little test that it works. Have you tested in some environment?

I positively tested manually with the cdm_additivity_ontology database. Unit-tests do not yet exist.

Actions

Also available in: Atom PDF