public class FormsResponseUtils extends Object
| Modifier and Type | Method and Description |
|---|---|
static String |
buildFileUrl(int nIdFormQuestionResponse,
int nIdFile)
Build FormsResponse file url.
|
static FormResponseData |
buildFormResponseData(FormResponse formResponse,
Optional<Form> form)
Build FormResponseData
|
static String |
buildFormsResponseFOUrl(int nIdFormResponse)
Build FormsResponse FO url.
|
static List<String> |
buildStepsHtml(javax.servlet.http.HttpServletRequest request,
List<Step> listStep,
FormResponseManager formResponseManager,
boolean frontOffice)
Builds the HTML for the specified list of steps
|
static boolean |
checkIfUserResponseForm(Form form,
String strGuid)
check if user can answer the form again
|
static boolean |
checkNumberMaxResponseForm(Form form)
check if form is reached the number max of response
|
static void |
fillResponseManagerWithResponses(javax.servlet.http.HttpServletRequest request,
boolean bValidateQuestionStep,
FormResponseManager formResponseManager,
List<Question> listQuestionStep,
boolean displayInBO) |
static List<FormResponse> |
filterFormResponseForLuteceUser(List<FormResponse> formResponseList,
fr.paris.lutece.portal.service.security.LuteceUser user)
Filter formResponse by access rights for LuteceUser
|
static List<FormResponseData> |
filterFormResponseListForLuteceUser(List<FormResponse> formResponseList,
fr.paris.lutece.portal.service.security.LuteceUser user)
Filter and build formResponseData by access rights for LuteceUser
|
static List<FormResponse> |
getFormResponseListByRoleAndGuid(fr.paris.lutece.portal.service.security.LuteceUser user)
Get FormResponse list By Role And Guid
|
static Locale |
getLocaleFO(javax.servlet.http.HttpServletRequest request) |
static Object |
getLockOnForm(Form form) |
static Step |
getNextStep(int nIdCurrentStep,
List<String> errorMessageList,
FormResponseManager formResponseManager)
Build next Step object
|
static String |
getRootUrl()
Return the url of the Root of the webapp
|
static void |
increaseNumberResponse(Form form)
Increase the number of response of the Form
|
static boolean |
isAuthorized(FormResponse formResponse,
fr.paris.lutece.portal.service.security.LuteceUser user)
Check that a given user is allowed to access for manage the formResponse
|
static boolean |
isAuthorized(FormResponse formResponse,
fr.paris.lutece.portal.service.security.LuteceUser user,
Form form)
Check that a given user is allowed to access for manage the formResponse
|
static void |
populateFormWithLogoAndNumberResponse(Form form)
Populate form with Physical File logo and number of response
|
public static boolean isAuthorized(FormResponse formResponse, fr.paris.lutece.portal.service.security.LuteceUser user)
formResponse - the formsResponseuser - the user trying to access the resourcepublic static boolean isAuthorized(FormResponse formResponse, fr.paris.lutece.portal.service.security.LuteceUser user, Form form)
formResponse - the formsResponseuser - the user trying to access the resourceform - the formpublic static List<FormResponse> filterFormResponseForLuteceUser(List<FormResponse> formResponseList, fr.paris.lutece.portal.service.security.LuteceUser user)
formResponseList - the list of fromResponse objectsuser - the luteceUserpublic static List<FormResponseData> filterFormResponseListForLuteceUser(List<FormResponse> formResponseList, fr.paris.lutece.portal.service.security.LuteceUser user)
formResponseList - the list of fromResponse objectsuser - the luteceUserpublic static List<FormResponse> getFormResponseListByRoleAndGuid(fr.paris.lutece.portal.service.security.LuteceUser user)
user - the LuteceUserpublic static FormResponseData buildFormResponseData(FormResponse formResponse, Optional<Form> form)
formResponse - the from responseform - the formpublic static Step getNextStep(int nIdCurrentStep, List<String> errorMessageList, FormResponseManager formResponseManager)
nIdCurrentStep - the id current steperrorMessageList - the error message listformResponseManager - the formResponseManagerpublic static void populateFormWithLogoAndNumberResponse(Form form)
form - the form objectpublic static void fillResponseManagerWithResponses(javax.servlet.http.HttpServletRequest request,
boolean bValidateQuestionStep,
FormResponseManager formResponseManager,
List<Question> listQuestionStep,
boolean displayInBO)
throws QuestionValidationException
request - The Http requestbValidateQuestionStep - valid question ton next stepQuestionValidationException - if there is at least one question not validpublic static void increaseNumberResponse(Form form)
form - public static boolean checkNumberMaxResponseForm(Form form)
form - the formrequest - the requestfr.paris.lutece.portal.service.message.SiteMessageException - the exceptionpublic static boolean checkIfUserResponseForm(Form form, String strGuid)
form - the formrequest - the requestfr.paris.lutece.portal.service.message.SiteMessageExceptionpublic static List<String> buildStepsHtml(javax.servlet.http.HttpServletRequest request, List<Step> listStep, FormResponseManager formResponseManager, boolean frontOffice)
request - The requestlistStep - The list of stepspublic static Locale getLocaleFO(javax.servlet.http.HttpServletRequest request)
public static String buildFileUrl(int nIdFormQuestionResponse, int nIdFile)
nIdFormQuestionResponse - the forms question responsenIdFile - the file idpublic static String buildFormsResponseFOUrl(int nIdFormResponse)
nIdFormQuestionResponse - the forms question responsenIdFile - the file idpublic static String getRootUrl()
Copyright © 2023 City of Paris. All rights reserved.