Fork me on GitHub

CPD Results

The following document contains the results of PMD's CPD 5.5.1.

Duplications

File Line
fr/paris/lutece/plugins/workflow/modules/eudonetrestdirectory/service/BuildJsonBodyService.java 289
fr/paris/lutece/plugins/workflow/modules/eudonetrestdirectory/service/BuildJsonBodyService.java 317
    public String getCreateRecordJsonBody( int nIdTable, List<EudonetRestData> _entries, int nIdRessource, int nIdDirectory )
    {
        JSONObject jsonObjectFinal = new JSONObject( );
        JSONArray jsonArray = new JSONArray( );

        for ( EudonetRestData entry : _entries )
        {
            String strIdTable = entry.getIdTable( ).split( "-" ) [0];

            if ( strIdTable.equals( "" + nIdTable ) )
            {
                String strIdAtt = entry.getIdAttribut( ).split( "-" ) [0];
                JSONObject jsonObject = new JSONObject( );
                jsonObject.accumulate( "DescId", Integer.parseInt( strIdAtt ) );
                if ( entry.getDefaultValue( ) != null && !entry.getDefaultValue( ).isEmpty( ) )
                    jsonObject.accumulate( "Value", entry.getDefaultValue( ) );
                else
                    jsonObject.accumulate( "Value", getRecordFieldValue( entry.getOrderEntry( ), nIdRessource, nIdDirectory ) );

                jsonArray.add( jsonObject );
            }
        }
File Line
fr/paris/lutece/plugins/workflow/modules/eudonetrestdirectory/threadService/AcdpThread.java 191
fr/paris/lutece/plugins/workflow/modules/eudonetrestdirectory/threadService/AcdpThread.java 255
                    String strJsonBody = BuildJsonBodyService.getService( ).getCreateRecordJsonBody( i, _listEuData, _nIdResource, _nIdDirectory );
                    ClientResponse response = _client.createRecord( strToken, "" + i, strJsonBody );
                    if ( response.getStatus( ) == 200 )
                    {
                        String strResponse = response.getEntity( String.class );
                        JSONObject jsonObject = new JSONObject( );
                        jsonObject.accumulate( "object", strResponse );

                        String strStatus = jsonObject.getJSONObject( "object" ).getJSONObject( "ResultInfos" ).getString( "Success" );

                        if ( strStatus.equals( "true" ) )
                        {
                            String strFileId = jsonObject.getJSONObject( "object" ).getJSONObject( "ResultData" ).getString( "FileId" );
                            if ( strFileId != null && !strFileId.isEmpty( ) )
                            {
                                Integer nFileId = Integer.parseInt( strFileId );

                                if ( isAnnexed( i ) )
                                    createAnnexes( strToken, nFileId, i );
File Line
fr/paris/lutece/plugins/workflow/modules/eudonetrestdirectory/threadService/AcdpThread.java 152
fr/paris/lutece/plugins/workflow/modules/eudonetrestdirectory/web/EudonetRestTaskComponent.java 542
            ClientResponse response = _client.getTokenAuthenticate( strAuthenticateJson );

            if ( response.getStatus( ) == 200 )
            {
                String strResponse = response.getEntity( String.class );
                JSONObject jsonObject = new JSONObject( );
                jsonObject.accumulate( "object", strResponse );

                String strStatus = jsonObject.getJSONObject( "object" ).getJSONObject( "ResultInfos" ).getString( "Success" );

                if ( strStatus.equals( "true" ) )
                {
                    return jsonObject.getJSONObject( "object" ).getJSONObject( "ResultData" ).getString( "Token" );
                }
                else
                {
                    String strErrorMessage = jsonObject.getJSONObject( "object" ).getJSONObject( "ResultInfos" ).getString( "ErrorMessage" );
                    AppLogService.error( "Error Eudonet : " + strErrorMessage );
                }

            }
        }
        catch( Exception ex )
        {
            AppLogService.error( "Erreur to generate the token", ex );
File Line
fr/paris/lutece/plugins/workflow/modules/eudonetrestdirectory/threadService/AcdpThread.java 387
fr/paris/lutece/plugins/workflow/modules/eudonetrestdirectory/threadService/AcdpThread.java 421
            String strBody = BuildJsonBodyService.getService( ).getMetaInfosJsonBody( "" + idTable );
            if ( strBody != null )
            {
                ClientResponse response = _client.getAttributListMetaInfos( strToken, strBody );
                if ( response.getStatus( ) == 200 )
                {
                    String strResponse = response.getEntity( String.class );
                    JSONObject jsonObject = new JSONObject( );
                    jsonObject.accumulate( "object", strResponse );
                    String strStatus = jsonObject.getJSONObject( "object" ).getJSONObject( "ResultInfos" ).getString( "Success" );
                    if ( strStatus.equals( "true" ) )
                    {
                        JSONArray jsonArray = jsonObject.getJSONObject( "object" ).getJSONObject( "ResultMetaData" ).getJSONArray( "Tables" ).getJSONObject( 0 )
                                .getJSONArray( "Links" );
File Line
fr/paris/lutece/plugins/workflow/modules/eudonetrestdirectory/service/EudonetRestWsService.java 129
fr/paris/lutece/plugins/workflow/modules/eudonetrestdirectory/web/EudonetRestTaskComponent.java 495
    }

    public String getAuthenticateJsonBody( )
    {
        JSONObject jsonObject = new JSONObject( );
        jsonObject.accumulate( "SubscriberLogin", _config.getSubscriberLogin( ) );
        jsonObject.accumulate( "SubscriberPassword", _config.getSubscriberPassword( ) );
        jsonObject.accumulate( "BaseName", _config.getBaseName( ) );
        jsonObject.accumulate( "UserLogin", _config.getUserLogin( ) );
        jsonObject.accumulate( "UserPassword", _config.getUserPassword( ) );
        jsonObject.accumulate( "UserLang", _config.getUserLang( ) );
        jsonObject.accumulate( "ProductName", _config.getProductName( ) );

        return jsonObject.toString( );
    }
File Line
fr/paris/lutece/plugins/workflow/modules/eudonetrestdirectory/business/EudonetLinkDAO.java 120
fr/paris/lutece/plugins/workflow/modules/eudonetrestdirectory/business/EudonetLinkDAO.java 146
        daoUtil.setInt( 2, nIdTable );
        daoUtil.executeQuery( );

        while ( daoUtil.next( ) )
        {
            EudonetLink eudonetLink = new EudonetLink( );
            eudonetLink.setId( daoUtil.getInt( 1 ) );
            eudonetLink.setIdRessource( daoUtil.getInt( 2 ) );
            eudonetLink.setIdField( daoUtil.getString( 3 ) );
            eudonetLink.setIdTable( daoUtil.getString( 4 ) );
            eudonetLink.setIdTableLink( daoUtil.getString( 5 ) );

            eudonetLinkList.add( eudonetLink );
        }

        daoUtil.free( );

        return eudonetLinkList;
    }

    @Override
    public List<EudonetLink> loadAll( int nIdRessource )