Résultats CPD
Le document suivant contient les résultats de l'inspection CPD CPD 5.3.5.
Duplicatas
Fichier |
Ligne |
fr/paris/lutece/plugins/form/business/FormDAO.java |
216 |
fr/paris/lutece/plugins/form/business/FormDAO.java |
456 |
form = new Form( );
form.setIdForm( daoUtil.getInt( nIndex++ ) );
form.setTitle( daoUtil.getString( nIndex++ ) );
form.setFrontOfficeTitle( daoUtil.getString( nIndex++ ) );
form.setIsShownFrontOfficeTitle( daoUtil.getBoolean( nIndex++ ) );
form.setDescription( daoUtil.getString( nIndex++ ) );
form.setWelcomeMessage( daoUtil.getString( nIndex++ ) );
form.setUnavailabilityMessage( daoUtil.getString( nIndex++ ) );
form.setRequirement( daoUtil.getString( nIndex++ ) );
form.setWorkgroup( daoUtil.getString( nIndex++ ) );
form.setIdMailingList( daoUtil.getInt( nIndex++ ) );
form.setActiveCaptcha( daoUtil.getBoolean( nIndex++ ) );
form.setActiveStoreAdresse( daoUtil.getBoolean( nIndex++ ) );
form.setLibelleValidateButton( daoUtil.getString( nIndex++ ) );
form.setLibelleResetButton( daoUtil.getString( nIndex++ ) );
form.setDateBeginDisponibility( daoUtil.getDate( nIndex++ ) );
form.setDateEndDisponibility( daoUtil.getDate( nIndex++ ) );
form.setActive( daoUtil.getBoolean( nIndex++ ) );
form.setAutoPublicationActive( daoUtil.getBoolean( nIndex++ ) );
form.setDateCreation( daoUtil.getTimestamp( nIndex++ ) );
form.setLimitNumberResponse( daoUtil.getBoolean( nIndex++ ) );
recap = new Recap( );
recap.setIdRecap( daoUtil.getInt( nIndex++ ) );
form.setRecap( recap );
form.setActiveRequirement( daoUtil.getBoolean( nIndex++ ) );
form.setInfoComplementary1( daoUtil.getString( nIndex++ ) );
form.setInfoComplementary2( daoUtil.getString( nIndex++ ) );
form.setInfoComplementary3( daoUtil.getString( nIndex++ ) );
form.setInfoComplementary4( daoUtil.getString( nIndex++ ) );
form.setInfoComplementary5( daoUtil.getString( nIndex++ ) );
form.setSupportHTTPS( daoUtil.getBoolean( nIndex++ ) );
form.setCodeTheme( daoUtil.getString( nIndex++ ) );
form.setActiveMyLuteceAuthentification( daoUtil.getBoolean( nIndex++ ) );
int i = nIndex++;
if ( daoUtil.getObject( i ) != null )
{
form.setCategory( CategoryHome.findByPrimaryKey( daoUtil.getInt( i ), plugin ) );
}
form.setAutomaticCleaning( daoUtil.getBoolean( nIndex++ ) );
form.setCleaningByRemoval( daoUtil.getBoolean( nIndex++ ) );
form.setNbDaysBeforeCleaning( daoUtil.getInt( nIndex++ ) );
form.setMaxNumberResponse( daoUtil.getInt( nIndex++ ) );
form.setIsShownFrontOfficePicture( daoUtil.getBoolean( nIndex++ ) );
form.setIdPictureFile( daoUtil.getInt( nIndex++ ) ); |
Fichier |
Ligne |
fr/paris/lutece/plugins/form/business/FormDAO.java |
144 |
fr/paris/lutece/plugins/form/business/FormDAO.java |
288 |
DAOUtil daoUtil = new DAOUtil( SQL_QUERY_INSERT, plugin );
int nIndex = 1;
daoUtil.setInt( nIndex++, form.getIdForm( ) );
daoUtil.setString( nIndex++, form.getTitle( ) );
daoUtil.setString( nIndex++, form.getFrontOfficeTitle( ) );
daoUtil.setBoolean( nIndex++, form.isShownFrontOfficeTitle( ) );
daoUtil.setString( nIndex++, form.getDescription( ) );
daoUtil.setString( nIndex++, form.getWelcomeMessage( ) );
daoUtil.setString( nIndex++, form.getUnavailabilityMessage( ) );
daoUtil.setString( nIndex++, form.getRequirement( ) );
daoUtil.setString( nIndex++, form.getWorkgroup( ) );
daoUtil.setInt( nIndex++, form.getIdMailingList( ) );
daoUtil.setBoolean( nIndex++, form.isActiveCaptcha( ) );
daoUtil.setBoolean( nIndex++, form.isActiveStoreAdresse( ) );
daoUtil.setString( nIndex++, form.getLibelleValidateButton( ) );
daoUtil.setString( nIndex++, form.getLibelleResetButton( ) );
daoUtil.setDate( nIndex++, ( form.getDateBeginDisponibility( ) != null ) ? new Date( form.getDateBeginDisponibility( ).getTime( ) ) : null );
daoUtil.setDate( nIndex++, ( form.getDateEndDisponibility( ) != null ) ? new Date( form.getDateEndDisponibility( ).getTime( ) ) : null );
daoUtil.setBoolean( nIndex++, form.isActive( ) );
daoUtil.setBoolean( nIndex++, form.isAutoPublicationActive( ) );
daoUtil.setTimestamp( nIndex++, form.getDateCreation( ) ); |
Fichier |
Ligne |
fr/paris/lutece/plugins/form/business/FormDAO.java |
167 |
fr/paris/lutece/plugins/form/business/FormDAO.java |
308 |
daoUtil.setInt( nIndex++, form.getRecap( ).getIdRecap( ) );
daoUtil.setBoolean( nIndex++, form.isActiveRequirement( ) );
daoUtil.setString( nIndex++, form.getInfoComplementary1( ) );
daoUtil.setString( nIndex++, form.getInfoComplementary2( ) );
daoUtil.setString( nIndex++, form.getInfoComplementary3( ) );
daoUtil.setString( nIndex++, form.getInfoComplementary4( ) );
daoUtil.setString( nIndex++, form.getInfoComplementary5( ) );
daoUtil.setBoolean( nIndex++, form.isSupportHTTPS( ) );
daoUtil.setString( nIndex++, form.getCodeTheme( ) );
daoUtil.setBoolean( nIndex++, form.isActiveMyLuteceAuthentification( ) );
if ( form.getCategory( ) != null )
{
daoUtil.setInt( nIndex++, form.getCategory( ).getIdCategory( ) );
}
else
{
daoUtil.setIntNull( nIndex++ );
}
daoUtil.setBoolean( nIndex++, form.getAutomaticCleaning( ) );
daoUtil.setBoolean( nIndex++, form.getCleaningByRemoval( ) );
daoUtil.setInt( nIndex++, form.getNbDaysBeforeCleaning( ) );
daoUtil.setInt( nIndex++, form.getMaxNumberResponse( ) );
daoUtil.setBoolean( nIndex++, form.isShownFrontOfficePicture( ) );
daoUtil.setInt( nIndex++, form.getIdPictureFile( ) );
daoUtil.executeUpdate( ); |
Fichier |
Ligne |
fr/paris/lutece/plugins/form/business/parameter/EntryParameterDAO.java |
60 |
fr/paris/lutece/plugins/form/business/parameter/FormParameterDAO.java |
71 |
DAOUtil daoUtil = new DAOUtil( SQL_QUERY_SELECT_ALL, plugin );
daoUtil.executeQuery( );
while ( daoUtil.next( ) )
{
ReferenceItem param = new ReferenceItem( );
param.setCode( daoUtil.getString( 1 ) );
param.setName( daoUtil.getString( 2 ) );
if ( param.getName( ) != null )
{
param.setChecked( param.getName( ).equals( TRUE ) ? true : false );
}
listParams.add( param );
}
daoUtil.free( );
return listParams;
}
/**
* {@inheritDoc}
*/
@Override
public ReferenceItem load( String strParameterKey, Plugin plugin )
{
ReferenceItem param = null;
DAOUtil daoUtil = new DAOUtil( SQL_QUERY_SELECT, plugin );
daoUtil.setString( 1, strParameterKey );
daoUtil.executeQuery( );
if ( daoUtil.next( ) )
{
param = new ReferenceItem( );
param.setCode( strParameterKey );
param.setName( daoUtil.getString( 1 ) );
}
daoUtil.free( );
return param;
}
/**
* {@inheritDoc}
*/
@Override
public void store( ReferenceItem param, Plugin plugin )
{
DAOUtil daoUtil = new DAOUtil( SQL_QUERY_UPDATE, plugin );
daoUtil.setString( 1, param.getName( ) );
daoUtil.setString( 2, param.getCode( ) );
daoUtil.executeUpdate( );
daoUtil.free( );
} |
Fichier |
Ligne |
fr/paris/lutece/plugins/form/business/RecapDAO.java |
88 |
fr/paris/lutece/plugins/form/business/RecapDAO.java |
173 |
DAOUtil daoUtil = new DAOUtil( SQL_QUERY_INSERT, plugin );
daoUtil.setInt( 1, recap.getIdRecap( ) );
daoUtil.setString( 2, recap.getBackUrl( ) );
if ( recap.getGraphType( ) == null )
{
daoUtil.setIntNull( 3 );
}
else
{
daoUtil.setInt( 3, recap.getGraphType( ).getIdGraphType( ) );
}
daoUtil.setString( 4, recap.getRecapMessage( ) );
daoUtil.setBoolean( 5, recap.isRecapData( ) );
daoUtil.setBoolean( 6, recap.isGraph( ) );
daoUtil.setBoolean( 7, recap.isGraphThreeDimension( ) );
daoUtil.setBoolean( 8, recap.isGraphLegende( ) );
daoUtil.setString( 9, recap.getGraphValueLegende( ) );
daoUtil.setBoolean( 10, recap.isGraphLabelValue( ) );
daoUtil.executeUpdate( ); |
Fichier |
Ligne |
fr/paris/lutece/plugins/form/web/FormJspBean.java |
1210 |
fr/paris/lutece/plugins/form/web/FormJspBean.java |
1435 |
String strIdForm = request.getParameter( PARAMETER_ID_FORM );
String strFistResponseDateFilter = request.getParameter( PARAMETER_FIRST_RESPONSE_DATE_FILTER );
String strLastResponseDateFilter = request.getParameter( PARAMETER_LAST_RESPONSE_DATE_FILTER );
String strTimesUnit = request.getParameter( PARAMETER_TIMES_UNIT );
Timestamp tFistResponseDateFilter = null;
Timestamp tLastResponseDateFilter = null;
if ( strFistResponseDateFilter != null )
{
tFistResponseDateFilter = FormUtils.getDateFirstMinute( DateUtil.formatDate( strFistResponseDateFilter, locale ), locale );
}
if ( strLastResponseDateFilter != null )
{
tLastResponseDateFilter = FormUtils.getDateLastMinute( DateUtil.formatDate( strLastResponseDateFilter, locale ), locale );
}
if ( ( strIdForm != null ) && !strIdForm.equals( EMPTY_STRING ) )
{
try
{
nIdForm = Integer.parseInt( strIdForm );
}
catch( NumberFormatException ne )
{
AppLogService.error( ne ); |
Fichier |
Ligne |
fr/paris/lutece/plugins/form/web/FormAdvancedParametersJspBean.java |
167 |
fr/paris/lutece/plugins/form/web/ModifyFormJspBean.java |
490 |
public String getViewModifyFormAdvancedParameters( HttpServletRequest request )
{
Plugin plugin = getPlugin( );
String strIdForm = request.getParameter( PARAMETER_ID_FORM );
int nIdForm = -1;
Form form;
AdminUser adminUser = getUser( );
if ( StringUtils.isNotEmpty( strIdForm ) && StringUtils.isNumeric( strIdForm ) )
{
nIdForm = Integer.parseInt( strIdForm );
setFormId( nIdForm );
}
else
{
return getManageForm( request );
}
form = FormHome.findByPrimaryKey( nIdForm, plugin );
if ( ( form == null ) || !RBACService.isAuthorized( Form.RESOURCE_TYPE, strIdForm, FormResourceIdService.PERMISSION_MODIFY, adminUser ) )
{
return getManageForm( request );
}
setPageTitleProperty( PROPERTY_MODIFY_FORM_TITLE );
Locale locale = getLocale( ); |
Fichier |
Ligne |
fr/paris/lutece/plugins/form/web/FormEntryJspBean.java |
843 |
fr/paris/lutece/plugins/form/web/FormEntryJspBean.java |
879 |
public String doRemoveRegularExpression( HttpServletRequest request )
{
String strIdExpression = request.getParameter( PARAMETER_ID_EXPRESSION );
String strIdField = request.getParameter( PARAMETER_ID_FIELD );
int nIdField = -1;
int nIdExpression = -1;
if ( ( strIdExpression != null ) && ( strIdField != null )
&& ( RBACService.isAuthorized( Form.RESOURCE_TYPE, EMPTY_STRING + getFormId( ), FormResourceIdService.PERMISSION_MODIFY, getUser( ) ) ) )
{
try
{
nIdField = Integer.parseInt( strIdField );
nIdExpression = Integer.parseInt( strIdExpression );
}
catch( NumberFormatException ne )
{
AppLogService.error( ne );
}
if ( ( nIdField != -1 ) && ( nIdExpression != -1 ) )
{
FieldHome.removeVerifyBy( nIdField, nIdExpression ); |
Fichier |
Ligne |
fr/paris/lutece/plugins/form/web/ModifyFormJspBean.java |
440 |
fr/paris/lutece/plugins/form/web/ModifyFormJspBean.java |
536 |
public String doModifyForm( HttpServletRequest request )
{
if ( request.getParameter( PARAMETER_CANCEL ) == null )
{
Plugin plugin = getPlugin( );
String strIdForm = request.getParameter( PARAMETER_ID_FORM );
int nIdForm = -1;
Form updatedForm;
if ( StringUtils.isNotEmpty( strIdForm ) && StringUtils.isNumeric( strIdForm ) )
{
nIdForm = Integer.parseInt( strIdForm );
}
if ( nIdForm != -1 )
{
updatedForm = FormHome.findByPrimaryKey( nIdForm, plugin );
if ( !RBACService.isAuthorized( Form.RESOURCE_TYPE, strIdForm, FormResourceIdService.PERMISSION_MODIFY, getUser( ) ) )
{
return getJspManageForm( request );
}
String strError = getFormData( request, updatedForm );
if ( strError != null ) |
Fichier |
Ligne |
fr/paris/lutece/plugins/form/web/FormEntryJspBean.java |
322 |
fr/paris/lutece/plugins/form/web/FormEntryJspBean.java |
678 |
String strIdEntry = request.getParameter( PARAMETER_ID_ENTRY );
int nIdEntry = -1;
int nIdForm = getFormId( );
if ( ( strIdEntry != null ) && !strIdEntry.equals( EMPTY_STRING ) )
{
try
{
nIdEntry = Integer.parseInt( strIdEntry );
}
catch( NumberFormatException ne )
{
AppLogService.error( ne );
return getManageForm( request );
}
}
if ( ( nIdEntry == -1 ) || !RBACService.isAuthorized( Form.RESOURCE_TYPE, EMPTY_STRING + nIdForm, FormResourceIdService.PERMISSION_MODIFY, getUser( ) ) )
{
return getManageForm( request );
}
_nIdEntry = nIdEntry;
entry = EntryHome.findByPrimaryKey( nIdEntry ); |
Fichier |
Ligne |
fr/paris/lutece/plugins/form/web/FormEntryJspBean.java |
544 |
fr/paris/lutece/plugins/form/web/FormEntryJspBean.java |
619 |
String strIdEntry = request.getParameter( PARAMETER_ID_ENTRY );
Entry entry;
int nIdEntry = -1;
int nIdForm = getFormId( );
if ( ( strIdEntry != null ) && !strIdEntry.equals( EMPTY_STRING ) )
{
try
{
nIdEntry = Integer.parseInt( strIdEntry );
}
catch( NumberFormatException ne )
{
AppLogService.error( ne );
return getJspManageForm( request );
}
}
if ( ( nIdEntry == -1 ) || !RBACService.isAuthorized( Form.RESOURCE_TYPE, EMPTY_STRING + nIdForm, FormResourceIdService.PERMISSION_MODIFY, getUser( ) ) )
{
return getJspManageForm( request );
}
entry = EntryHome.findByPrimaryKey( nIdEntry ); |
Fichier |
Ligne |
fr/paris/lutece/plugins/form/service/entrytype/EntryTypeCropImage.java |
56 |
fr/paris/lutece/plugins/form/service/entrytype/EntryTypeImage.java |
61 |
@Override
public String getTemplateHtmlForm( Entry entry, boolean bDisplayFront )
{
return TEMPLATE_HTML_CODE;
}
/**
* {@inheritDoc}
*/
@Override
public String getTemplateCreate( Entry entry, boolean bDisplayFront )
{
return TEMPLATE_CREATE;
}
/**
* {@inheritDoc}
*/
@Override
public String getTemplateModify( Entry entry, boolean bDisplayFront )
{
return TEMPLATE_MODIFY;
}
/**
* {@inheritDoc}
*/
@Override
public AbstractGenAttUploadHandler getAsynchronousUploadHandler( )
{
return FormAsynchronousUploadHandler.getHandler( );
}
/**
* {@inheritDoc}
*/
@Override
public String getUrlDownloadFile( int nResponseId, String strBaseUrl )
{
UrlItem url = new UrlItem( strBaseUrl + JSP_DOWNLOAD_FILE );
url.addParameter( PARAMETER_ID_RESPONSE, nResponseId );
return url.getUrl( );
}
/**
* {@inheritDoc}
*/
@Override
protected boolean checkForImages( )
{
return true;
}
} |
Fichier |
Ligne |
fr/paris/lutece/plugins/form/web/FormJspBean.java |
1011 |
fr/paris/lutece/plugins/form/web/FormJspBean.java |
1083 |
private String doDisable( HttpServletRequest request, boolean bAutoPublished )
{
Form form;
Plugin plugin = getPlugin( );
String strIdForm = request.getParameter( PARAMETER_ID_FORM );
int nIdForm = -1;
if ( ( strIdForm == null ) || !RBACService.isAuthorized( Form.RESOURCE_TYPE, strIdForm, FormResourceIdService.PERMISSION_CHANGE_STATE, getUser( ) ) )
{
return getHomeUrl( request );
}
try
{
nIdForm = Integer.parseInt( strIdForm );
form = FormHome.findByPrimaryKey( nIdForm, plugin );
}
catch( NumberFormatException ne )
{
AppLogService.error( ne );
return getHomeUrl( request );
}
if ( nIdForm != -1 )
{ |
Fichier |
Ligne |
fr/paris/lutece/plugins/form/service/entrytype/EntryTypeCropImage.java |
56 |
fr/paris/lutece/plugins/form/service/entrytype/EntryTypeFile.java |
57 |
fr/paris/lutece/plugins/form/service/entrytype/EntryTypeImage.java |
61 |
@Override
public String getTemplateHtmlForm( Entry entry, boolean bDisplayFront )
{
return TEMPLATE_HTML_CODE;
}
/**
* {@inheritDoc}
*/
@Override
public String getTemplateCreate( Entry entry, boolean bDisplayFront )
{
return TEMPLATE_CREATE;
}
/**
* {@inheritDoc}
*/
@Override
public String getTemplateModify( Entry entry, boolean bDisplayFront )
{
return TEMPLATE_MODIFY;
}
/**
* {@inheritDoc}
*/
@Override
public AbstractGenAttUploadHandler getAsynchronousUploadHandler( )
{
return FormAsynchronousUploadHandler.getHandler( );
}
/**
* {@inheritDoc}
*/
@Override
public String getUrlDownloadFile( int nResponseId, String strBaseUrl )
{
UrlItem url = new UrlItem( strBaseUrl + JSP_DOWNLOAD_FILE );
url.addParameter( PARAMETER_ID_RESPONSE, nResponseId );
return url.getUrl( );
}
/**
* {@inheritDoc}
*/
@Override
protected boolean checkForImages( )
{
return true; |
Fichier |
Ligne |
fr/paris/lutece/plugins/form/web/FormAdvancedParametersJspBean.java |
169 |
fr/paris/lutece/plugins/form/web/ModifyFormJspBean.java |
492 |
fr/paris/lutece/plugins/form/web/ModifyFormJspBean.java |
594 |
Plugin plugin = getPlugin( );
String strIdForm = request.getParameter( PARAMETER_ID_FORM );
int nIdForm = -1;
Form form;
AdminUser adminUser = getUser( );
if ( StringUtils.isNotEmpty( strIdForm ) && StringUtils.isNumeric( strIdForm ) )
{
nIdForm = Integer.parseInt( strIdForm );
setFormId( nIdForm );
}
else
{
return getManageForm( request );
}
form = FormHome.findByPrimaryKey( nIdForm, plugin );
if ( ( form == null ) || !RBACService.isAuthorized( Form.RESOURCE_TYPE, strIdForm, FormResourceIdService.PERMISSION_MODIFY, adminUser ) )
{
return getManageForm( request );
}
setPageTitleProperty( PROPERTY_MODIFY_FORM_TITLE ); |
Fichier |
Ligne |
fr/paris/lutece/plugins/form/web/FormEntryJspBean.java |
488 |
fr/paris/lutece/plugins/form/web/FormEntryJspBean.java |
546 |
fr/paris/lutece/plugins/form/web/FormEntryJspBean.java |
621 |
fr/paris/lutece/plugins/form/web/FormEntryJspBean.java |
1262 |
int nIdEntry = -1;
int nIdForm = getFormId( );
if ( ( strIdEntry != null ) && !strIdEntry.equals( EMPTY_STRING ) )
{
try
{
nIdEntry = Integer.parseInt( strIdEntry );
}
catch( NumberFormatException ne )
{
AppLogService.error( ne );
return getJspManageForm( request );
}
}
if ( ( nIdEntry == -1 ) || !RBACService.isAuthorized( Form.RESOURCE_TYPE, EMPTY_STRING + nIdForm, FormResourceIdService.PERMISSION_MODIFY, getUser( ) ) )
{
return getJspManageForm( request );
}
entry = EntryHome.findByPrimaryKey( nIdEntry ); |
Fichier |
Ligne |
fr/paris/lutece/plugins/form/business/FormSubmitDAO.java |
211 |
fr/paris/lutece/plugins/form/business/FormSubmitDAO.java |
352 |
String strSQL = FormUtils.buildRequestWithFilter( SQL_QUERY_SELECT_FORM_RESPONSE_BY_FILTER, listStrFilter, null, SQL_ORDER_BY_DATE_RESPONSE_ASC );
DAOUtil daoUtil = new DAOUtil( strSQL, plugin );
int nIndex = 1;
if ( filter.containsIdResource( ) )
{
daoUtil.setInt( nIndex, filter.getIdResource( ) );
nIndex++;
}
if ( filter.containsDateFirst( ) )
{
daoUtil.setTimestamp( nIndex, filter.getDateFirst( ) );
nIndex++;
}
if ( filter.containsDateLast( ) )
{
daoUtil.setTimestamp( nIndex, filter.getDateLast( ) );
nIndex++;
}
daoUtil.executeQuery( );
while ( daoUtil.next( ) )
{ |