Exemplo n.º 1
0
 /**
  * Builds the main concept node of the left tree
  *
  * @param parentId the identifier of the thesaurus
  * @return
  */
 public IThesaurusListNode getConcepts(String parentId) {
   IThesaurusListNode concepts = new ThesaurusListBasicNode();
   concepts.setTitle("Arborescence des concepts");
   concepts.setId(CONCEPTS_PREFIX + parentId);
   concepts.setType(ThesaurusListNodeType.FOLDER);
   concepts.setIconCls("icon-tree");
   concepts.setExpanded(false);
   concepts.setDisplayable(false);
   long nbTopConcepts = thesaurusConceptService.getTopTermThesaurusConceptsCount(parentId);
   if (nbTopConcepts > 0) {
     concepts.setChildren(null);
   } else {
     concepts.setChildren(new ArrayList<IThesaurusListNode>());
   }
   return concepts;
 }
Exemplo n.º 2
0
 /**
  * Builds the orphan concepts node of the left tree
  *
  * @param parentId the identifier of the thesaurus
  * @return the node, null if there are no orphan concepts
  */
 public IThesaurusListNode getOrphans(String parentId) {
   IThesaurusListNode orphans = new ThesaurusListBasicNode();
   orphans.setTitle("Concepts orphelins");
   orphans.setId(ORPHANS_PREFIX + parentId);
   orphans.setType(ThesaurusListNodeType.FOLDER);
   orphans.setIconCls("sandbox");
   orphans.setExpanded(false);
   orphans.setDisplayable(false);
   long nbOrphans = thesaurusConceptService.getOrphanThesaurusConceptsCount(parentId);
   if (nbOrphans > 0) {
     orphans.setChildren(null);
   } else {
     return null;
   }
   return orphans;
 }
Exemplo n.º 3
0
  /**
   * Builds the group node of the left tree
   *
   * @param parentId the identifier of the thesaurus
   * @return the node, null if there are no groups concepts
   */
  public IThesaurusListNode getGroups(String parentId) {
    IThesaurusListNode groups = new ThesaurusListBasicNode();
    groups.setTitle("Groupes");
    groups.setId(GROUPS_PREFIX + parentId);
    groups.setType(ThesaurusListNodeType.FOLDER);
    groups.setExpanded(false);
    groups.setIconCls("icon-group");
    groups.setChildren(new ArrayList<IThesaurusListNode>());
    groups.setDisplayable(false);

    List<ThesaurusConceptGroup> realArrays =
        thesaurusConceptGroupService.getAllThesaurusConceptGroupsByThesaurusId(null, parentId);
    if (realArrays != null && realArrays.size() > 0) {
      groups.setChildren(null);
    } else {
      return null;
    }

    return groups;
  }
Exemplo n.º 4
0
 /**
  * Builds the array node of the left tree
  *
  * @param parentId the identifier of the thesaurus
  * @return the node, null if there are no arrays
  */
 public IThesaurusListNode getArrays(String parentId) {
   IThesaurusListNode arrays = new ThesaurusListBasicNode();
   arrays.setTitle("Tableaux");
   arrays.setId(ARRAYS_PREFIX + parentId);
   arrays.setType(ThesaurusListNodeType.FOLDER);
   arrays.setExpanded(false);
   arrays.setIconCls("icon-table");
   arrays.setDisplayable(false);
   List<ThesaurusArray> realArrays =
       thesaurusArrayService.getAllThesaurusArrayByThesaurusId(null, parentId);
   if (realArrays != null && realArrays.size() > 0) {
     arrays.setChildren(null);
   } else {
     return null;
   }
   return arrays;
 }
Exemplo n.º 5
0
  /**
   * Builds the complex concepts node of the tree
   *
   * @param parentId the identifier of the thesaurus
   * @return the node, null if there are no complex concepts
   */
  public IThesaurusListNode getSplitNonPreferredTerms(String parentId) {
    IThesaurusListNode complexConceptNode = new ThesaurusListBasicNode();
    complexConceptNode.setTitle("Concepts complexes");
    complexConceptNode.setId(COMPLEXCONCEPTS_PREFIX + parentId);
    complexConceptNode.setType(ThesaurusListNodeType.FOLDER);
    complexConceptNode.setIconCls("icon-complex-concept");
    complexConceptNode.setExpanded(false);
    complexConceptNode.setDisplayable(true);

    long nbComplex = splitNonPreferredTermService.getSplitNonPreferredTermCount(parentId);
    if (nbComplex > 0) {
      complexConceptNode.setChildren(new ArrayList<IThesaurusListNode>());
    } else {
      return null;
    }
    return complexConceptNode;
  }
Exemplo n.º 6
0
  /**
   * Builds the sandbox node of the left tree.
   *
   * @param parentId the identifier of the thesaurus
   * @return the node, null if there are no terms in sandbox
   */
  public IThesaurusListNode getSandbox(String parentId) {
    IThesaurusListNode sandbox = new ThesaurusListBasicNode();
    sandbox.setTitle("Termes orphelins");
    sandbox.setId(SANDBOX_PREFIX + parentId);
    sandbox.setType(ThesaurusListNodeType.FOLDER);
    sandbox.setIconCls("sandbox");
    sandbox.setExpanded(false);
    sandbox.setDisplayable(true);

    long nbSandbox = thesaurusTermService.getSandboxedTermsCount(parentId);
    if (nbSandbox > 0) {
      sandbox.setChildren(new ArrayList<IThesaurusListNode>());
    } else {
      return null;
    }
    return sandbox;
  }