CPD Results
The following document contains the results of PMD's CPD 6.13.0.
Duplications
File |
Line |
fr/paris/lutece/plugins/newsletter/modules/blog/service/NewsletterBlogService.java |
224 |
fr/paris/lutece/plugins/newsletter/modules/blog/service/NewsletterBlogService.java |
276 |
public String fillTemplateWithDocumentInfos( String strTemplatePath, Collection<Blog> listBlogs, Locale locale, String strBaseUrl, AdminUser user )
{
Collection<Portlet> porletCollec = null;
Map<String, Object> model = new HashMap<String, Object>( );
Collection<Blog> listBlogAuthorized = new ArrayList<Blog>( );
for ( Blog blog : listBlogs )
{
porletCollec = PublishingService.getInstance( ).getPortletsByBlogId( Integer.toString( blog.getId( ) ) );
porletCollec = PortletService.getInstance( ).getAuthorizedPortletCollection( porletCollec, user );
// the document insert in the buffer must be publish in a authorized portlet
if ( porletCollec.size( ) > 0 )
{
String strProdUrl = AppPathService.getProdUrl( strBaseUrl );
model.put( MARK_PROD_URL, strProdUrl );
Blog blg = BlogService.getInstance( ).loadBlog( blog.getId( ) );
listBlogAuthorized.add( blg );
}
}
if ( listBlogAuthorized.size( ) != 0 )
{
model.put( MARK_LIST_BLOG, listBlogAuthorized );
model.put( NewsLetterConstants.MARK_BASE_URL, strBaseUrl ); |
File |
Line |
fr/paris/lutece/plugins/newsletter/modules/blog/business/NewsletterBlogDAO.java |
155 |
fr/paris/lutece/plugins/newsletter/modules/blog/business/NewsletterBlogDAO.java |
214 |
DAOUtil daoUtil = new DAOUtil( SQL_QUERY_SELECT_NEWSLETTER_CATEGORY_IDS, plugin );
daoUtil.setInt( 1, nTopicId );
daoUtil.executeQuery( );
List<Integer> list = new ArrayList<Integer>( );
while ( daoUtil.next( ) )
{
int nResultId = daoUtil.getInt( 1 );
list.add( Integer.valueOf( nResultId ) );
}
int [ ] nIdsArray = new int [ list.size( )];
for ( int i = 0; i < list.size( ); i++ )
{
Integer nId = list.get( i );
nIdsArray [i] = nId.intValue( );
}
daoUtil.free( );
return nIdsArray;
}
/**
* {@inheritDoc}
*/
@Override
public void associateNewsLetterDocumentPortlet( int nTopicId, int nPortletId, Plugin plugin ) |