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/workflow/modules/forms/web/task/EditFormResponseAutoUpdateTaskComponent.java |
171 |
fr/paris/lutece/plugins/workflow/modules/forms/web/task/EditFormResponseTaskComponent.java |
318 |
_editFormResponseTaskService.getResponseReferenceList( QuestionHome.findByCode( _configValue.getCode( ) ).get( 0 ).getId( ) ) );
}
HtmlTemplate template = AppTemplateService.getTemplate( TEMPLATE_TASK_FORM_EDITRESPONSE_CONFIG, locale, model );
return template.getHtml( );
}
protected boolean isTaskBo( )
{
return true;
}
private ReferenceList getQuestionReferenceList( int idStep )
{
ReferenceList refList = new ReferenceList( );
refList.addItem( -1, "" );
if ( idStep != -1 )
{
List<Question> questionList = QuestionHome.getQuestionsListByStep( idStep );
for ( Question question : questionList )
{
if ( question.getEntry( ).isOnlyDisplayInBack( ) == isTaskBo( ) )
{
refList.addItem( question.getId( ), question.getTitle( ) );
}
}
}
return refList;
}
@Override
public String doSaveConfig( HttpServletRequest request, Locale locale, ITask task )
{
_config = getTaskConfigService( ).findByPrimaryKey( task.getId( ) );
boolean create = _config == null;
if ( create )
{
_config = new EditFormResponseConfig( );
_config.setIdTask( task.getId( ) );
}
String action = request.getParameter( PARAMETER_ACTION );
if ( action != null )
{
doProcessAction( action, request );
}
if ( create )
{
getTaskConfigService( ).create( _config );
}
else
{
getTaskConfigService( ).update( _config );
}
return null;
}
private void doProcessAction( String action, HttpServletRequest request )
{
switch( action )
{
case ACTION_SELECT_MULTIFORM:
_config.setMultiform( request.getParameter( PARAMETER_MULTIFORM ) != null );
_config.setListConfigValues( new ArrayList<>( ) );
break;
case ACTION_SELECT_FORM:
_configValue = new EditFormResponseConfigValue( );
_configValue.setForm( FormHome.findByPrimaryKey( Integer.valueOf( request.getParameter( PARAMETER_FORM ) ) ) );
break;
case ACTION_SELECT_STEP:
_configValue.setStep( StepHome.findByPrimaryKey( Integer.parseInt( request.getParameter( PARAMETER_STEP ) ) ) );
_configValue.setQuestion( null );
break;
case ACTION_SELECT_QUESTION:
_configValue.setQuestion( QuestionHome.findByPrimaryKey( Integer.parseInt( request.getParameter( PARAMETER_QUESTION ) ) ) ); |
Fichier |
Ligne |
fr/paris/lutece/plugins/workflow/modules/forms/web/task/EditFormResponseAutoUpdateTaskComponent.java |
131 |
fr/paris/lutece/plugins/workflow/modules/forms/web/task/EditFormResponseTaskComponent.java |
289 |
}
@Override
public String getDisplayConfigForm( HttpServletRequest request, Locale locale, ITask task )
{
_config = getTaskConfigService( ).findByPrimaryKey( task.getId( ) );
if ( _config == null )
{
_config = new EditFormResponseConfig( );
}
if ( _configValue == null )
{
_configValue = new EditFormResponseConfigValue( );
}
Map<String, Object> model = new HashMap<>( );
model.put( MARK_FORM_LIST, FormHome.getFormsReferenceList( ) );
model.put( MARK_MAPPING_LIST, _config.getListConfigValues( ) );
model.put( MARK_MULTIFORM, _config.isMultiform( ) );
model.put( MARK_CODE_LIST, _editFormResponseTaskService.selectAllTechnicalCode( isTaskBo( ) ) );
if ( _configValue.getForm( ) != null )
{
model.put( MARK_ID_FORM, _configValue.getForm( ).getId( ) );
model.put( MARK_STEP_LIST, StepHome.getStepReferenceListByForm( _configValue.getForm( ).getId( ) ) );
}
if ( _configValue.getStep( ) != null )
{
model.put( MARK_ID_STEP, _configValue.getStep( ).getId( ) );
model.put( MARK_QUESTION_LIST, getQuestionReferenceList( _configValue.getStep( ).getId( ) ) );
} |
Fichier |
Ligne |
fr/paris/lutece/plugins/workflow/modules/forms/business/EditFormResponseConfigValueDao.java |
68 |
fr/paris/lutece/plugins/workflow/modules/forms/business/EditFormResponseConfigValueDao.java |
119 |
daoUtil.setInt( ++nIndex, configValue.getIdConfig( ) );
if ( configValue.getForm( ) != null )
{
daoUtil.setInt( ++nIndex, configValue.getForm( ).getId( ) );
}
else
{
daoUtil.setNull( ++nIndex, Types.INTEGER );
}
if ( configValue.getStep( ) != null )
{
daoUtil.setInt( ++nIndex, configValue.getStep( ).getId( ) );
}
else
{
daoUtil.setNull( ++nIndex, Types.INTEGER );
}
if ( configValue.getQuestion( ) != null )
{
daoUtil.setInt( ++nIndex, configValue.getQuestion( ).getId( ) );
}
else
{
daoUtil.setNull( ++nIndex, Types.INTEGER );
}
if ( configValue.getResponse( ) != null )
{
daoUtil.setString( ++nIndex, configValue.getResponse( ) );
}
else
{
daoUtil.setNull( ++nIndex, Types.VARCHAR );
}
daoUtil.setString( ++nIndex, configValue.getCode( ) );
daoUtil.executeUpdate( ); |
Fichier |
Ligne |
fr/paris/lutece/plugins/workflow/modules/forms/business/FormResponseValueStateControllerConfigDao.java |
55 |
fr/paris/lutece/plugins/workflow/modules/forms/business/FormResponseValueStateControllerConfigDao.java |
94 |
try ( DAOUtil daoUtil = new DAOUtil( SQL_QUERY_INSERT, Statement.RETURN_GENERATED_KEYS, plugin ) )
{
int index = 0;
daoUtil.setInt( ++index, config.getIdTask( ) );
if ( config.getForm( ) != null )
{
daoUtil.setInt( ++index, config.getForm( ).getId( ) );
}
else
{
daoUtil.setInt( ++index, -1 );
}
if ( config.getStep( ) != null )
{
daoUtil.setInt( ++index, config.getStep( ).getId( ) );
}
else
{
daoUtil.setInt( ++index, -1 );
}
if ( config.getQuestion( ) != null )
{
daoUtil.setInt( ++index, config.getQuestion( ).getId( ) );
}
else
{
daoUtil.setInt( ++index, -1 );
}
daoUtil.setString( ++index, config.getValue( ) );
daoUtil.setBoolean( ++index, config.isMultiform( ) );
daoUtil.setString( ++index, config.getCode( ) );
daoUtil.executeUpdate( ); |
Fichier |
Ligne |
fr/paris/lutece/plugins/workflow/modules/forms/business/LinkedValuesFormResponseConfigValueDAO.java |
171 |
fr/paris/lutece/plugins/workflow/modules/forms/business/LinkedValuesFormResponseConfigValueDAO.java |
198 |
daoUtil.executeQuery( );
while ( daoUtil.next( ) )
{
int nIndex = 0;
LinkedValuesFormResponseConfigValue linkedValuesFormResponseConfigValue = new LinkedValuesFormResponseConfigValue( );
linkedValuesFormResponseConfigValue.setIdConfigValue( daoUtil.getInt( ++nIndex ) );
linkedValuesFormResponseConfigValue.setIdConfig( daoUtil.getInt( ++nIndex ) );
linkedValuesFormResponseConfigValue.setIdForm( daoUtil.getInt( ++nIndex ) );
linkedValuesFormResponseConfigValue.setIdQuestionSource( daoUtil.getInt( ++nIndex ) );
linkedValuesFormResponseConfigValue.setQuestionSourceValue( daoUtil.getString( ++nIndex ) );
linkedValuesFormResponseConfigValue.setIdQuestionTarget( daoUtil.getInt( ++nIndex ) );
linkedValuesFormResponseConfigValue.setQuestionTargetValue( daoUtil.getString( ++nIndex ) );
listLinkedValuesFormResponseConfigValues.add( linkedValuesFormResponseConfigValue );
}
return listLinkedValuesFormResponseConfigValues;
}
} |
Fichier |
Ligne |
fr/paris/lutece/plugins/workflow/modules/forms/web/AbstractFormResponseApp.java |
91 |
fr/paris/lutece/plugins/workflow/modules/forms/web/ResubmitFormResponseApp.java |
87 |
protected IFormsTaskService _formsTaskService = SpringContextService.getBean( "workflow-forms.formsTaskService" );
@Override
public XPage getPage( HttpServletRequest request, int nMode, Plugin plugin ) throws UserNotSignedException, SiteMessageException
{
XPage page = null;
if ( !getRequestAuthenticator( ).isRequestAuthenticated( request ) )
{
// Throws Exception
_formsTaskService.setSiteMessage( request, Messages.USER_ACCESS_DENIED, SiteMessage.TYPE_STOP, request.getParameter( PARAMETER_URL_RETURN ) );
return null;
}
String strIdHistory = request.getParameter( PARAMETER_ID_HISTORY );
String strIdTask = request.getParameter( PARAMETER_ID_TASK );
if ( StringUtils.isNumeric( strIdHistory ) && StringUtils.isNumeric( strIdTask ) )
{
int nIdHistory = Integer.parseInt( strIdHistory );
int nIdTask = Integer.parseInt( strIdTask ); |
Fichier |
Ligne |
fr/paris/lutece/plugins/workflow/modules/forms/service/provider/CompleteFormResponseMarkerProvider.java |
100 |
fr/paris/lutece/plugins/workflow/modules/forms/service/provider/ResubmitFormResponseMarkerProvider.java |
100 |
InfoMarker notifyGruMarkerEntries = new InfoMarker( CompleteFormResponseTaskInfoProvider.MARK_COMPLETE_FORM_ENTRIES );
notifyGruMarkerEntries.setDescription( MESSAGE_MARKER_ENTRIES_DESCRIPTION );
listMarkers.add( notifyGruMarkerEntries );
return listMarkers;
}
@Override
public Collection<InfoMarker> provideMarkerValues( ResourceHistory resourceHistory, ITask task, HttpServletRequest request )
{
List<InfoMarker> listMarkers = new ArrayList<>( );
Locale locale = Locale.getDefault( );
if ( request != null )
{
locale = request.getLocale( );
}
for ( ITask taskOther : _taskService.getListTaskByIdAction( resourceHistory.getAction( ).getId( ), locale ) )
{
if ( taskOther.getTaskType( ).getKey( ).equals( _completeFormResponseTaskInfoProvider.getTaskType( ).getKey( ) ) ) |
Fichier |
Ligne |
fr/paris/lutece/plugins/workflow/modules/forms/business/LinkedValuesFormResponseConfigValueDAO.java |
66 |
fr/paris/lutece/plugins/workflow/modules/forms/business/LinkedValuesFormResponseConfigValueDAO.java |
145 |
try ( DAOUtil daoUtil = new DAOUtil( SQL_QUERY_INSERT, Statement.RETURN_GENERATED_KEYS, WorkflowUtils.getPlugin( ) ) )
{
int nIndex = 0;
daoUtil.setInt( ++nIndex, linkedValuesFormResponseConfigValue.getIdConfigValue( ) );
daoUtil.setInt( ++nIndex, linkedValuesFormResponseConfigValue.getIdConfig( ) );
daoUtil.setInt( ++nIndex, linkedValuesFormResponseConfigValue.getIdForm( ) );
daoUtil.setInt( ++nIndex, linkedValuesFormResponseConfigValue.getIdQuestionSource( ) );
daoUtil.setString( ++nIndex, linkedValuesFormResponseConfigValue.getQuestionSourceValue( ) );
daoUtil.setInt( ++nIndex, linkedValuesFormResponseConfigValue.getIdQuestionTarget( ) );
daoUtil.setString( ++nIndex, linkedValuesFormResponseConfigValue.getQuestionTargetValue( ) );
daoUtil.executeUpdate( ); |
Fichier |
Ligne |
fr/paris/lutece/plugins/workflow/modules/forms/business/CompleteFormResponseDAO.java |
164 |
fr/paris/lutece/plugins/workflow/modules/forms/business/ResubmitFormResponseDAO.java |
166 |
}
/**
* {@inheritDoc}
*/
@Override
public void deleteByIdHistory( int nIdHistory, int nIdTask, Plugin plugin )
{
try ( DAOUtil daoUtil = new DAOUtil( SQL_QUERY_DELETE_BY_ID_HISTORY, plugin ) )
{
int nIndex = 1;
daoUtil.setInt( nIndex++, nIdHistory );
daoUtil.setInt( nIndex++, nIdTask );
daoUtil.executeUpdate( );
}
}
/**
* {@inheritDoc}
*/
@Override
public void deleteByIdTask( int nIdTask, Plugin plugin )
{
try ( DAOUtil daoUtil = new DAOUtil( SQL_QUERY_DELETE_BY_TASK, plugin ) )
{
daoUtil.setInt( 1, nIdTask );
daoUtil.executeUpdate( );
}
}
private CompleteFormResponse dataToObject( DAOUtil daoUtil ) |