CPD Results
The following document contains the results of PMD's CPD 5.3.5.
Duplications
File |
Line |
fr/paris/lutece/plugins/dila/business/fichelocale/dao/impl/LocalDAO.java |
157 |
fr/paris/lutece/plugins/dila/business/fichelocale/dao/impl/LocalDAO.java |
314 |
DAOUtil daoUtil = new DAOUtil( SQL_QUERY_SELECT_ALL, PluginService.getPlugin( DilaPlugin.PLUGIN_NAME ) );
daoUtil.executeQuery( );
List<LocalDTO> results = new ArrayList<LocalDTO>( );
while ( daoUtil.next( ) )
{
LocalDTO local = new LocalDTO( );
local.setId( daoUtil.getLong( 1 ) );
local.setTitle( daoUtil.getString( 2 ) );
local.setAuthor( daoUtil.getString( 3 ) );
local.setBreadCrumb( daoUtil.getString( 4 ) );
local.setXml( daoUtil.getString( 5 ) );
local.setIdAudience( daoUtil.getLong( 6 ) );
local.setDisplayPath( DilaUtils.convertBreadcrumbIntoDisplay( local.getBreadCrumb( ), local.getIdAudience( ) ) );
DilaLocalTypeEnum typeEnum = DilaLocalTypeEnum.fromId( daoUtil.getLong( 7 ) );
LocalTypeDTO type = new LocalTypeDTO( );
type.setId( typeEnum.getId( ) );
type.setLabel( typeEnum.getLabel( ) );
local.setType( type );
local.setCreationDate( daoUtil.getDate( 8 ) );
results.add( local );
}
daoUtil.free( );
return results;
} |
File |
Line |
fr/paris/lutece/plugins/dila/service/search/DilaLocalIndexer.java |
89 |
fr/paris/lutece/plugins/dila/service/search/DilaXMLIndexer.java |
88 |
String strMessage = "Page ID : " + local.getId( );
IndexationService.error( this, e, strMessage );
}
if ( doc != null )
{
IndexationService.write( doc );
}
}
}
@Override
public List<Document> getDocuments( String strIdDocument )
throws IOException, InterruptedException, SiteMessageException
{
return null;
}
@Override
public String getName( )
{
return INDEXER_NAME;
}
@Override
public String getVersion( )
{
return INDEXER_VERSION;
}
@Override
public String getDescription( )
{
return INDEXER_DESCRIPTION;
}
@Override
public boolean isEnable( )
{
String strEnable = AppPropertiesService.getProperty( PROPERTY_INDEXER_ENABLE, "true" );
return ( strEnable.equalsIgnoreCase( "true" ) );
}
@Override
public List<String> getListType( )
{
List<String> listType = new ArrayList<String>( );
listType.add( PageIndexer.INDEX_TYPE_PAGE );
return listType;
}
@Override
public String getSpecificSearchAppUrl( )
{
return AppPropertiesService.getProperty( PROPERTY_SEARCH_PAGE_URL );
}
/**
* Builds a document which will be used by Lucene during the indexing of the
* pages of the site with the following
* fields : summary, uid, url, contents, title and description.
* @return the built Document
* @param local the xml to index
* @throws IOException The IO Exception
* @throws InterruptedException The InterruptedException
* @throws SiteMessageException occurs when a site message need to be
* displayed
*/
protected Document getDocument( LocalDTO local ) throws IOException, InterruptedException, SiteMessageException |
File |
Line |
fr/paris/lutece/plugins/dila/web/LocalCardJspBean.java |
588 |
fr/paris/lutece/plugins/dila/web/LocalCardJspBean.java |
638 |
public String doCreateLocalCard( HttpServletRequest request )
{
populate( _cardBean, request );
List<LocalCardChapterDTO> chapters = generateChapters( null, request );
String errorKey = _dilaValidationService.validateLocalCard( _cardBean, chapters );
if ( StringUtils.isNotBlank( errorKey ) )
{
return AdminMessageService.getMessageUrl( request, errorKey, AdminMessage.TYPE_STOP );
}
// Create the local card
if ( StringUtils.isNumeric( _cardBean.getParentFolderId( ) ) )
{
_cardBean.getLocalDTO( ).setBreadCrumb(
_cardBean.getLocalParentFolder( ).getLocalDTO( ).getBreadCrumb( ) + ";"
+ _cardBean.getLocalParentFolder( ).getLocalDTO( ).getId( ) );
}
else
{
_cardBean.getLocalDTO( ).setBreadCrumb(
_cardBean.getNationalParentFolder( ).getBreadCrumb( ) + ";"
+ _cardBean.getNationalParentFolder( ).getIdXml( ) );
}
_cardBean.getLocalDTO( ).setXml( XMLConvertor.convertCardToXML( _cardBean, chapters ) ); |
File |
Line |
fr/paris/lutece/plugins/dila/service/impl/DilaDownloadService.java |
111 |
fr/paris/lutece/plugins/dila/service/impl/DilaXmlService.java |
222 |
String proxyHost = AppPropertiesService.getProperty( HTTP_ACCESS_PROXY_HOST );
// Connection through proxy
if ( StringUtils.isNotBlank( proxyHost ) )
{
String proxyPort = AppPropertiesService.getProperty( HTTP_ACCESS_PROXY_PORT );
String proxyUser = AppPropertiesService.getProperty( HTTP_ACCESS_PROXY_USERNAME );
String proxyPassword = AppPropertiesService.getProperty( HTTP_ACCESS_PROXY_PASSWORD );
//Proxy authentication
if ( StringUtils.isNotBlank( proxyUser ) )
{
CredentialsProvider credsProvider = new BasicCredentialsProvider( );
credsProvider.setCredentials( new AuthScope( proxyHost, Integer.parseInt( proxyPort ) ),
new UsernamePasswordCredentials( proxyUser, proxyPassword ) );
clientBuilder.setDefaultCredentialsProvider( credsProvider );
}
String strSchema = request.getURI( ).getScheme( );
HttpHost proxy = new HttpHost( proxyHost, Integer.parseInt( proxyPort ), strSchema );
RequestConfig config = RequestConfig.custom( ).setProxy( proxy ).build( );
request.setConfig( config );
} |
File |
Line |
fr/paris/lutece/plugins/dila/web/ComplementaryDataJspBean.java |
150 |
fr/paris/lutece/plugins/dila/web/StyleSheetJspBean.java |
150 |
Collections.sort( listToDisplay, new AttributeComparator( strSortedAttributeName, bIsAscSort ) );
}
_nDefaultItemsPerPage = AppPropertiesService.getPropertyInt( DilaConstants.PROPERTY_STYLESHEETS_PER_PAGE, 50 );
_strCurrentPageIndex = Paginator.getPageIndex( request, Paginator.PARAMETER_PAGE_INDEX, _strCurrentPageIndex );
_nItemsPerPage = Paginator.getItemsPerPage( request, Paginator.PARAMETER_ITEMS_PER_PAGE, _nItemsPerPage,
_nDefaultItemsPerPage );
String strURL = getHomeUrl( request );
if ( strSortedAttributeName != null )
{
strURL += ( "?" + Parameters.SORTED_ATTRIBUTE_NAME + "=" + strSortedAttributeName );
}
if ( strAscSort != null )
{
strURL += ( "&" + Parameters.SORTED_ASC + "=" + strAscSort );
}
LocalizedPaginator<ComplementaryDataDTO> paginator = new LocalizedPaginator<ComplementaryDataDTO>( |
File |
Line |
fr/paris/lutece/plugins/dila/business/fichelocale/dao/impl/XmlDAO.java |
144 |
fr/paris/lutece/plugins/dila/business/fichelocale/dao/impl/XmlDAO.java |
189 |
StringBuilder sbSQL = new StringBuilder( SQL_QUERY_FIND_TITLE_BY_ID_AND_TYPES_AND_AUDIENCE );
sbSQL.append( " " );
sbSQL.append( SQL_QUERY_AND_RESOURCE_TYPE );
sbSQL.append( "(" );
int count = 0;
for ( String type : availableTypes )
{
count++;
if ( count < availableTypes.size( ) )
{
sbSQL.append( "'" + type + "'," );
}
else
{
sbSQL.append( "'" + type + "'" );
}
}
sbSQL.append( ")" );
DAOUtil daoUtil = new DAOUtil( sbSQL.toString( ), PluginService.getPlugin( DilaPlugin.PLUGIN_NAME ) );
daoUtil.setString( 1, idDossierFrere ); |