fr.paris.lutece.plugins.form.service
Class FormService

java.lang.Object
  extended by fr.paris.lutece.plugins.form.service.FormService

public final class FormService
extends Object

FormService


Method Summary
 void cleanFormResponses(Form form)
          Clean answers of a given form
 List<Integer> getAnonymizeEntryList(int nIdForm)
          Get the list of entries of a form to anonymize
static FormService getInstance()
          Returns the instance of the singleton
 Map<String,Object> getManageAdvancedParameters(fr.paris.lutece.portal.business.user.AdminUser user)
          Build the advanced parameters management
 int getMaxNumber(IEntry entry)
          Get the max number
 fr.paris.lutece.portal.business.style.Theme getXPageTheme(int nIdForm)
          Gets the x page theme.
 boolean hasFormErrors(javax.servlet.http.HttpSession session)
          Check if the session has a list of responses without form errors and the validate requirement is indeed checked
 boolean hasRecap(Form form)
          Check if the given form has a recap or not
 void init()
          Initialize the Form service
 boolean isSessionValid(Form form, javax.servlet.http.HttpServletRequest request)
          Check if the user is authorized to view the form.
 void updateAnonymizeEntryList(int nIdForm, List<Integer> listEntryIds)
          Update the list of entries of a form to anonymize
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Method Detail

init

public void init()
Initialize the Form service


getInstance

public static FormService getInstance()
Returns the instance of the singleton

Returns:
The instance of the singleton

getManageAdvancedParameters

public Map<String,Object> getManageAdvancedParameters(fr.paris.lutece.portal.business.user.AdminUser user)
Build the advanced parameters management

Parameters:
user - the current user
Returns:
The model for the advanced parameters

isSessionValid

public boolean isSessionValid(Form form,
                              javax.servlet.http.HttpServletRequest request)
Check if the user is authorized to view the form.
This method checks every mandatory EntryTypeSession, and check if there is a value for the attribute of the session.

Parameters:
form - the form
request - the HTTP request
Returns:
true if he is authorized, false otherwise

hasRecap

public boolean hasRecap(Form form)
Check if the given form has a recap or not

Parameters:
form - the form
Returns:
true if the form has a recap, false otherwise

hasFormErrors

public boolean hasFormErrors(javax.servlet.http.HttpSession session)
Check if the session has a list of responses without form errors and the validate requirement is indeed checked

Parameters:
session - the HTTP session
Returns:
true if the session has errors, false otherwise

getMaxNumber

public int getMaxNumber(IEntry entry)
Get the max number

Parameters:
entry - the id of the entry type numbering
Returns:
the max number

getXPageTheme

public fr.paris.lutece.portal.business.style.Theme getXPageTheme(int nIdForm)
Gets the x page theme.

Parameters:
nIdForm - the n id form
Returns:
the x page theme

getAnonymizeEntryList

public List<Integer> getAnonymizeEntryList(int nIdForm)
Get the list of entries of a form to anonymize

Parameters:
nIdForm - The id of the form
Returns:
The list of ids of entries to anonymize, or an empty list if the form was not fount or if no entries of this form should be anonymized

updateAnonymizeEntryList

public void updateAnonymizeEntryList(int nIdForm,
                                     List<Integer> listEntryIds)
Update the list of entries of a form to anonymize

Parameters:
nIdForm - The id of the form
listEntryIds - An array containing ids of entries of the form to anonymize

cleanFormResponses

public void cleanFormResponses(Form form)
Clean answers of a given form

Parameters:
form - The form the clean the answers of


Copyright © 2013 Mairie de Paris. All Rights Reserved.