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/htmldocs/business/HtmlDocDAO.java 194
fr/paris/lutece/plugins/htmldocs/business/HtmlDocDAO.java 230
        daoUtil.setInt( 1, nKey );
        daoUtil.executeQuery( );
        HtmlDoc htmlDoc = null;

        if ( daoUtil.next( ) )
        {
            htmlDoc = new HtmlDoc( );
            int nIndex = 1;

            htmlDoc.setId( daoUtil.getInt( nIndex++ ) );
            htmlDoc.setVersion( daoUtil.getInt( nIndex++ ) );
            htmlDoc.setContentLabel( daoUtil.getString( nIndex++ ) );
            htmlDoc.setCreationDate( daoUtil.getTimestamp( nIndex++ ) );
            htmlDoc.setUpdateDate( daoUtil.getTimestamp( nIndex++ ) );
            htmlDoc.setHtmlContent( daoUtil.getString( nIndex++ ) );
            htmlDoc.setUser( daoUtil.getString( nIndex++ ) );
            htmlDoc.setUserCreator( daoUtil.getString( nIndex++ ) );
            htmlDoc.setAttachedPortletId( daoUtil.getInt( nIndex++ ) );
            htmlDoc.setEditComment( daoUtil.getString( nIndex++ ) );
            htmlDoc.setDescription( daoUtil.getString( nIndex++ ) );
            htmlDoc.setShareable( daoUtil.getBoolean( nIndex++ ) );


        }

        daoUtil.free( );
        return htmlDoc;
    }

    /**
     * {@inheritDoc }
     */
    @Override
    public HtmlDoc loadByName( String strName, Plugin plugin )
File Line
fr/paris/lutece/plugins/htmldocs/business/HtmlDocDAO.java 194
fr/paris/lutece/plugins/htmldocs/business/HtmlDocDAO.java 230
fr/paris/lutece/plugins/htmldocs/business/HtmlDocDAO.java 267
        daoUtil.setInt( 1, nKey );
        daoUtil.executeQuery( );
        HtmlDoc htmlDoc = null;

        if ( daoUtil.next( ) )
        {
            htmlDoc = new HtmlDoc( );
            int nIndex = 1;

            htmlDoc.setId( daoUtil.getInt( nIndex++ ) );
            htmlDoc.setVersion( daoUtil.getInt( nIndex++ ) );
            htmlDoc.setContentLabel( daoUtil.getString( nIndex++ ) );
            htmlDoc.setCreationDate( daoUtil.getTimestamp( nIndex++ ) );
            htmlDoc.setUpdateDate( daoUtil.getTimestamp( nIndex++ ) );
            htmlDoc.setHtmlContent( daoUtil.getString( nIndex++ ) );
            htmlDoc.setUser( daoUtil.getString( nIndex++ ) );
            htmlDoc.setUserCreator( daoUtil.getString( nIndex++ ) );
            htmlDoc.setAttachedPortletId( daoUtil.getInt( nIndex++ ) );
            htmlDoc.setEditComment( daoUtil.getString( nIndex++ ) );
            htmlDoc.setDescription( daoUtil.getString( nIndex++ ) );
            htmlDoc.setShareable( daoUtil.getBoolean( nIndex++ ) );


        }

        daoUtil.free( );
        return htmlDoc;
    }

    /**
     * {@inheritDoc }
     */
    @Override
    public HtmlDoc loadByName( String strName, Plugin plugin )
File Line
fr/paris/lutece/plugins/htmldocs/business/HtmlDocDAO.java 355
fr/paris/lutece/plugins/htmldocs/business/HtmlDocDAO.java 392
fr/paris/lutece/plugins/htmldocs/business/HtmlDocDAO.java 469
        DAOUtil daoUtil = new DAOUtil( SQL_QUERY_SELECTALL, plugin );
        daoUtil.executeQuery( );

        while ( daoUtil.next( ) )
        {
            HtmlDoc htmlDoc = new HtmlDoc( );
            int nIndex = 1;

            htmlDoc.setId( daoUtil.getInt( nIndex++ ) );
            htmlDoc.setVersion( daoUtil.getInt( nIndex++ ) );
            htmlDoc.setContentLabel( daoUtil.getString( nIndex++ ) );
            htmlDoc.setCreationDate( daoUtil.getTimestamp( nIndex++ ) );
            htmlDoc.setUpdateDate( daoUtil.getTimestamp( nIndex++ ) );
            htmlDoc.setHtmlContent( daoUtil.getString( nIndex++ ) );
            htmlDoc.setUser( daoUtil.getString( nIndex++ ) );
            htmlDoc.setUserCreator( daoUtil.getString( nIndex++ ) );
            htmlDoc.setAttachedPortletId( daoUtil.getInt( nIndex++ ) );
            htmlDoc.setEditComment( daoUtil.getString( nIndex++ ) );
            htmlDoc.setDescription( daoUtil.getString( nIndex++ ) );
            htmlDoc.setShareable( daoUtil.getBoolean( nIndex++ ) );
File Line
fr/paris/lutece/plugins/htmldocs/business/HtmlDocDAO.java 144
fr/paris/lutece/plugins/htmldocs/business/HtmlDocDAO.java 169
        daoUtil.setInt( nIndex++, htmlDoc.getId( ) );
        daoUtil.setInt( nIndex++, htmlDoc.getVersion( ) );
        daoUtil.setString( nIndex++, htmlDoc.getContentLabel( ) );
        daoUtil.setTimestamp( nIndex++, htmlDoc.getCreationDate( ) );
        daoUtil.setTimestamp( nIndex++, htmlDoc.getUpdateDate( ) );
        daoUtil.setString( nIndex++, htmlDoc.getHtmlContent( ) );
        daoUtil.setString( nIndex++, htmlDoc.getUser( ) );
        daoUtil.setString( nIndex++, htmlDoc.getUserCreator( ) );
        daoUtil.setInt( nIndex++, htmlDoc.getAttachedPortletId( ) );
        daoUtil.setString( nIndex++, htmlDoc.getEditComment( ) );
        daoUtil.setString( nIndex++, htmlDoc.getDescription( ) );
        daoUtil.setBoolean(nIndex++, htmlDoc.getShareable( ));

        
        daoUtil.executeUpdate( );
        daoUtil.free( );
    }
File Line
fr/paris/lutece/plugins/htmldocs/business/HtmlDocDAO.java 141
fr/paris/lutece/plugins/htmldocs/business/HtmlDocDAO.java 326
        htmlDoc.setId( newPrimaryKey( plugin ) );
        int nIndex = 1;

        daoUtil.setInt( nIndex++, htmlDoc.getId( ) );
        daoUtil.setInt( nIndex++, htmlDoc.getVersion( ) );
        daoUtil.setString( nIndex++, htmlDoc.getContentLabel( ) );
        daoUtil.setTimestamp( nIndex++, htmlDoc.getCreationDate( ) );
        daoUtil.setTimestamp( nIndex++, htmlDoc.getUpdateDate( ) );
        daoUtil.setString( nIndex++, htmlDoc.getHtmlContent( ) );
        daoUtil.setString( nIndex++, htmlDoc.getUser( ) );
        daoUtil.setString( nIndex++, htmlDoc.getUserCreator( ) );
        daoUtil.setInt( nIndex++, htmlDoc.getAttachedPortletId( ) );
        daoUtil.setString( nIndex++, htmlDoc.getEditComment( ) );
        daoUtil.setString( nIndex++, htmlDoc.getDescription( ) );
        daoUtil.setBoolean(nIndex++, htmlDoc.getShareable( ));

        
        daoUtil.executeUpdate( );
File Line
fr/paris/lutece/plugins/htmldocs/business/HtmlDocDAO.java 169
fr/paris/lutece/plugins/htmldocs/business/HtmlDocDAO.java 329
        daoUtil.setInt( nIndex++, htmlDoc.getId( ) );
        daoUtil.setInt( nIndex++, htmlDoc.getVersion( ) );
        daoUtil.setString( nIndex++, htmlDoc.getContentLabel( ) );
        daoUtil.setTimestamp( nIndex++, htmlDoc.getCreationDate( ) );
        daoUtil.setTimestamp( nIndex++, htmlDoc.getUpdateDate( ) );
        daoUtil.setString( nIndex++, htmlDoc.getHtmlContent( ) );
        daoUtil.setString( nIndex++, htmlDoc.getUser( ) );
        daoUtil.setString( nIndex++, htmlDoc.getUserCreator( ) );
        daoUtil.setInt( nIndex++, htmlDoc.getAttachedPortletId( ) );
        daoUtil.setString( nIndex++, htmlDoc.getEditComment( ) );
        daoUtil.setString( nIndex++, htmlDoc.getDescription( ) );
        daoUtil.setBoolean(nIndex++, htmlDoc.getShareable( ));


        daoUtil.executeUpdate( );
File Line
fr/paris/lutece/plugins/htmldocs/business/HtmlDocDAO.java 200
fr/paris/lutece/plugins/htmldocs/business/HtmlDocDAO.java 236
fr/paris/lutece/plugins/htmldocs/business/HtmlDocDAO.java 273
fr/paris/lutece/plugins/htmldocs/business/HtmlDocDAO.java 360
fr/paris/lutece/plugins/htmldocs/business/HtmlDocDAO.java 397
fr/paris/lutece/plugins/htmldocs/business/HtmlDocDAO.java 474
            htmlDoc = new HtmlDoc( );
            int nIndex = 1;

            htmlDoc.setId( daoUtil.getInt( nIndex++ ) );
            htmlDoc.setVersion( daoUtil.getInt( nIndex++ ) );
            htmlDoc.setContentLabel( daoUtil.getString( nIndex++ ) );
            htmlDoc.setCreationDate( daoUtil.getTimestamp( nIndex++ ) );
            htmlDoc.setUpdateDate( daoUtil.getTimestamp( nIndex++ ) );
            htmlDoc.setHtmlContent( daoUtil.getString( nIndex++ ) );
            htmlDoc.setUser( daoUtil.getString( nIndex++ ) );
            htmlDoc.setUserCreator( daoUtil.getString( nIndex++ ) );
            htmlDoc.setAttachedPortletId( daoUtil.getInt( nIndex++ ) );
            htmlDoc.setEditComment( daoUtil.getString( nIndex++ ) );
            htmlDoc.setDescription( daoUtil.getString( nIndex++ ) );
            htmlDoc.setShareable( daoUtil.getBoolean( nIndex++ ) );
File Line
fr/paris/lutece/plugins/htmldocs/business/portlet/HtmldocsListPortletDAO.java 273
fr/paris/lutece/plugins/htmldocs/business/portlet/HtmldocsPortletDAO.java 176
    public ReferenceList selectHtmlDocListPortletReferenceList( Plugin plugin )
    {
        ReferenceList htmlDocPortletList = new ReferenceList( );
        DAOUtil daoUtil = new DAOUtil( SQL_QUERY_SELECTALL, plugin );
        daoUtil.executeQuery( );

        while ( daoUtil.next( ) )
        {
        	htmlDocPortletList.addItem( daoUtil.getInt( 1 ), daoUtil.getString( 2 ) );
        }

        daoUtil.free( );
        return htmlDocPortletList;
    }
    /**
     * {@inheritDoc }
     */
    @Override
    
    public Collection<ReferenceItem> selectPortletByType( int nDocumentId, PortletOrder pOrder, PortletFilter pFilter )
    {
        StringBuilder strSQl = new StringBuilder(  );
        strSQl.append( SQL_QUERY_SELECT_PORTLET_BY_TYPE );

        String strFilter = ( pFilter != null ) ? pFilter.getSQLFilter(  ) : null;

        if ( strFilter != null )
        {
            strSQl.append( "AND" );
            strSQl.append( strFilter );
        }

        strSQl.append( pOrder.getSQLOrderBy(  ) );

        DAOUtil daoUtil = new DAOUtil( strSQl.toString(  ) );
File Line
fr/paris/lutece/plugins/htmldocs/business/portlet/HtmlDocPublicationDAO.java 129
fr/paris/lutece/plugins/htmldocs/business/portlet/HtmlDocPublicationDAO.java 160
fr/paris/lutece/plugins/htmldocs/business/portlet/HtmlDocPublicationDAO.java 223
        daoUtil.setInt( 1, nDocId );
        daoUtil.executeQuery(  );

        List<HtmlDocPublication> nListIdCategory = new ArrayList<HtmlDocPublication>(  );

        while ( daoUtil.next(  ) )
        {
        	
        	HtmlDocPublication htmldocPub= new HtmlDocPublication();
        	htmldocPub.setIdPortlet(daoUtil.getInt( 1 ));
        	htmldocPub.setIdDocument(daoUtil.getInt( 2 ));
        	htmldocPub.setDateBeginPublishing(daoUtil.getDate( 3 ));
        	htmldocPub.setDateEndPublishing(daoUtil.getDate( 4 ));
        	htmldocPub.setStatus(daoUtil.getInt( 5 ));
        	htmldocPub.setDocumentOrder(daoUtil.getInt( 6 ));
        	
        	nListIdCategory.add( htmldocPub );
        }

        daoUtil.free(  );

        return nListIdCategory;
    }
    
    /**
     * {@inheritDoc }
     */
    @Override
    public List<HtmlDocPublication> loadHtmlsDocsByPortlet( int nIdPortlet, Plugin plugin  )