Résultats CPD
Le document suivant contient les résultats de l'inspection CPD CPD 6.13.0.
Duplicatas
Fichier |
Ligne |
fr/paris/lutece/plugins/genericattributes/service/entrytype/AbstractEntryTypeSelect.java |
56 |
fr/paris/lutece/plugins/genericattributes/service/entrytype/AbstractEntryTypeSelectOrder.java |
57 |
public abstract class AbstractEntryTypeSelect extends AbstractEntryTypeChoice
{
/**
* {@inheritDoc}
*/
@Override
public String getRequestData( Entry entry, HttpServletRequest request, Locale locale )
{
initCommonRequestData( entry, request );
String strTitle = request.getParameter( PARAMETER_TITLE );
String strCode = request.getParameter( PARAMETER_ENTRY_CODE );
String strHelpMessage = ( request.getParameter( PARAMETER_HELP_MESSAGE ) != null ) ? request.getParameter( PARAMETER_HELP_MESSAGE ).trim( ) : null;
String strComment = request.getParameter( PARAMETER_COMMENT );
String strMandatory = request.getParameter( PARAMETER_MANDATORY );
String strCSSClass = request.getParameter( PARAMETER_CSS_CLASS );
String strOnlyDisplayInBack = request.getParameter( PARAMETER_ONLY_DISPLAY_IN_BACK );
String strIndexed = request.getParameter( PARAMETER_INDEXED );
String strFieldError = StringUtils.EMPTY;
if ( StringUtils.isBlank( strTitle ) )
{
strFieldError = ERROR_FIELD_TITLE;
}
if ( StringUtils.isNotBlank( strFieldError ) )
{
Object [ ] tabRequiredFields = {
I18nService.getLocalizedString( strFieldError, locale )
};
return AdminMessageService.getMessageUrl( request, MESSAGE_MANDATORY_FIELD, tabRequiredFields, AdminMessage.TYPE_STOP );
}
strFieldError = createFieldsUseRefList( entry, request );
if ( StringUtils.isNotBlank( strFieldError ) )
{
return AdminMessageService.getMessageUrl( request, strFieldError, ERROR_FIELD_REF_LIST, AdminMessage.TYPE_STOP );
}
entry.setCode( strCode );
entry.setTitle( strTitle );
entry.setHelpMessage( strHelpMessage );
entry.setComment( strComment );
entry.setCSSClass( strCSSClass );
entry.setMandatory( strMandatory != null );
entry.setOnlyDisplayInBack( strOnlyDisplayInBack != null );
entry.setIndexed( strIndexed != null );
return null;
}
/**
* {@inheritDoc}
*/
@Override
public GenericAttributeError getResponseData( Entry entry, HttpServletRequest request, List<Response> listResponse, Locale locale )
{
String strIdField = request.getParameter( PREFIX_ATTRIBUTE + entry.getIdEntry( ) ); |
Fichier |
Ligne |
fr/paris/lutece/plugins/genericattributes/service/entrytype/AbstractEntryTypeCartography.java |
117 |
fr/paris/lutece/plugins/genericattributes/service/entrytype/AbstractEntryTypeGeolocation.java |
118 |
@Override
public String getRequestData( Entry entry, HttpServletRequest request, Locale locale )
{
initCommonRequestData( entry, request );
String strTitle = request.getParameter( PARAMETER_TITLE );
String strCode = request.getParameter( PARAMETER_ENTRY_CODE );
String strHelpMessage = ( request.getParameter( PARAMETER_HELP_MESSAGE ) != null ) ? request.getParameter( PARAMETER_HELP_MESSAGE ).trim( ) : null;
String strComment = request.getParameter( PARAMETER_COMMENT );
String strMandatory = request.getParameter( PARAMETER_MANDATORY );
String strMapProvider = request.getParameter( PARAMETER_MAP_PROVIDER );
String strEditMode = request.getParameter( PARAMETER_EDIT_MODE );
String strViewNumber = request.getParameter( PARAMETER_VIEW_NUMBER );
String strCSSClass = request.getParameter( PARAMETER_CSS_CLASS );
String strIndexed = request.getParameter( PARAMETER_INDEXED );
String strFieldError = StringUtils.EMPTY;
if ( StringUtils.isBlank( strTitle ) )
{
strFieldError = ERROR_FIELD_TITLE;
}
if ( StringUtils.isNotBlank( strFieldError ) )
{
Object [ ] tabRequiredFields = {
I18nService.getLocalizedString( strFieldError, locale )
};
return AdminMessageService.getMessageUrl( request, MESSAGE_MANDATORY_FIELD, tabRequiredFields, AdminMessage.TYPE_STOP );
} |
Fichier |
Ligne |
fr/paris/lutece/plugins/genericattributes/service/entrytype/AbstractEntryTypeCheckBox.java |
75 |
fr/paris/lutece/plugins/genericattributes/service/entrytype/AbstractEntryTypeRadioButton.java |
70 |
String strErrorMessage = request.getParameter( PARAMETER_ERROR_MESSAGE );
String strFieldInLine = request.getParameter( PARAMETER_FIELD_IN_LINE );
String strCSSClass = request.getParameter( PARAMETER_CSS_CLASS );
String strOnlyDisplayInBack = request.getParameter( PARAMETER_ONLY_DISPLAY_IN_BACK );
int nFieldInLine = -1;
String strFieldError = StringUtils.EMPTY;
if ( StringUtils.isBlank( strTitle ) )
{
strFieldError = ERROR_FIELD_TITLE;
}
if ( StringUtils.isNotBlank( strFieldError ) )
{
Object [ ] tabRequiredFields = {
I18nService.getLocalizedString( strFieldError, locale )
};
return AdminMessageService.getMessageUrl( request, MESSAGE_MANDATORY_FIELD, tabRequiredFields, AdminMessage.TYPE_STOP );
}
strFieldError = createFieldsUseRefList( entry, request );
if ( StringUtils.isNotBlank( strFieldError ) )
{
return AdminMessageService.getMessageUrl( request, strFieldError, ERROR_FIELD_REF_LIST, AdminMessage.TYPE_STOP );
}
entry.setCode( strCode );
entry.setTitle( strTitle );
entry.setHelpMessage( strHelpMessage );
entry.setComment( strComment );
entry.setCSSClass( strCSSClass );
entry.setMandatory( strMandatory != null );
entry.setOnlyDisplayInBack( strOnlyDisplayInBack != null ); |
Fichier |
Ligne |
fr/paris/lutece/plugins/genericattributes/business/FieldDAO.java |
110 |
fr/paris/lutece/plugins/genericattributes/business/FieldDAO.java |
175 |
daoUtil.setInt( nIndex++, field.getParentEntry( ).getIdEntry( ) );
daoUtil.setString( nIndex++, field.getCode( ) );
daoUtil.setString( nIndex++, field.getTitle( ) );
daoUtil.setString( nIndex++, field.getValue( ) );
daoUtil.setBoolean( nIndex++, field.isDefaultValue( ) );
daoUtil.setInt( nIndex++, field.getPosition( ) );
daoUtil.setDate( nIndex++, ( field.getValueTypeDate( ) == null ) ? null : new Date( field.getValueTypeDate( ).getTime( ) ) );
daoUtil.setBoolean( nIndex++, field.isNoDisplayTitle( ) );
daoUtil.setString( nIndex++, field.getComment( ) );
daoUtil.setString( nIndex++, ( field.getFileImage( ) == null ) ? null : field.getFileImage( ).getFileKey( ) );
daoUtil.executeUpdate( ); |
Fichier |
Ligne |
fr/paris/lutece/plugins/genericattributes/business/ResponseDAO.java |
92 |
fr/paris/lutece/plugins/genericattributes/business/ResponseDAO.java |
174 |
daoUtil.setString( nIndex++, removeInvalidChars( response.getResponseValue( ) ) );
daoUtil.setInt( nIndex++, response.getEntry( ).getIdEntry( ) );
daoUtil.setInt( nIndex++, response.getIterationNumber( ) );
if ( response.getField( ) != null )
{
daoUtil.setInt( nIndex++, response.getField( ).getIdField( ) );
}
else
{
daoUtil.setIntNull( nIndex++ );
}
if ( response.getFile( ) != null )
{
daoUtil.setString( nIndex++, response.getFile( ).getFileKey( ) );
daoUtil.setString( nIndex++, response.getFile( ).getOrigin( ) == null ? FileService.getInstance( ).getFileStoreServiceProvider( ).getName( )
: response.getFile( ).getOrigin( ) );
}
else
{
daoUtil.setIntNull( nIndex++ );
}
daoUtil.setInt( nIndex++, Response.CONSTANT_STATUS_ACTIVE ); |
Fichier |
Ligne |
fr/paris/lutece/plugins/genericattributes/business/EntryDAO.java |
109 |
fr/paris/lutece/plugins/genericattributes/business/EntryDAO.java |
233 |
daoUtil.setInt( nIndex++, entry.getIdResource( ) );
daoUtil.setString( nIndex++, entry.getResourceType( ) );
daoUtil.setInt( nIndex++, entry.getEntryType( ).getIdType( ) );
if ( entry.getParent( ) != null )
{
daoUtil.setInt( nIndex++, entry.getParent( ).getIdEntry( ) );
}
else
{
daoUtil.setIntNull( nIndex++ );
}
daoUtil.setString( nIndex++, entry.getCode( ) );
daoUtil.setString( nIndex++, trimEntryTitle( entry ) );
daoUtil.setString( nIndex++, entry.getHelpMessage( ) );
daoUtil.setString( nIndex++, entry.getComment( ) );
daoUtil.setBoolean( nIndex++, entry.isMandatory( ) );
daoUtil.setBoolean( nIndex++, entry.isFieldInLine( ) ); |
Fichier |
Ligne |
fr/paris/lutece/plugins/genericattributes/service/entrytype/AbstractEntryTypeCheckBox.java |
82 |
fr/paris/lutece/plugins/genericattributes/service/entrytype/AbstractEntryTypeSelect.java |
74 |
fr/paris/lutece/plugins/genericattributes/service/entrytype/AbstractEntryTypeSelectOrder.java |
75 |
String strFieldError = StringUtils.EMPTY;
if ( StringUtils.isBlank( strTitle ) )
{
strFieldError = ERROR_FIELD_TITLE;
}
if ( StringUtils.isNotBlank( strFieldError ) )
{
Object [ ] tabRequiredFields = {
I18nService.getLocalizedString( strFieldError, locale )
};
return AdminMessageService.getMessageUrl( request, MESSAGE_MANDATORY_FIELD, tabRequiredFields, AdminMessage.TYPE_STOP );
}
strFieldError = createFieldsUseRefList( entry, request );
if ( StringUtils.isNotBlank( strFieldError ) )
{
return AdminMessageService.getMessageUrl( request, strFieldError, ERROR_FIELD_REF_LIST, AdminMessage.TYPE_STOP );
}
entry.setCode( strCode );
entry.setTitle( strTitle );
entry.setHelpMessage( strHelpMessage );
entry.setComment( strComment );
entry.setCSSClass( strCSSClass );
entry.setMandatory( strMandatory != null );
entry.setOnlyDisplayInBack( strOnlyDisplayInBack != null );
entry.setErrorMessage( strErrorMessage ); |
Fichier |
Ligne |
fr/paris/lutece/plugins/genericattributes/service/entrytype/AbstractEntryTypeRadioButton.java |
77 |
fr/paris/lutece/plugins/genericattributes/service/entrytype/AbstractEntryTypeSelect.java |
74 |
fr/paris/lutece/plugins/genericattributes/service/entrytype/AbstractEntryTypeSelectOrder.java |
75 |
String strFieldError = StringUtils.EMPTY;
if ( StringUtils.isBlank( strTitle ) )
{
strFieldError = ERROR_FIELD_TITLE;
}
if ( StringUtils.isNotBlank( strFieldError ) )
{
Object [ ] tabRequiredFields = {
I18nService.getLocalizedString( strFieldError, locale )
};
return AdminMessageService.getMessageUrl( request, MESSAGE_MANDATORY_FIELD, tabRequiredFields, AdminMessage.TYPE_STOP );
}
strFieldError = createFieldsUseRefList( entry, request );
if ( StringUtils.isNotBlank( strFieldError ) )
{
return AdminMessageService.getMessageUrl( request, strFieldError, ERROR_FIELD_REF_LIST, AdminMessage.TYPE_STOP );
}
entry.setCode( strCode );
entry.setTitle( strTitle );
entry.setHelpMessage( strHelpMessage );
entry.setComment( strComment );
entry.setCSSClass( strCSSClass );
entry.setMandatory( strMandatory != null );
entry.setOnlyDisplayInBack( strOnlyDisplayInBack != null ); |
Fichier |
Ligne |
fr/paris/lutece/plugins/genericattributes/service/entrytype/AbstractEntryTypeArray.java |
216 |
fr/paris/lutece/plugins/genericattributes/service/entrytype/AbstractEntryTypeChoice.java |
56 |
@Override
public String getResponseValueForExport( Entry entry, HttpServletRequest request, Response response, Locale locale )
{
return response.getResponseValue( );
}
/**
* {@inheritDoc}
*/
@Override
public String getResponseValueForRecap( Entry entry, HttpServletRequest request, Response response, Locale locale )
{
if ( response.getField( ) != null )
{
if ( response.getField( ).getTitle( ) == null )
{
Field field = FieldHome.findByPrimaryKey( response.getField( ).getIdField( ) );
if ( field != null )
{
response.setField( field );
}
}
return response.getField( ).getTitle( );
}
return null;
} |
Fichier |
Ligne |
fr/paris/lutece/plugins/genericattributes/service/entrytype/AbstractEntryTypeGalleryImage.java |
162 |
fr/paris/lutece/plugins/genericattributes/service/entrytype/AbstractEntryTypeUpload.java |
291 |
}
/**
* {@inheritDoc}
*/
@Override
public String getRequestData( Entry entry, HttpServletRequest request, Locale locale )
{
initCommonRequestData( entry, request );
String strTitle = request.getParameter( PARAMETER_TITLE );
String strHelpMessage = ( request.getParameter( PARAMETER_HELP_MESSAGE ) != null ) ? request.getParameter( PARAMETER_HELP_MESSAGE ).trim( ) : null;
String strComment = request.getParameter( PARAMETER_COMMENT );
String strMandatory = request.getParameter( PARAMETER_MANDATORY );
String strCSSClass = request.getParameter( PARAMETER_CSS_CLASS );
String strCode = request.getParameter( PARAMETER_ENTRY_CODE );
String strOnlyDisplayInBack = request.getParameter( PARAMETER_ONLY_DISPLAY_IN_BACK );
String strIndexed = request.getParameter( PARAMETER_INDEXED );
String strError = checkEntryData( request, locale ); |
Fichier |
Ligne |
fr/paris/lutece/plugins/genericattributes/service/entrytype/AbstractEntryTypeRadioButton.java |
143 |
fr/paris/lutece/plugins/genericattributes/service/entrytype/AbstractEntryTypeSelect.java |
124 |
}
if ( nIdField != -1 )
{
field = GenericAttributesUtils.findFieldByIdInTheList( nIdField, entry.getFields( ) );
}
if ( field != null )
{
response.setResponseValue( field.getValue( ) );
response.setField( field );
}
response.setIterationNumber( getResponseIterationValue( request ) );
listResponse.add( response );
if ( entry.isMandatory( ) && ( ( field == null ) || StringUtils.isBlank( field.getValue( ) ) ) )
{
return new MandatoryError( entry, locale );
}
return null;
}
} |
Fichier |
Ligne |
fr/paris/lutece/plugins/genericattributes/service/entrytype/AbstractEntryTypeSelect.java |
106 |
fr/paris/lutece/plugins/genericattributes/service/entrytype/AbstractEntryTypeSelectSQL.java |
120 |
return null;
}
/**
* {@inheritDoc}
*/
@Override
public GenericAttributeError getResponseData( Entry entry, HttpServletRequest request, List<Response> listResponse, Locale locale )
{
String strIdField = request.getParameter( PREFIX_ATTRIBUTE + entry.getIdEntry( ) );
int nIdField = -1;
Field field = null;
Response response = new Response( );
response.setEntry( entry );
if ( StringUtils.isNotEmpty( strIdField ) && StringUtils.isNumeric( strIdField ) )
{
nIdField = Integer.parseInt( strIdField );
}
if ( nIdField != -1 )
{
field = GenericAttributesUtils.findFieldByIdInTheList( nIdField, entry.getFields( ) ); |