CPD Results
The following document contains the results of PMD's CPD 6.13.0.
Duplications
File |
Line |
fr/paris/lutece/plugins/form/business/FormDAO.java |
177 |
fr/paris/lutece/plugins/form/business/FormDAO.java |
358 |
form = new Form( );
form.setIdForm( daoUtil.getInt( nIndex++ ) );
form.setTitle( daoUtil.getString( 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++ ) ); |
File |
Line |
fr/paris/lutece/plugins/form/business/EntryTypeCheckBox.java |
66 |
fr/paris/lutece/plugins/form/business/EntryTypeRadioButton.java |
65 |
public String getHtmlCode( )
{
return _template_html_code;
}
/**
* Get the request data
* @param request HttpRequest
* @param locale the locale
* @return null if all data requiered are in the request else the url of jsp error
*/
public String getRequestData( HttpServletRequest request, Locale locale )
{
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 strFieldInLine = request.getParameter( PARAMETER_FIELD_IN_LINE );
int nFieldInLine = -1;
String strFieldError = EMPTY_STRING;
if ( ( strTitle == null ) || strTitle.trim( ).equals( EMPTY_STRING ) )
{
strFieldError = FIELD_TITLE;
}
if ( !strFieldError.equals( EMPTY_STRING ) )
{
Object[] tabRequiredFields = { I18nService.getLocalizedString( strFieldError, locale ) };
return AdminMessageService.getMessageUrl( request, MESSAGE_MANDATORY_FIELD, tabRequiredFields,
AdminMessage.TYPE_STOP );
}
// for don't update fields listFields=null
this.setFields( null );
this.setTitle( strTitle );
this.setHelpMessage( strHelpMessage );
this.setComment( strComment );
if ( strMandatory != null )
{
this.setMandatory( true );
}
else
{
this.setMandatory( false );
}
try
{
nFieldInLine = Integer.parseInt( strFieldInLine );
}
catch ( NumberFormatException ne )
{
AppLogService.error( ne );
}
if ( nFieldInLine == 1 )
{
this.setFieldInLine( true );
}
else
{
this.setFieldInLine( false );
}
return null;
}
/**
* Get template create url of the entry
* @return template create url of the entry
*/
public String getTemplateCreate( )
{
return _template_create;
}
/**
* Get the template modify url of the entry
* @return template modify url of the entry
*/
public String getTemplateModify( )
{
return _template_modify;
}
/**
* The paginator who is use in the template modify of the entry
* @param nItemPerPage Number of items to display per page
* @param strBaseUrl The base Url for build links on each page link
* @param strPageIndexParameterName The parameter name for the page index
* @param strPageIndex The current page index
* @return the paginator who is use in the template modify of the entry
*/
public Paginator getPaginator( int nItemPerPage, String strBaseUrl, String strPageIndexParameterName,
String strPageIndex )
{
return new Paginator( this.getFields( ), nItemPerPage, strBaseUrl, strPageIndexParameterName, strPageIndex );
}
/**
* save in the list of response the response associate to the entry in the form submit
* @param request HttpRequest
* @param listResponse the list of response associate to the entry in the form submit
* @param locale the locale
* @return a Form error object if there is an error in the response
*/
public FormError getResponseData( HttpServletRequest request, List<Response> listResponse, Locale locale )
{
String[] strTabIdField = request.getParameterValues( FormUtils.EMPTY_STRING + this.getIdEntry( ) ); |
File |
Line |
fr/paris/lutece/plugins/form/business/EntryTypeRadioButton.java |
132 |
fr/paris/lutece/plugins/form/business/EntryTypeSelect.java |
112 |
this.setFieldInLine( false );
}
return null;
}
/**
* Get template create url of the entry
* @return template create url of the entry
*/
public String getTemplateCreate( )
{
return _template_create;
}
/**
* Get the template modify url of the entry
* @return template modify url of the entry
*/
public String getTemplateModify( )
{
return _template_modify;
}
/**
* The paginator who is use in the template modify of the entry
* @param nItemPerPage Number of items to display per page
* @param strBaseUrl The base Url for build links on each page link
* @param strPageIndexParameterName The parameter name for the page index
* @param strPageIndex The current page index
* @return the paginator who is use in the template modify of the entry
*/
public Paginator getPaginator( int nItemPerPage, String strBaseUrl, String strPageIndexParameterName,
String strPageIndex )
{
return new Paginator( this.getFields( ), nItemPerPage, strBaseUrl, strPageIndexParameterName, strPageIndex );
}
/**
* save in the list of response the response associate to the entry in the form submit
* @param request HttpRequest
* @param listResponse the list of response associate to the entry in the form submit
* @param locale the locale
* @return a Form error object if there is an error in the response
*/
public FormError getResponseData( HttpServletRequest request, List<Response> listResponse, Locale locale )
{
String strIdField = request.getParameter( FormUtils.EMPTY_STRING + this.getIdEntry( ) );
int nIdField = -1;
Field field = null;
Response response = new Response( );
response.setEntry( this );
if ( strIdField != null )
{
try
{
nIdField = Integer.parseInt( strIdField );
}
catch ( NumberFormatException ne )
{
AppLogService.error( ne );
}
}
if ( nIdField != -1 )
{
field = FormUtils.findFieldByIdInTheList( nIdField, this.getFields( ) );
}
if ( this.isMandatory( ) )
{
if ( ( field == null ) || field.getValue( ).equals( FormUtils.EMPTY_STRING ) )
{
FormError formError = new FormError( );
formError.setMandatoryError( true );
formError.setTitleQuestion( this.getTitle( ) );
return formError;
}
}
if ( field != null )
{
response.setValueResponse( field.getValue( ).getBytes( ) );
response.setField( field );
}
listResponse.add( response );
return null;
}
/**
* Get the response value associate to the entry to export in the file export
* @param response the response associate to the entry
* @param locale the locale
* @param request the request
* @return the response value associate to the entry to export in the file export
*/
public String getResponseValueForExport( HttpServletRequest request, Response response, Locale locale )
{
return new String( response.getValueResponse( ) );
}
/**
* Get the response value associate to the entry to write in the recap
* @param response the response associate to the entry
* @param locale the locale
* @param request the request
* @return the response value associate to the entry to write in the recap
*/
public String getResponseValueForRecap( HttpServletRequest request, Response response, Locale locale )
{
return new String( response.getField( ).getTitle( ) );
}
} |
File |
Line |
fr/paris/lutece/plugins/form/business/FormDAO.java |
119 |
fr/paris/lutece/plugins/form/business/FormDAO.java |
235 |
form.setIdForm( newPrimaryKey( plugin ) );
int nIndex = 1;
daoUtil.setInt( nIndex++, form.getIdForm( ) );
daoUtil.setString( nIndex++, form.getTitle( ) );
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( ) ); |
File |
Line |
fr/paris/lutece/plugins/form/web/FormJspBean.java |
1863 |
fr/paris/lutece/plugins/form/web/FormJspBean.java |
1949 |
public String doMoveUpEntry( HttpServletRequest request )
{
Plugin plugin = getPlugin( );
IEntry entry;
String strIdEntry = request.getParameter( PARAMETER_ID_ENTRY );
int nIdEntry = -1;
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, plugin );
List<IEntry> listEntry;
EntryFilter filter = new EntryFilter( );
filter.setIdForm( entry.getForm( ).getIdForm( ) );
if ( entry.getParent( ) != null )
{
filter.setIdEntryParent( entry.getParent( ).getIdEntry( ) );
}
else
{
filter.setEntryParentNull( EntryFilter.FILTER_TRUE );
}
if ( entry.getFieldDepend( ) != null )
{
filter.setIdFieldDepend( entry.getFieldDepend( ).getIdField( ) );
}
else
{
filter.setFieldDependNull( EntryFilter.FILTER_TRUE );
}
listEntry = EntryHome.getEntryList( filter, plugin );
int nIndexEntry = FormUtils.getIndexEntryInTheEntryList( nIdEntry, listEntry );
if ( nIndexEntry != 0 ) |
File |
Line |
fr/paris/lutece/plugins/form/business/ResponseDAO.java |
149 |
fr/paris/lutece/plugins/form/business/ResponseDAO.java |
299 |
if ( daoUtil.next( ) )
{
response = new Response( );
response.setIdResponse( daoUtil.getInt( 1 ) );
formResponse = new FormSubmit( );
formResponse.setIdFormSubmit( daoUtil.getInt( 2 ) );
response.setFormSubmit( formResponse );
response.setValueResponse( daoUtil.getBytes( 3 ) );
entryType = new EntryType( );
entryType.setClassName( daoUtil.getString( 4 ) );
try
{
entry = (IEntry) Class.forName( entryType.getClassName( ) ).newInstance( );
}
catch ( ClassNotFoundException e )
{
// class doesn't exist
AppLogService.error( e );
bException = true;
}
catch ( InstantiationException e )
{
// Class is abstract or is an interface or haven't accessible builder
AppLogService.error( e );
bException = true;
}
catch ( IllegalAccessException e )
{
// can't access to rhe class
AppLogService.error( e );
bException = true;
}
if ( bException )
{
return null;
}
entry.setEntryType( entryType );
entry.setIdEntry( daoUtil.getInt( 5 ) );
entry.setTitle( daoUtil.getString( 6 ) );
response.setEntry( entry );
if ( daoUtil.getObject( 7 ) != null )
{
field = new Field( );
field.setIdField( daoUtil.getInt( 8 ) );
response.setField( field );
}
response.setFileName( daoUtil.getString( 9 ) );
response.setFileExtension( daoUtil.getString( 10 ) ); |
File |
Line |
fr/paris/lutece/plugins/form/business/EntryTypeSelect.java |
76 |
fr/paris/lutece/plugins/form/business/EntryTypeSelectSQL.java |
82 |
public String getRequestData( HttpServletRequest request, Locale locale )
{
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 strFieldError = EMPTY_STRING;
if ( ( strTitle == null ) || strTitle.trim( ).equals( EMPTY_STRING ) )
{
strFieldError = FIELD_TITLE;
}
if ( !strFieldError.equals( EMPTY_STRING ) )
{
Object[] tabRequiredFields = { I18nService.getLocalizedString( strFieldError, locale ) };
return AdminMessageService.getMessageUrl( request, MESSAGE_MANDATORY_FIELD, tabRequiredFields,
AdminMessage.TYPE_STOP );
}
// for don't update fields listFields=null
this.setFields( null );
this.setTitle( strTitle );
this.setHelpMessage( strHelpMessage );
this.setComment( strComment );
if ( strMandatory != null )
{
this.setMandatory( true );
}
else
{
this.setMandatory( false );
}
return null;
} |
File |
Line |
fr/paris/lutece/plugins/form/business/EntryDAO.java |
228 |
fr/paris/lutece/plugins/form/business/EntryDAO.java |
428 |
if ( daoUtil.next( ) )
{
entryType = new EntryType( );
entryType.setIdType( daoUtil.getInt( 1 ) );
entryType.setTitle( daoUtil.getString( 2 ) );
entryType.setGroup( daoUtil.getBoolean( 3 ) );
entryType.setComment( daoUtil.getBoolean( 4 ) );
entryType.setClassName( daoUtil.getString( 5 ) );
try
{
entry = (IEntry) Class.forName( entryType.getClassName( ) ).newInstance( );
}
catch ( ClassNotFoundException e )
{
// class doesn't exist
AppLogService.error( e );
return null;
}
catch ( InstantiationException e )
{
// Class is abstract or is an interface or haven't accessible builder
AppLogService.error( e );
return null;
}
catch ( IllegalAccessException e )
{
// can't access to rhe class
AppLogService.error( e );
return null;
}
entry.setEntryType( entryType );
entry.setIdEntry( daoUtil.getInt( 6 ) );
// insert form
form = new Form( );
form.setIdForm( daoUtil.getInt( 7 ) ); |
File |
Line |
fr/paris/lutece/plugins/form/business/EntryTypeDate.java |
129 |
fr/paris/lutece/plugins/form/business/EntryTypeTextArea.java |
154 |
this.getFields( ).get( 0 ).setValueTypeDate( dDateValue );
if ( strMandatory != null )
{
this.setMandatory( true );
}
else
{
this.setMandatory( false );
}
return null;
}
/**
* Get template create url of the entry
* @return template create url of the entry
*/
public String getTemplateCreate( )
{
return _template_create;
}
/**
* Get the template modify url of the entry
* @return template modify url of the entry
*/
public String getTemplateModify( )
{
return _template_modify;
}
/**
* save in the list of response the response associate to the entry in the form submit
* @param request HttpRequest
* @param listResponse the list of response associate to the entry in the form submit
* @param locale the locale
* @return a Form error object if there is an error in the response
*/
public FormError getResponseData( HttpServletRequest request, List<Response> listResponse, Locale locale )
{
String strValueEntry = request.getParameter( FormUtils.EMPTY_STRING + this.getIdEntry( ) ).trim( );
Response response = new Response( );
response.setEntry( this );
if ( strValueEntry != null )
{
// Checks if the entry value contains XSS characters
if ( StringUtil.containsXssCharacters( strValueEntry ) )
{
FormError formError = new FormError( );
formError.setMandatoryError( false );
formError.setTitleQuestion( this.getTitle( ) );
formError.setErrorMessage( I18nService.getLocalizedString( MESSAGE_XSS_FIELD, request.getLocale( ) ) );
return formError;
}
if ( this.isMandatory( ) )
{
if ( ( strValueEntry == null ) || strValueEntry.equals( FormUtils.EMPTY_STRING ) ) |
File |
Line |
fr/paris/lutece/plugins/form/business/EntryTypeFile.java |
232 |
fr/paris/lutece/plugins/form/business/EntryTypeText.java |
220 |
}
/**
* The paginator who is use in the template modify of the entry
* @param nItemPerPage Number of items to display per page
* @param strBaseUrl The base Url for build links on each page link
* @param strPageIndexParameterName The parameter name for the page index
* @param strPageIndex The current page index
* @return the paginator who is use in the template modify of the entry
*/
public Paginator getPaginator( int nItemPerPage, String strBaseUrl, String strPageIndexParameterName,
String strPageIndex )
{
return new Paginator( this.getFields( ).get( 0 ).getRegularExpressionList( ), nItemPerPage, strBaseUrl,
strPageIndexParameterName, strPageIndex );
}
/**
* return the list of regular expression whose not associate to the entry
* @param entry the entry
* @param plugin the plugin
* @return the list of regular expression whose not associate to the entry
*/
public ReferenceList getReferenceListRegularExpression( IEntry entry, Plugin plugin )
{
ReferenceList refListRegularExpression = null;
if ( RegularExpressionService.getInstance( ).isAvailable( ) )
{
refListRegularExpression = new ReferenceList( );
List<RegularExpression> listRegularExpression = RegularExpressionService.getInstance( )
.getAllRegularExpression( );
for ( RegularExpression regularExpression : listRegularExpression )
{
if ( !entry.getFields( ).get( 0 ).getRegularExpressionList( ).contains( regularExpression ) )
{
refListRegularExpression.addItem( regularExpression.getIdExpression( ),
regularExpression.getTitle( ) );
}
}
}
return refListRegularExpression;
}
/**
* Get the response value associate to the entry to export in the file export
* @param response the response associate to the entry
* @param locale the locale
* @param request the request
* @return the response value associate to the entry to export in the file export
*/
public String getResponseValueForExport( HttpServletRequest request, Response response, Locale locale ) |
File |
Line |
fr/paris/lutece/plugins/form/web/FormJspBean.java |
3142 |
fr/paris/lutece/plugins/form/web/FormJspBean.java |
3366 |
FormUtils.getXmlResponses( request, form, _listFormSubmitTest, locale, plugin );
String strXslUniqueId = XSL_UNIQUE_PREFIX_ID + nIdExportFormat;
String strFileOutPut = xmlTransformerService.transformBySourceWithXslCache( strXmlSource,
exportFormat.getXsl( ), strXslUniqueId, null, null );
byte[] byteFileOutPut = strFileOutPut.getBytes( );
try
{
String strFormatExtension = exportFormat.getExtension( ).trim( );
String strFileName = form.getTitle( ) + "." + strFormatExtension;
FormUtils.addHeaderResponse( request, response, strFileName, strFormatExtension );
response.setContentLength( (int) byteFileOutPut.length );
OutputStream os = response.getOutputStream( );
os.write( byteFileOutPut );
os.close( );
}
catch ( IOException e )
{
AppLogService.error( e );
}
}
else
{
return AdminMessageService.getMessageUrl( request, MESSAGE_NO_RESPONSE, AdminMessage.TYPE_STOP );
}
}
return getJspManageForm( request );
}
/**
* Gets the form result page
* @param request the http request
* @return the form test page
*/
public String getResult( HttpServletRequest request ) |
File |
Line |
fr/paris/lutece/plugins/form/business/EntryDAO.java |
168 |
fr/paris/lutece/plugins/form/business/EntryDAO.java |
326 |
entry.setIdEntry( newPrimaryKey( plugin ) );
daoUtil.setInt( 1, entry.getIdEntry( ) );
daoUtil.setInt( 2, entry.getForm( ).getIdForm( ) );
daoUtil.setInt( 3, entry.getEntryType( ).getIdType( ) );
if ( entry.getParent( ) != null )
{
daoUtil.setInt( 4, entry.getParent( ).getIdEntry( ) );
}
else
{
daoUtil.setIntNull( 4 );
}
daoUtil.setString( 5, entry.getTitle( ) );
daoUtil.setString( 6, entry.getHelpMessage( ) );
daoUtil.setString( 7, entry.getComment( ) );
daoUtil.setBoolean( 8, entry.isMandatory( ) );
daoUtil.setBoolean( 9, entry.isFieldInLine( ) );
daoUtil.setInt( 10, newPosition( plugin ) ); |
File |
Line |
fr/paris/lutece/plugins/form/business/RecapDAO.java |
92 |
fr/paris/lutece/plugins/form/business/RecapDAO.java |
184 |
recap.setIdRecap( newPrimaryKey( 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( ); |
File |
Line |
fr/paris/lutece/plugins/form/business/FieldDAO.java |
163 |
fr/paris/lutece/plugins/form/business/FieldDAO.java |
244 |
if ( daoUtil.next( ) )
{
field = new Field( );
field.setIdField( daoUtil.getInt( 1 ) );
//parent entry
entry = new Entry( );
entry.setIdEntry( daoUtil.getInt( 2 ) );
field.setParentEntry( entry );
field.setTitle( daoUtil.getString( 3 ) );
field.setValue( daoUtil.getString( 4 ) );
field.setHeight( daoUtil.getInt( 5 ) );
field.setWidth( daoUtil.getInt( 6 ) );
field.setDefaultValue( daoUtil.getBoolean( 7 ) );
field.setMaxSizeEnter( daoUtil.getInt( 8 ) );
field.setPosition( daoUtil.getInt( 9 ) );
field.setValueTypeDate( daoUtil.getDate( 10 ) );
field.setNoDisplayTitle( daoUtil.getBoolean( 11 ) ); |
File |
Line |
fr/paris/lutece/plugins/form/business/EntryTypeText.java |
146 |
fr/paris/lutece/plugins/form/business/EntryTypeTextArea.java |
130 |
}
if ( !strFieldError.equals( EMPTY_STRING ) )
{
Object[] tabRequiredFields = { I18nService.getLocalizedString( strFieldError, locale ) };
return AdminMessageService.getMessageUrl( request, MESSAGE_NUMERIC_FIELD, tabRequiredFields,
AdminMessage.TYPE_STOP );
}
this.setTitle( strTitle );
this.setHelpMessage( strHelpMessage );
this.setComment( strComment );
if ( this.getFields( ) == null )
{
ArrayList<Field> listFields = new ArrayList<Field>( );
Field field = new Field( );
listFields.add( field );
this.setFields( listFields );
}
this.getFields( ).get( 0 ).setValue( strValue );
this.getFields( ).get( 0 ).setWidth( nWidth );
this.getFields( ).get( 0 ).setMaxSizeEnter( nMaxSizeEnter ); |
File |
Line |
fr/paris/lutece/plugins/form/web/FormJspBean.java |
2757 |
fr/paris/lutece/plugins/form/web/FormJspBean.java |
2809 |
public String doMoveUpField( HttpServletRequest request )
{
Plugin plugin = getPlugin( );
List<Field> listField;
Field field;
String strIdField = request.getParameter( PARAMETER_ID_FIELD );
int nIdField = -1;
if ( ( request.getParameter( PARAMETER_ID_FIELD ) == null ) ||
!RBACService.isAuthorized( Form.RESOURCE_TYPE, EMPTY_STRING + _nIdForm,
FormResourceIdService.PERMISSION_MODIFY, getUser( ) ) )
{
return getHomeUrl( request );
}
try
{
nIdField = Integer.parseInt( strIdField );
}
catch ( NumberFormatException ne )
{
AppLogService.error( ne );
return getHomeUrl( request );
}
field = FieldHome.findByPrimaryKey( nIdField, plugin );
listField = FieldHome.getFieldListByIdEntry( field.getParentEntry( ).getIdEntry( ), plugin );
int nIndexField = FormUtils.getIndexFieldInTheFieldList( nIdField, listField );
if ( nIndexField != 0 ) |
File |
Line |
fr/paris/lutece/plugins/form/business/EntryTypeFile.java |
113 |
fr/paris/lutece/plugins/form/business/EntryTypeTextArea.java |
121 |
}
try
{
nWidth = Integer.parseInt( strWidth );
}
catch ( NumberFormatException ne )
{
strFieldError = FIELD_WIDTH;
}
if ( !strFieldError.equals( EMPTY_STRING ) )
{
Object[] tabRequiredFields = { I18nService.getLocalizedString( strFieldError, locale ) };
return AdminMessageService.getMessageUrl( request, MESSAGE_NUMERIC_FIELD, tabRequiredFields,
AdminMessage.TYPE_STOP );
}
this.setTitle( strTitle );
this.setHelpMessage( strHelpMessage );
this.setComment( strComment );
if ( this.getFields( ) == null )
{
ArrayList<Field> listFields = new ArrayList<Field>( );
Field field = new Field( );
listFields.add( field );
this.setFields( listFields );
}
this.getFields( ).get( 0 ).setWidth( nWidth ); |
File |
Line |
fr/paris/lutece/plugins/form/web/FormJspBean.java |
3191 |
fr/paris/lutece/plugins/form/web/FormJspBean.java |
3410 |
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 ); |
File |
Line |
fr/paris/lutece/plugins/form/web/FormApp.java |
388 |
fr/paris/lutece/plugins/form/web/FormApp.java |
513 |
private String getRecap( HttpServletRequest request, HttpSession session, int nMode, Plugin plugin )
throws SiteMessageException
{
int nIdForm = -1;
Map<String, Object> model = new HashMap<String, Object>( );
Locale locale = request.getLocale( );
String strIdForm = request.getParameter( PARAMETER_ID_FORM );
//String strPageId = request.getParameter( PARAMETER_PAGE_ID );
if ( ( strIdForm != null ) && !strIdForm.equals( EMPTY_STRING ) )
{
try
{
nIdForm = Integer.parseInt( strIdForm );
}
catch ( NumberFormatException ne )
{
AppLogService.error( ne );
SiteMessageService.setMessage( request, MESSAGE_ERROR, SiteMessage.TYPE_STOP );
}
}
if ( nIdForm == -1 )
{
SiteMessageService.setMessage( request, MESSAGE_ERROR, SiteMessage.TYPE_STOP );
}
Form form = FormHome.findByPrimaryKey( nIdForm, plugin ); |
File |
Line |
fr/paris/lutece/plugins/form/business/EntryTypeText.java |
287 |
fr/paris/lutece/plugins/form/business/EntryTypeTextArea.java |
195 |
List<RegularExpression> listRegularExpression = this.getFields( ).get( 0 ).getRegularExpressionList( );
Response response = new Response( );
response.setEntry( this );
if ( strValueEntry != null )
{
// Checks if the entry value contains XSS characters
if ( StringUtil.containsXssCharacters( strValueEntry ) )
{
FormError formError = new FormError( );
formError.setMandatoryError( false );
formError.setTitleQuestion( this.getTitle( ) );
formError.setErrorMessage( I18nService.getLocalizedString( MESSAGE_XSS_FIELD, request.getLocale( ) ) );
return formError;
}
if ( this.isMandatory( ) )
{
if ( strValueEntry.equals( FormUtils.EMPTY_STRING ) )
{
FormError formError = new FormError( );
formError.setMandatoryError( true );
formError.setTitleQuestion( this.getTitle( ) );
return formError;
}
} |
File |
Line |
fr/paris/lutece/plugins/form/web/FormJspBean.java |
1643 |
fr/paris/lutece/plugins/form/web/FormJspBean.java |
1700 |
public String doRemoveEntry( HttpServletRequest request )
{
Plugin plugin = getPlugin( );
String strIdEntry = request.getParameter( PARAMETER_ID_ENTRY );
IEntry entry;
int nIdEntry = -1;
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, plugin ); |
File |
Line |
fr/paris/lutece/plugins/form/web/FormJspBean.java |
1863 |
fr/paris/lutece/plugins/form/web/FormJspBean.java |
1949 |
fr/paris/lutece/plugins/form/web/FormJspBean.java |
2035 |
public String doMoveUpEntry( HttpServletRequest request )
{
Plugin plugin = getPlugin( );
IEntry entry;
String strIdEntry = request.getParameter( PARAMETER_ID_ENTRY );
int nIdEntry = -1;
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, plugin ); |
File |
Line |
fr/paris/lutece/plugins/form/web/FormJspBean.java |
2861 |
fr/paris/lutece/plugins/form/web/FormJspBean.java |
2896 |
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 + _nIdForm,
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, getPlugin( ) ); |
File |
Line |
fr/paris/lutece/plugins/form/business/ResponseDAO.java |
107 |
fr/paris/lutece/plugins/form/business/ResponseDAO.java |
231 |
response.setIdResponse( newPrimaryKey( plugin ) );
daoUtil.setInt( 1, response.getIdResponse( ) );
daoUtil.setInt( 2, response.getFormSubmit( ).getIdFormSubmit( ) );
daoUtil.setBytes( 3, response.getValueResponse( ) );
daoUtil.setInt( 4, response.getEntry( ).getIdEntry( ) );
if ( response.getField( ) != null )
{
daoUtil.setInt( 5, response.getField( ).getIdField( ) );
}
else
{
daoUtil.setIntNull( 5 );
}
daoUtil.setString( 6, response.getFileName( ) );
daoUtil.setString( 7, response.getFileExtension( ) );
daoUtil.executeUpdate( ); |
File |
Line |
fr/paris/lutece/plugins/form/business/EntryTypeCheckBox.java |
87 |
fr/paris/lutece/plugins/form/business/EntryTypeRadioButton.java |
86 |
fr/paris/lutece/plugins/form/business/EntryTypeSelect.java |
84 |
fr/paris/lutece/plugins/form/business/EntryTypeSelectSQL.java |
90 |
String strFieldError = EMPTY_STRING;
if ( ( strTitle == null ) || strTitle.trim( ).equals( EMPTY_STRING ) )
{
strFieldError = FIELD_TITLE;
}
if ( !strFieldError.equals( EMPTY_STRING ) )
{
Object[] tabRequiredFields = { I18nService.getLocalizedString( strFieldError, locale ) };
return AdminMessageService.getMessageUrl( request, MESSAGE_MANDATORY_FIELD, tabRequiredFields,
AdminMessage.TYPE_STOP );
}
// for don't update fields listFields=null
this.setFields( null );
this.setTitle( strTitle );
this.setHelpMessage( strHelpMessage );
this.setComment( strComment );
if ( strMandatory != null )
{
this.setMandatory( true );
}
else
{
this.setMandatory( false );
} |
File |
Line |
fr/paris/lutece/plugins/form/business/EntryTypeFile.java |
122 |
fr/paris/lutece/plugins/form/business/EntryTypeText.java |
146 |
}
if ( !strFieldError.equals( EMPTY_STRING ) )
{
Object[] tabRequiredFields = { I18nService.getLocalizedString( strFieldError, locale ) };
return AdminMessageService.getMessageUrl( request, MESSAGE_NUMERIC_FIELD, tabRequiredFields,
AdminMessage.TYPE_STOP );
}
this.setTitle( strTitle );
this.setHelpMessage( strHelpMessage );
this.setComment( strComment );
if ( this.getFields( ) == null )
{
ArrayList<Field> listFields = new ArrayList<Field>( );
Field field = new Field( );
listFields.add( field );
this.setFields( listFields );
}
this.getFields( ).get( 0 ).setWidth( nWidth ); |
File |
Line |
fr/paris/lutece/plugins/form/business/EntryDAO.java |
387 |
fr/paris/lutece/plugins/form/business/EntryDAO.java |
519 |
strSQL += ( ( filter.containsFieldDependNull( ) ) ? SQL_FILTER_ID_FIELD_DEPEND_IS_NULL : EMPTY_STRING );
strSQL += SQL_ORDER_BY_POSITION;
DAOUtil daoUtil = new DAOUtil( strSQL, plugin );
int nIndex = 1;
if ( filter.containsIdForm( ) )
{
daoUtil.setInt( nIndex, filter.getIdForm( ) );
nIndex++;
}
if ( filter.containsIdEntryParent( ) )
{
daoUtil.setInt( nIndex, filter.getIdEntryParent( ) );
nIndex++;
}
if ( filter.containsIdIsGroup( ) )
{
if ( filter.getIdIsGroup( ) == 0 )
{
daoUtil.setBoolean( nIndex, false );
}
else
{
daoUtil.setBoolean( nIndex, true );
}
nIndex++;
}
if ( filter.containsIdField( ) ) |
File |
Line |
fr/paris/lutece/plugins/form/business/EntryDAO.java |
91 |
fr/paris/lutece/plugins/form/business/FieldDAO.java |
75 |
private int newPrimaryKey( Plugin plugin )
{
DAOUtil daoUtil = new DAOUtil( SQL_QUERY_NEW_PK, plugin );
daoUtil.executeQuery( );
int nKey;
if ( !daoUtil.next( ) )
{
// if the table is empty
nKey = 1;
}
nKey = daoUtil.getInt( 1 ) + 1;
daoUtil.free( );
return nKey;
}
/**
* Generates a new entry position
* @param plugin the plugin
* @return the new entry position
*/
private int newPosition( Plugin plugin )
{
DAOUtil daoUtil = new DAOUtil( SQL_QUERY_NEW_POSITION, plugin );
daoUtil.executeQuery( );
int nPos;
if ( !daoUtil.next( ) )
{
// if the table is empty
nPos = 1;
}
nPos = daoUtil.getInt( 1 ) + 1;
daoUtil.free( );
return nPos;
} |
File |
Line |
fr/paris/lutece/plugins/form/web/FormJspBean.java |
1427 |
fr/paris/lutece/plugins/form/web/FormJspBean.java |
1762 |
String strIdEntry = request.getParameter( PARAMETER_ID_ENTRY );
int nIdEntry = -1;
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, plugin ); |
File |
Line |
fr/paris/lutece/plugins/form/web/FormJspBean.java |
2178 |
fr/paris/lutece/plugins/form/web/FormJspBean.java |
2245 |
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 )
{ |
File |
Line |
fr/paris/lutece/plugins/form/business/FieldDAO.java |
128 |
fr/paris/lutece/plugins/form/business/FieldDAO.java |
209 |
field.setIdField( newPrimaryKey( plugin ) );
daoUtil.setInt( 1, field.getIdField( ) );
daoUtil.setInt( 2, field.getParentEntry( ).getIdEntry( ) );
daoUtil.setString( 3, field.getTitle( ) );
daoUtil.setString( 4, field.getValue( ) );
daoUtil.setInt( 5, field.getHeight( ) );
daoUtil.setInt( 6, field.getWidth( ) );
daoUtil.setBoolean( 7, field.isDefaultValue( ) );
daoUtil.setInt( 8, field.getMaxSizeEnter( ) );
daoUtil.setInt( 9, newPosition( plugin ) ); |
File |
Line |
fr/paris/lutece/plugins/form/business/EntryTypeRadioButton.java |
177 |
fr/paris/lutece/plugins/form/business/EntryTypeSelect.java |
157 |
fr/paris/lutece/plugins/form/business/EntryTypeSelectSQL.java |
166 |
public FormError getResponseData( HttpServletRequest request, List<Response> listResponse, Locale locale )
{
String strIdField = request.getParameter( FormUtils.EMPTY_STRING + this.getIdEntry( ) );
int nIdField = -1;
Field field = null;
Response response = new Response( );
response.setEntry( this );
if ( strIdField != null )
{
try
{
nIdField = Integer.parseInt( strIdField );
}
catch ( NumberFormatException ne )
{
AppLogService.error( ne );
}
}
if ( nIdField != -1 )
{
field = FormUtils.findFieldByIdInTheList( nIdField, this.getFields( ) ); |
File |
Line |
fr/paris/lutece/plugins/form/business/FormSubmitDAO.java |
214 |
fr/paris/lutece/plugins/form/business/FormSubmitDAO.java |
359 |
null, SQL_ORDER_BY_DATE_RESPONSE_ASC );
DAOUtil daoUtil = new DAOUtil( strSQL, plugin );
int nIndex = 1;
if ( filter.containsIdForm( ) )
{
daoUtil.setInt( nIndex, filter.getIdForm( ) );
nIndex++;
}
if ( filter.containsDateFirst( ) )
{
daoUtil.setTimestamp( nIndex, filter.getDateFirst( ) );
nIndex++;
}
if ( filter.containsDateLast( ) )
{
daoUtil.setTimestamp( nIndex, filter.getDateLast( ) );
nIndex++;
}
daoUtil.executeQuery( );
while ( daoUtil.next( ) )
{ |
File |
Line |
fr/paris/lutece/plugins/form/web/FormJspBean.java |
3109 |
fr/paris/lutece/plugins/form/web/FormJspBean.java |
3321 |
Form form;
ExportFormat exportFormat;
if ( ( strIdForm != null ) && ( strIdExportFormat != null ) && !strIdForm.equals( EMPTY_STRING ) &&
!strIdExportFormat.equals( EMPTY_STRING ) )
{
try
{
nIdForm = Integer.parseInt( strIdForm );
nIdExportFormat = Integer.parseInt( strIdExportFormat );
}
catch ( NumberFormatException ne )
{
AppLogService.error( ne );
return getManageForm( request );
}
}
if ( ( nIdForm == -1 ) || ( nIdExportFormat == -1 ) ||
!RBACService.isAuthorized( Form.RESOURCE_TYPE, strIdForm, FormResourceIdService.PERMISSION_TEST, |
File |
Line |
fr/paris/lutece/plugins/form/web/FormJspBean.java |
1591 |
fr/paris/lutece/plugins/form/web/FormJspBean.java |
1648 |
fr/paris/lutece/plugins/form/web/FormJspBean.java |
1705 |
fr/paris/lutece/plugins/form/web/FormJspBean.java |
1869 |
fr/paris/lutece/plugins/form/web/FormJspBean.java |
1955 |
fr/paris/lutece/plugins/form/web/FormJspBean.java |
2040 |
int nIdEntry = -1;
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, plugin ); |