com.jurismarches.vradi.services.managers
Class ThesaurusManager

java.lang.Object
  extended by com.jurismarches.vradi.services.managers.ThesaurusManager

public class ThesaurusManager
extends Object

Class containing the methods to manage the thesaurus : - node creation, update, retrieving, deletion - get child node number - get children

Version:
$Revision: 1512 $ $Date: 2010-09-28 11:22:36 +0200 (mar., 28 sept. 2010) $
Author:
schorlet

Field Summary
protected  org.nuiton.wikitty.WikittyProxy wikittyProxy
           
 
Constructor Summary
ThesaurusManager(org.nuiton.wikitty.WikittyProxy proxy)
           
 
Method Summary
 RootThesaurus createRootThesaurus(String rootThesaurusName)
          Create new thesaurus.
 void deleteAllThesaurus()
          Delete all thesaurus recursively.
 List<String> deleteThesaurus(String thesaurusId)
          Delete all thesaurus and sub thesaurus.
 List<Thesaurus> getChildrenThesaurus(String thesaurusId)
          Returns all children of the specified thesaurusId sorted by ordre and name.
 int getNbFormsForThesaurus(String thesaurusId)
           
 Map<Group,List<QueryBean>> getQueriesToModifyAfterThesaurusModification(String rootThesaurusName, String thesaurusName)
          Gets the query makers whose queries are potentially to modify after a thesaurus node modification
 List<RootThesaurus> getRootThesaurus()
          Return root thesaurus ids (ie thesaurus nodes without parent) sorted by root thesaurus name.
 List<Thesaurus> getThesaurus(List<String> thesaurusIds)
           
 Thesaurus getThesaurus(String thesaurusId)
           
 List<Thesaurus> getThesaurusAttachedToForm(Form form)
          Retourne l'ensemble des thesaurus qui sont attachés a un formulaire sorted by thesaurus name.
 boolean isRootThesaurusNameExists(String rootThesaurusName)
          Return true if rootThesaurusName already exists.
 boolean isRootThesaurusNameExists(String rootThesaurusName, String exceptedRootThesaurusId)
          Return true if rootThesaurusName already exists.
protected  boolean isThesaurusInQuery(CompareFilter compareFilter, String rootThesaurusName, String thesaurusName)
           
protected  boolean isThesaurusInQuery(FilterList list, String rootThesaurusName, String thesaurusName)
           
 boolean isThesaurusNameExistsInRootThesaurus(RootThesaurus rootThesaurus, String thesaurusName)
          Check if name of thesaurus is existing in rootThesaurus.
 boolean isThesaurusNameExistsInRootThesaurus(RootThesaurus rootThesaurus, String thesaurusName, String exceptedThesaurusId)
          Check if name of thesaurus is existing in rootThesaurus.
 List<Thesaurus> proposeThesaurus(Form form)
          Propose thesaurus nodes that might be in relation with a specified form.
protected  void replaceThesaurusInQuery(CompareFilter compareFilter, String oldRootThesaurusName, String newRootThesaurusName, String oldThesaurusName, String newThesaurusName)
           
protected  void replaceThesaurusInQuery(FilterList list, String oldRootThesaurusName, String newRootThesaurusName, String oldThesaurusName, String newThesaurusName)
           
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

wikittyProxy

protected org.nuiton.wikitty.WikittyProxy wikittyProxy
Constructor Detail

ThesaurusManager

public ThesaurusManager(org.nuiton.wikitty.WikittyProxy proxy)
Method Detail

getRootThesaurus

public List<RootThesaurus> getRootThesaurus()
                                     throws VradiException
Return root thesaurus ids (ie thesaurus nodes without parent) sorted by root thesaurus name.

Returns:
a RootThesaurus collection
Throws:
VradiException

getThesaurusAttachedToForm

public List<Thesaurus> getThesaurusAttachedToForm(Form form)
Retourne l'ensemble des thesaurus qui sont attachés a un formulaire sorted by thesaurus name.

Parameters:
form - form dont on veut les thesaurus
Returns:
thesaurus attachés au formulaire

getThesaurus

public Thesaurus getThesaurus(String thesaurusId)
                       throws VradiException
Throws:
VradiException

getThesaurus

public List<Thesaurus> getThesaurus(List<String> thesaurusIds)
                             throws VradiException
Throws:
VradiException

getChildrenThesaurus

public List<Thesaurus> getChildrenThesaurus(String thesaurusId)
                                     throws VradiException
Returns all children of the specified thesaurusId sorted by ordre and name.

Parameters:
thesaurusId - thesaurus wikitty id
Returns:
all list of TreeNodeImpl
Throws:
VradiException

deleteThesaurus

public List<String> deleteThesaurus(String thesaurusId)
                             throws VradiException
Delete all thesaurus and sub thesaurus.

Parameters:
thesaurusId - thesaurusId to delete
Returns:
delete thesaurus ids
Throws:
VradiException

deleteAllThesaurus

public void deleteAllThesaurus()
                        throws VradiException
Delete all thesaurus recursively.

Throws:
VradiException

getNbFormsForThesaurus

public int getNbFormsForThesaurus(String thesaurusId)
                           throws VradiException
Throws:
VradiException

proposeThesaurus

public List<Thesaurus> proposeThesaurus(Form form)
                                 throws VradiException
Propose thesaurus nodes that might be in relation with a specified form. Does'nt return thesaurus already associated with form.

Parameters:
form - the Form containing the information needed to search the thesaurus nodes
Returns:
a list of Thesaurus
Throws:
VradiException

getQueriesToModifyAfterThesaurusModification

public Map<Group,List<QueryBean>> getQueriesToModifyAfterThesaurusModification(String rootThesaurusName,
                                                                               String thesaurusName)
Gets the query makers whose queries are potentially to modify after a thesaurus node modification

Parameters:
rootThesaurusName - rootThesaurus name
thesaurusName - the modified thesaurus node
Returns:
a map containing the query makers and their queries which contains the thesaurus node name

isThesaurusInQuery

protected boolean isThesaurusInQuery(FilterList list,
                                     String rootThesaurusName,
                                     String thesaurusName)

isThesaurusInQuery

protected boolean isThesaurusInQuery(CompareFilter compareFilter,
                                     String rootThesaurusName,
                                     String thesaurusName)

replaceThesaurusInQuery

protected void replaceThesaurusInQuery(FilterList list,
                                       String oldRootThesaurusName,
                                       String newRootThesaurusName,
                                       String oldThesaurusName,
                                       String newThesaurusName)

replaceThesaurusInQuery

protected void replaceThesaurusInQuery(CompareFilter compareFilter,
                                       String oldRootThesaurusName,
                                       String newRootThesaurusName,
                                       String oldThesaurusName,
                                       String newThesaurusName)

createRootThesaurus

public RootThesaurus createRootThesaurus(String rootThesaurusName)
                                  throws VradiException
Create new thesaurus.

Parameters:
rootThesaurusName - root thesaurus name (must contains only alphnum characters)
Returns:
new created thesaurus
Throws:
VradiException - if name is not valid

isRootThesaurusNameExists

public boolean isRootThesaurusNameExists(String rootThesaurusName)
Return true if rootThesaurusName already exists.

Parameters:
rootThesaurusName - rootThesaurus name to test
Returns:
true if rootThesaurusName already exists

isRootThesaurusNameExists

public boolean isRootThesaurusNameExists(String rootThesaurusName,
                                         String exceptedRootThesaurusId)
Return true if rootThesaurusName already exists.

Parameters:
rootThesaurusName - rootThesaurus name to test
exceptedRootThesaurusId - in case of rename, exclude exceptedRootThesaurusId from check
Returns:
true if rootThesaurusName already exists

isThesaurusNameExistsInRootThesaurus

public boolean isThesaurusNameExistsInRootThesaurus(RootThesaurus rootThesaurus,
                                                    String thesaurusName)
Check if name of thesaurus is existing in rootThesaurus.

Parameters:
rootThesaurus - to check
thesaurusName - name to check
Returns:
true if thesaurus already exist

isThesaurusNameExistsInRootThesaurus

public boolean isThesaurusNameExistsInRootThesaurus(RootThesaurus rootThesaurus,
                                                    String thesaurusName,
                                                    String exceptedThesaurusId)
Check if name of thesaurus is existing in rootThesaurus.

Parameters:
rootThesaurus - to check
thesaurusName - name to check
exceptedThesaurusId - in case of rename, exclude exceptedThesaurusId from check
Returns:
true if thesaurus already exist


Copyright © 2009-2010 JurisMarches. All Rights Reserved.