com.jurismarches.vradi.services.managers
Class FormManager

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

public class FormManager
extends Object

Class containing the methods to manage the forms : - creation, update, deletion, retrieving - binding forms with clients whose queries are returning the forms

Version:
$Revision: 1589 $ $Date: 2010-10-01 12:53:19 +0200 (ven., 01 oct. 2010) $
Author:
schorlet

Field Summary
protected  SearchManager searchManager
           
protected  ThesaurusManager thesaurusManager
           
protected  org.nuiton.wikitty.WikittyProxy wikittyProxy
           
 
Constructor Summary
FormManager(org.nuiton.wikitty.WikittyProxy wikittyProxy, ThesaurusManager thesaurusManager, SearchManager searchManager)
           
 
Method Summary
protected  Set<Sending> attachForms(Session currentSession)
          Construit la liste des sending (un utilisateur et ses formulaires, soit un mail).
 Session bindForms(Session currentSession)
          Recherche tous les formulaires non lié et les lie à la session demandée.
 List<Sending> createAllSending(Session currentSession, Group group, List<Form> formsToBind, boolean removeAlreadyBind)
           
protected  List<Sending> createAllSending(Session currentSession, Group group, List<Form> formsToBind, boolean removeAlreadyBind, boolean save)
           
 List<Status> createDefaultStatuses()
           
 Session createNewSession()
          Crée une nouvelle session initialisée.
 Sending createUserSending(Session currentSession, User user, List<Form> formsToBind, boolean removeAlreadyBind)
           
protected  Sending createUserSending(Session currentSession, User user, List<Form> formsToBind, boolean removeAlreadyBind, boolean save)
           
 void deleteSession(String sessionId)
           
 boolean deleteStatuses(List<String> statusIds)
           
protected  Sending findExistingOrCreateSending(Session currentSession, User user)
          Recherche dans la session l'object sending qui correspond au query maker donné ou en crée une nouvelle s'il n'a pas été trouvé.
protected static String getBeginOfDaySolrDate(Date date)
          Retourne la date a minuit au format solr.
protected static String getEndOfDaySolrDate(Date date)
          Retourne la date a 23h59:59.999 au format solr.
 Session getLastCloseSession()
           
 Session getLastOpenSession()
           
 Status getNonSelectionneStatus()
           
 Status getNonTraiteStatus()
           
protected  Date getOlderInscriptionDate(Set<String> usersIds)
          Retourne la plus ancienne date du query maker si c'est une date ou des user gu groupe si c'est un groupe.
protected  Status getOrCreateStatus(VradiConstants.FormStatus type)
           
 Status getPreselectionneStatus()
           
 Status getSelectionneStatus()
           
 Session getSessionOfSending(String sendingId)
           
 List<Session> getSessions(Date sessionDate)
          Find all session for specific date.
 Status getStatus(String statusId)
           
 List<Status> getStatuses(List<String> statusIds)
           
protected  List<User> getUsersOfClient(String clientId)
           
 List<Sending> removeAllSending(Session session, Form form, Group group)
           
protected  List<Form> removeAlreadyBound(Session currentSession, List<Form> forms, User user)
          Retourne la liste forms d'origine en ayant filtré les formulaires qui ont déja été lié.
 boolean removeFormsFromSession(List<Form> forms)
          Check if template file form extension name in param
 Sending removeSending(Session session, Form form, User user)
           
 List<Form> updateForms(List<Form> forms, Set<String> thesaurus)
          Update forms and attach forms to specified thesaurus.
 Status updateStatus(Status status)
           
 List<Status> updateStatuses(List<Status> statuses)
           
 
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

thesaurusManager

protected ThesaurusManager thesaurusManager

searchManager

protected SearchManager searchManager
Constructor Detail

FormManager

public FormManager(org.nuiton.wikitty.WikittyProxy wikittyProxy,
                   ThesaurusManager thesaurusManager,
                   SearchManager searchManager)
Method Detail

updateForms

public List<Form> updateForms(List<Form> forms,
                              Set<String> thesaurus)
                       throws VradiException
Update forms and attach forms to specified thesaurus.

Parameters:
forms - forms to save
thesaurus - thesaurus to attach form to (set empty set to clear thesaurus, null = no thesaurus management)
Returns:
forms saved
Throws:
VradiException

getLastCloseSession

public Session getLastCloseSession()

getLastOpenSession

public Session getLastOpenSession()
                           throws VradiException
Throws:
VradiException

getSessions

public List<Session> getSessions(Date sessionDate)
                          throws VradiException
Find all session for specific date.

Parameters:
sessionDate - session date
Returns:
all session for date
Throws:
VradiException

getBeginOfDaySolrDate

protected static String getBeginOfDaySolrDate(Date date)
                                       throws VradiException
Retourne la date a minuit au format solr.

Parameters:
date -
Returns:
Throws:
VradiException

getEndOfDaySolrDate

protected static String getEndOfDaySolrDate(Date date)
                                     throws VradiException
Retourne la date a 23h59:59.999 au format solr.

Parameters:
date -
Returns:
Throws:
VradiException

createNewSession

public Session createNewSession()
                         throws VradiException
Crée une nouvelle session initialisée.

Returns:
la session créée
Throws:
VradiException

bindForms

public Session bindForms(Session currentSession)
                  throws VradiException
Recherche tous les formulaires non lié et les lie à la session demandée.

Parameters:
currentSession - session a remplir
Returns:
la session en argument
Throws:
VradiException

attachForms

protected Set<Sending> attachForms(Session currentSession)
                            throws VradiException
Construit la liste des sending (un utilisateur et ses formulaires, soit un mail).

Parameters:
currentSession - session
Returns:
les sending a traiter
Throws:
VradiException

getOlderInscriptionDate

protected Date getOlderInscriptionDate(Set<String> usersIds)
Retourne la plus ancienne date du query maker si c'est une date ou des user gu groupe si c'est un groupe.

Parameters:
queryMaker - queryMaker
Returns:

createAllSending

public List<Sending> createAllSending(Session currentSession,
                                      Group group,
                                      List<Form> formsToBind,
                                      boolean removeAlreadyBind)

createAllSending

protected List<Sending> createAllSending(Session currentSession,
                                         Group group,
                                         List<Form> formsToBind,
                                         boolean removeAlreadyBind,
                                         boolean save)

createUserSending

public Sending createUserSending(Session currentSession,
                                 User user,
                                 List<Form> formsToBind,
                                 boolean removeAlreadyBind)

createUserSending

protected Sending createUserSending(Session currentSession,
                                    User user,
                                    List<Form> formsToBind,
                                    boolean removeAlreadyBind,
                                    boolean save)

removeAllSending

public List<Sending> removeAllSending(Session session,
                                      Form form,
                                      Group group)
                               throws VradiException
Throws:
VradiException

removeSending

public Sending removeSending(Session session,
                             Form form,
                             User user)
                      throws VradiException
Throws:
VradiException

findExistingOrCreateSending

protected Sending findExistingOrCreateSending(Session currentSession,
                                              User user)
Recherche dans la session l'object sending qui correspond au query maker donné ou en crée une nouvelle s'il n'a pas été trouvé. Le sending retourné n'est pas affecter au query maker.

Parameters:
currentSession -
queryMaker -
Returns:

removeAlreadyBound

protected List<Form> removeAlreadyBound(Session currentSession,
                                        List<Form> forms,
                                        User user)
Retourne la liste forms d'origine en ayant filtré les formulaires qui ont déja été lié.

Parameters:
currentSession -
forms -
queryMaker -
Returns:

getStatus

public Status getStatus(String statusId)
                 throws VradiException
Throws:
VradiException

getStatuses

public List<Status> getStatuses(List<String> statusIds)
                         throws VradiException
Throws:
VradiException

createDefaultStatuses

public List<Status> createDefaultStatuses()
                                   throws VradiException
Throws:
VradiException

getNonTraiteStatus

public Status getNonTraiteStatus()

getNonSelectionneStatus

public Status getNonSelectionneStatus()

getPreselectionneStatus

public Status getPreselectionneStatus()

getSelectionneStatus

public Status getSelectionneStatus()

getOrCreateStatus

protected Status getOrCreateStatus(VradiConstants.FormStatus type)

updateStatuses

public List<Status> updateStatuses(List<Status> statuses)
                            throws VradiException
Throws:
VradiException

updateStatus

public Status updateStatus(Status status)
                    throws VradiException
Throws:
VradiException

deleteStatuses

public boolean deleteStatuses(List<String> statusIds)
                       throws VradiException
Throws:
VradiException

getUsersOfClient

protected List<User> getUsersOfClient(String clientId)

deleteSession

public void deleteSession(String sessionId)
                   throws VradiException
Throws:
VradiException

getSessionOfSending

public Session getSessionOfSending(String sendingId)
                            throws VradiException
Throws:
VradiException

removeFormsFromSession

public boolean removeFormsFromSession(List<Form> forms)
                               throws VradiException
Check if template file form extension name in param

Parameters:
forms - to remove
Returns:
false if no session is opened
Throws:
VradiException


Copyright © 2009-2010 JurisMarches. All Rights Reserved.