Commit 2e4cad0b authored by Guillaume Lépine's avatar Guillaume Lépine
Browse files

mvn license & format

parent 54777bc2
......@@ -111,7 +111,7 @@ public final class ControlDAO implements IControlDAO
int nIndex = 1;
daoUtil.setInt( nIndex++, nIdControl );
daoUtil.setInt( nIndex, nIdQuestion );
daoUtil.executeUpdate( );
}
......@@ -129,7 +129,7 @@ public final class ControlDAO implements IControlDAO
daoUtil.setInt( nIndex++, nIdControl );
daoUtil.setInt( nIndex++, nIdQuestion );
daoUtil.setString( nIndex, strValue );
daoUtil.executeUpdate( );
}
......@@ -146,7 +146,7 @@ public final class ControlDAO implements IControlDAO
{
daoUtil.setInt( 1, nKey );
daoUtil.executeQuery( );
if ( daoUtil.next( ) )
{
control = dataToObject( daoUtil );
......@@ -166,7 +166,7 @@ public final class ControlDAO implements IControlDAO
{
daoUtil.setInt( 1, nIdControl );
daoUtil.executeQuery( );
while ( daoUtil.next( ) )
{
listQuestion.add( daoUtil.getInt( PARAMETER_QUESTION_ID ) );
......@@ -237,16 +237,16 @@ public final class ControlDAO implements IControlDAO
try ( DAOUtil daoUtil = new DAOUtil( SQL_QUERY_UPDATE, plugin ) )
{
int nIndex = 1;
daoUtil.setInt( nIndex++, control.getId( ) );
daoUtil.setString( nIndex++, control.getValue( ) );
daoUtil.setString( nIndex++, control.getErrorMessage( ) );
daoUtil.setString( nIndex++, control.getValidatorName( ) );
daoUtil.setString( nIndex++, control.getControlType( ) );
daoUtil.setInt( nIndex++, control.getIdControlTarget( ) );
daoUtil.setInt( nIndex, control.getId( ) );
daoUtil.executeUpdate( );
}
}
......@@ -261,7 +261,7 @@ public final class ControlDAO implements IControlDAO
try ( DAOUtil daoUtil = new DAOUtil( SQL_QUERY_SELECTALL, plugin ) )
{
daoUtil.executeQuery( );
while ( daoUtil.next( ) )
{
controlList.add( dataToObject( daoUtil ) );
......@@ -280,7 +280,7 @@ public final class ControlDAO implements IControlDAO
try ( DAOUtil daoUtil = new DAOUtil( SQL_QUERY_SELECTALL_ID, plugin ) )
{
daoUtil.executeQuery( );
while ( daoUtil.next( ) )
{
controlList.add( daoUtil.getInt( PARAMETER_CONTROL_ID ) );
......@@ -299,7 +299,7 @@ public final class ControlDAO implements IControlDAO
try ( DAOUtil daoUtil = new DAOUtil( SQL_QUERY_SELECTALL, plugin ) )
{
daoUtil.executeQuery( );
while ( daoUtil.next( ) )
{
controlList.addItem( daoUtil.getInt( PARAMETER_CONTROL_ID ), daoUtil.getString( PARAMETER_VALUE ) );
......@@ -317,7 +317,7 @@ public final class ControlDAO implements IControlDAO
daoUtil.setInt( 1, nIdControlTarget );
daoUtil.setString( 2, controlType.getLabel( ) );
daoUtil.executeQuery( );
while ( daoUtil.next( ) )
{
listControl.add( dataToObject( daoUtil ) );
......@@ -335,7 +335,7 @@ public final class ControlDAO implements IControlDAO
daoUtil.setInt( 1, nIdQuestion );
daoUtil.setString( 2, strControlType );
daoUtil.executeQuery( );
while ( daoUtil.next( ) )
{
listControl.add( dataToObject( daoUtil ) );
......@@ -376,7 +376,7 @@ public final class ControlDAO implements IControlDAO
{
daoUtil.setInt( 1, nIdQuestion );
daoUtil.executeQuery( );
while ( daoUtil.next( ) )
{
controlList.add( dataToObject( daoUtil ) );
......@@ -396,7 +396,7 @@ public final class ControlDAO implements IControlDAO
{
daoUtil.setInt( 1, nIdControl );
daoUtil.executeQuery( );
while ( daoUtil.next( ) )
{
controlList.addItem( daoUtil.getInt( PARAMETER_QUESTION_ID ), daoUtil.getString( PARAMETER_VALUE ) );
......
......@@ -71,7 +71,8 @@ public final class FormQuestionResponseDAO implements IFormQuestionResponseDAO
private static final FormQuestionEntryResponseDAO _formQuestionEntryResponseDAO = new FormQuestionEntryResponseDAO( );
private static final String PARAMETER_QUESTION_RESPONSE_ID = "id_question_response";
private static final String PARAMETER_QUESTION_RESPONSE_ID = "id_question_response";
/**
* {@inheritDoc }
*/
......@@ -85,9 +86,9 @@ public final class FormQuestionResponseDAO implements IFormQuestionResponseDAO
daoUtil.setInt( ++nIndex, formQuestionResponse.getQuestion( ).getId( ) );
daoUtil.setInt( ++nIndex, formQuestionResponse.getIdStep( ) );
daoUtil.setInt( ++nIndex, formQuestionResponse.getQuestion( ).getIterationNumber( ) );
daoUtil.executeUpdate( );
if ( daoUtil.nextGeneratedKey( ) )
{
formQuestionResponse.setId( daoUtil.getGeneratedKeyInt( 1 ) );
......@@ -115,7 +116,7 @@ public final class FormQuestionResponseDAO implements IFormQuestionResponseDAO
{
daoUtil.setInt( 1, nKey );
daoUtil.executeQuery( );
if ( daoUtil.next( ) )
{
formQuestionResponse = dataToObject( daoUtil );
......@@ -159,7 +160,7 @@ public final class FormQuestionResponseDAO implements IFormQuestionResponseDAO
{
daoUtil.setInt( 1, nIdQuestion );
daoUtil.executeQuery( );
while ( daoUtil.next( ) )
{
formQuestionResponseList.add( dataToObject( daoUtil ) );
......@@ -198,9 +199,9 @@ public final class FormQuestionResponseDAO implements IFormQuestionResponseDAO
daoUtil.setInt( ++nIndex, formQuestionResponse.getQuestion( ).getId( ) );
daoUtil.setInt( ++nIndex, formQuestionResponse.getIdStep( ) );
daoUtil.setInt( ++nIndex, formQuestionResponse.getQuestion( ).getIterationNumber( ) );
daoUtil.setInt( ++nIndex, formQuestionResponse.getId( ) );
daoUtil.executeUpdate( );
}
storeResponses( formQuestionResponseSaved, formQuestionResponse, plugin );
......@@ -269,7 +270,7 @@ public final class FormQuestionResponseDAO implements IFormQuestionResponseDAO
daoUtil.setInt( 1, nIdFormResponse );
daoUtil.setInt( 2, nIdStep );
daoUtil.executeQuery( );
while ( daoUtil.next( ) )
{
formQuestionResponseList.add( dataToObject( daoUtil ) );
......@@ -321,7 +322,7 @@ public final class FormQuestionResponseDAO implements IFormQuestionResponseDAO
{
daoUtil.setInt( 1, nIdFormResponse );
daoUtil.executeQuery( );
while ( daoUtil.next( ) )
{
formQuestionResponseList.add( dataToObject( daoUtil ) );
......@@ -636,7 +637,7 @@ public final class FormQuestionResponseDAO implements IFormQuestionResponseDAO
int nIndex = 0;
daoUtil.setInt( ++nIndex, formQuestionEntryResponse._nIdQuestionResponse );
daoUtil.setInt( ++nIndex, formQuestionEntryResponse._response.getIdResponse( ) );
daoUtil.executeUpdate( );
}
}
......
......@@ -81,9 +81,9 @@ public final class PdfUtil
String group = cell.getGroup( );
int nbLines = 1;
double coldWidthTitle = tableWidth / 5;
double coldWidthTitle = tableWidth / 5;
double currentColWidth = tableWidth - coldWidthTitle;
if ( group != null )
{
String [ ] wrappedGroup = getWrappedText( font, fontSize, coldWidthTitle, group );
......
......@@ -127,8 +127,7 @@ public abstract class GenericFormsProvider implements IProvider
Field fieldFile = entry.getFieldByCode( IEntryTypeService.FIELD_DOWNLOADABLE_FILE );
if ( fieldFile != null )
{
IFileStoreServiceProvider fileStoreprovider = FileService.getInstance( )
.getFileStoreServiceProvider( "formsDatabaseFileStoreProvider" );
IFileStoreServiceProvider fileStoreprovider = FileService.getInstance( ).getFileStoreServiceProvider( "formsDatabaseFileStoreProvider" );
Map<String, String> additionnalData = new HashMap<>( );
additionnalData.put( FileService.PARAMETER_RESOURCE_ID, String.valueOf( entry.getIdResource( ) ) );
......@@ -143,8 +142,7 @@ public abstract class GenericFormsProvider implements IProvider
{
value = formQuestionResponse.getEntryResponse( ).stream( ).map(
response -> entryTypeService.getResponseValueForRecap( formQuestionResponse.getQuestion( ).getEntry( ), _request, response, null ) )
.filter( StringUtils::isNotEmpty )
.collect( Collectors.joining( ", " ) );
.filter( StringUtils::isNotEmpty ).collect( Collectors.joining( ", " ) );
}
if ( notifyMarker.getValue( ) == null )
{
......
......@@ -104,7 +104,7 @@ public class LuceneFormSearchEngine implements IFormSearchEngine
qpGuid.setDefaultOperator( QueryParser.Operator.AND );
String searchedText = normalizeSearchText( formSearchConfig.getSearchedText( ) );
Query queryContent = qpContent.parse( searchedText );
Query queryDateCreation = qpDateCreation.parse( searchedText );
Query queryDateUpdate = qpDateUpdate.parse( searchedText );
......@@ -155,7 +155,7 @@ public class LuceneFormSearchEngine implements IFormSearchEngine
}
return Normalizer.normalize( text, Normalizer.Form.NFD ).replaceAll( "\\p{M}", "" );
}
/**
* {@inheritDoc }
*/
......
......@@ -305,7 +305,7 @@ public class FormXPage extends MVCApplication
SiteMessageService.setMessage( request, MESSAGE_ERROR_NO_STEP, SiteMessage.TYPE_ERROR );
return null;
}
Form form = FormHome.findByPrimaryKey( _currentStep.getIdForm( ) );
checkAuthentication( form, request );
......
......@@ -160,8 +160,7 @@ public abstract class AbstractFormQuestionJspBean extends AbstractJspBean
// Others
protected static final int INTEGER_MINUS_ONE = -1;
protected IFileStoreServiceProvider _fileStoreProvider = FileService.getInstance( )
.getFileStoreServiceProvider( "formsDatabaseFileStoreProvider" );
protected IFileStoreServiceProvider _fileStoreProvider = FileService.getInstance( ).getFileStoreServiceProvider( "formsDatabaseFileStoreProvider" );
private IFormDatabaseService _formDatabaseService;
private IFormDisplayService _formDisplayService;
......
......@@ -457,7 +457,7 @@ public class FormQuestionJspBean extends AbstractFormQuestionJspBean
{
int nIdStep = NumberUtils.toInt( request.getParameter( FormsConstants.PARAMETER_ID_STEP ), INTEGER_MINUS_ONE );
int nIdDisplay = NumberUtils.toInt( request.getParameter( FormsConstants.PARAMETER_ID_DISPLAY ), INTEGER_MINUS_ONE );
if ( nIdStep == INTEGER_MINUS_ONE || nIdDisplay == INTEGER_MINUS_ONE )
{
redirectToViewManageForm( request );
......@@ -493,8 +493,8 @@ public class FormQuestionJspBean extends AbstractFormQuestionJspBean
return redirect( request, strMessageUrl );
}
private String getConfirmMessageRemoveQuestion( Form form , FormDisplay formDisplay)
private String getConfirmMessageRemoveQuestion( Form form, FormDisplay formDisplay )
{
String strMessage = StringUtils.EMPTY;
if ( CompositeDisplayType.QUESTION.getLabel( ).equalsIgnoreCase( formDisplay.getCompositeType( ) ) )
......@@ -519,7 +519,7 @@ public class FormQuestionJspBean extends AbstractFormQuestionJspBean
{
strMessage = WARNING_CONFIRM_REMOVE_GROUP_ANY_QUESTIONS;
}
}
return strMessage;
}
......
......@@ -63,8 +63,7 @@ public class EntryTypeCommentDisplayService extends EntryTypeDefaultDisplayServi
Field fieldFile = entry.getFieldByCode( IEntryTypeService.FIELD_DOWNLOADABLE_FILE );
if ( fieldFile != null )
{
IFileStoreServiceProvider fileStoreprovider = FileService.getInstance( )
.getFileStoreServiceProvider( "formsDatabaseFileStoreProvider" );
IFileStoreServiceProvider fileStoreprovider = FileService.getInstance( ).getFileStoreServiceProvider( "formsDatabaseFileStoreProvider" );
Map<String, String> additionnalData = new HashMap<>( );
additionnalData.put( FileService.PARAMETER_RESOURCE_ID, String.valueOf( entry.getIdResource( ) ) );
......
......@@ -84,7 +84,7 @@ public interface IEntryDisplayService
* @return the column corresponding the the current entryDisplayService
*/
IFormColumn getFormColumn( int nFormColumnPosition, String strColumnTitle );
/**
* Return from the given map the list of Response of the model
*
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment