fr.paris.lutece.plugins.form.business
Class FormSubmitDAO

java.lang.Object
  extended by fr.paris.lutece.plugins.form.business.FormSubmitDAO
All Implemented Interfaces:
IFormSubmitDAO

public final class FormSubmitDAO
extends Object
implements IFormSubmitDAO

This class provides Data Access methods for FormResponse objects


Constructor Summary
FormSubmitDAO()
           
 
Method Summary
 void anonymizeEntries(List<Integer> listIdEntries, Timestamp dateCleanTo, fr.paris.lutece.portal.service.plugin.Plugin plugin)
          Anonymize entries of responses
 void associateResponseWithFormSubmit(int nIdResponse, int nIdFormSubmit, fr.paris.lutece.portal.service.plugin.Plugin plugin)
          Associate a response with a form submit
 void delete(int nIdFormSubmit, fr.paris.lutece.portal.service.plugin.Plugin plugin)
          Delete all response associate to the form submit whose identifier is specified in parameter
 void deleteResponses(int nIdFormSubmit, fr.paris.lutece.portal.service.plugin.Plugin plugin)
          Delete responses and files associated with a form submit
 FormSubmit findFormSubmitFromResponseId(int nIdResponse, fr.paris.lutece.portal.service.plugin.Plugin plugin)
          Find a form submit from the id of a response associated with it
 List<Integer> getResponseListFromIdFormSubmit(int nIdFormSubmit, fr.paris.lutece.portal.service.plugin.Plugin plugin)
          Get the list of id of responses associated with a form submit
 int insert(FormSubmit formSubmit, fr.paris.lutece.portal.service.plugin.Plugin plugin)
          Insert a new record in the table.
 FormSubmit load(int nIdFormSubmit, fr.paris.lutece.portal.service.plugin.Plugin plugin)
          Load the data of the formResponse from the table
 void removeResponseFormSubmitAssociation(int nIdResponse, fr.paris.lutece.portal.service.plugin.Plugin plugin)
          Remove the association between a response and a form submit
 int selectCountByFilter(fr.paris.lutece.plugins.genericattributes.business.ResponseFilter filter, fr.paris.lutece.portal.service.plugin.Plugin plugin)
          Load the data of all the formSubmit who verify the filter and returns them in a list
 List<FormSubmit> selectListByFilter(fr.paris.lutece.plugins.genericattributes.business.ResponseFilter filter, fr.paris.lutece.portal.service.plugin.Plugin plugin)
          Load the data of all the formSubmit who verify the filter and returns them in a list
 List<StatisticFormSubmit> selectStatisticFormSubmit(fr.paris.lutece.plugins.genericattributes.business.ResponseFilter filter, fr.paris.lutece.portal.service.plugin.Plugin plugin)
          Load the number of formSubmit group by day who verify the filter and returns them in a list of statistic
 void store(FormSubmit formSubmit, fr.paris.lutece.portal.service.plugin.Plugin plugin)
          Update the the formSubmit in the table
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

FormSubmitDAO

public FormSubmitDAO()
Method Detail

insert

public int insert(FormSubmit formSubmit,
                  fr.paris.lutece.portal.service.plugin.Plugin plugin)
Insert a new record in the table.

Specified by:
insert in interface IFormSubmitDAO
Parameters:
formSubmit - instance of the formResponse object to insert
plugin - the plugin
Returns:
the id of the new form Submit

load

public FormSubmit load(int nIdFormSubmit,
                       fr.paris.lutece.portal.service.plugin.Plugin plugin)
Load the data of the formResponse from the table

Specified by:
load in interface IFormSubmitDAO
Parameters:
nIdFormSubmit - The identifier of the formResponse
plugin - the plugin
Returns:
the instance of the formSubmit

delete

public void delete(int nIdFormSubmit,
                   fr.paris.lutece.portal.service.plugin.Plugin plugin)
Delete all response associate to the form submit whose identifier is specified in parameter

Specified by:
delete in interface IFormSubmitDAO
Parameters:
nIdFormSubmit - The identifier of the formResponse
plugin - the plugin

store

public void store(FormSubmit formSubmit,
                  fr.paris.lutece.portal.service.plugin.Plugin plugin)
Update the the formSubmit in the table

Specified by:
store in interface IFormSubmitDAO
Parameters:
formSubmit - instance of the formSubmit object to update
plugin - the plugin

selectListByFilter

public List<FormSubmit> selectListByFilter(fr.paris.lutece.plugins.genericattributes.business.ResponseFilter filter,
                                           fr.paris.lutece.portal.service.plugin.Plugin plugin)
Load the data of all the formSubmit who verify the filter and returns them in a list

Specified by:
selectListByFilter in interface IFormSubmitDAO
Parameters:
filter - the filter
plugin - the plugin
Returns:
the list of formResponse

selectCountByFilter

public int selectCountByFilter(fr.paris.lutece.plugins.genericattributes.business.ResponseFilter filter,
                               fr.paris.lutece.portal.service.plugin.Plugin plugin)
Load the data of all the formSubmit who verify the filter and returns them in a list

Specified by:
selectCountByFilter in interface IFormSubmitDAO
Parameters:
filter - the filter
plugin - the plugin
Returns:
the list of formResponse

selectStatisticFormSubmit

public List<StatisticFormSubmit> selectStatisticFormSubmit(fr.paris.lutece.plugins.genericattributes.business.ResponseFilter filter,
                                                           fr.paris.lutece.portal.service.plugin.Plugin plugin)
Load the number of formSubmit group by day who verify the filter and returns them in a list of statistic

Specified by:
selectStatisticFormSubmit in interface IFormSubmitDAO
Parameters:
filter - the filter
plugin - the plugin
Returns:
the list of statistic

anonymizeEntries

public void anonymizeEntries(List<Integer> listIdEntries,
                             Timestamp dateCleanTo,
                             fr.paris.lutece.portal.service.plugin.Plugin plugin)
Anonymize entries of responses

Specified by:
anonymizeEntries in interface IFormSubmitDAO
Parameters:
listIdEntries - The list of id of entries to anonymize responses of
dateCleanTo - Anonymize responses posted before this date
plugin - The plugin

deleteResponses

public void deleteResponses(int nIdFormSubmit,
                            fr.paris.lutece.portal.service.plugin.Plugin plugin)
Delete responses and files associated with a form submit

Specified by:
deleteResponses in interface IFormSubmitDAO
Parameters:
nIdFormSubmit - The if of the form submit to remove
plugin - The plugin

findFormSubmitFromResponseId

public FormSubmit findFormSubmitFromResponseId(int nIdResponse,
                                               fr.paris.lutece.portal.service.plugin.Plugin plugin)
Find a form submit from the id of a response associated with it

Specified by:
findFormSubmitFromResponseId in interface IFormSubmitDAO
Parameters:
nIdResponse - The id of the response
plugin - The plugin
Returns:
The form submit, or null if no form submit is associated with the given response

getResponseListFromIdFormSubmit

public List<Integer> getResponseListFromIdFormSubmit(int nIdFormSubmit,
                                                     fr.paris.lutece.portal.service.plugin.Plugin plugin)
Get the list of id of responses associated with a form submit

Specified by:
getResponseListFromIdFormSubmit in interface IFormSubmitDAO
Parameters:
nIdFormSubmit - The id of the form submit
plugin - The plugin
Returns:
The list of response id, or an empty list if no response is associated with the form submit

associateResponseWithFormSubmit

public void associateResponseWithFormSubmit(int nIdResponse,
                                            int nIdFormSubmit,
                                            fr.paris.lutece.portal.service.plugin.Plugin plugin)
Associate a response with a form submit

Specified by:
associateResponseWithFormSubmit in interface IFormSubmitDAO
Parameters:
nIdResponse - The id of the response
nIdFormSubmit - The id of the form submit
plugin - The plugin

removeResponseFormSubmitAssociation

public void removeResponseFormSubmitAssociation(int nIdResponse,
                                                fr.paris.lutece.portal.service.plugin.Plugin plugin)
Remove the association between a response and a form submit

Specified by:
removeResponseFormSubmitAssociation in interface IFormSubmitDAO
Parameters:
nIdResponse - The id of the response
plugin - The plugin


Copyright © 2014 Mairie de Paris. All Rights Reserved.