CPD Results
The following document contains the results of PMD's CPD 6.13.0.
Duplications
File |
Line |
fr/paris/lutece/plugins/document/business/portlet/DocumentListPortletDAO.java |
262 |
fr/paris/lutece/plugins/document/business/portlet/DocumentPortletDAO.java |
256 |
public Collection<ReferenceItem> selectByDocumentIdAndDocumentType( int nDocumentId, String strCodeDocumentType, PortletOrder pOrder,
PortletFilter pFilter )
{
StringBuilder strSQl = new StringBuilder( );
strSQl.append( SQL_QUERY_SELECT_DOCUMENTS_BY_TYPE_AND_CATEGORY );
String strFilter = ( pFilter != null ) ? pFilter.getSQLFilter( ) : null;
if ( strFilter != null )
{
strSQl.append( SQL_QUERY_CASE_AND );
strSQl.append( strFilter );
}
strSQl.append( pOrder.getSQLOrderBy( ) );
ReferenceList list = new ReferenceList( );
try ( DAOUtil daoUtil = new DAOUtil( strSQl.toString( ) ) )
{
daoUtil.setInt( 1, nDocumentId );
daoUtil.setString( 2, strCodeDocumentType );
daoUtil.setInt( 3, nDocumentId );
if ( strFilter != null )
{
if ( pFilter.getPortletFilterType( ).equals( PortletFilter.PAGE_NAME ) )
{
for ( int i = 0; i < pFilter.getPageName( ).length; i++ )
{
daoUtil.setString( i + 4, "%" + pFilter.getPageName( )[i] + "%" );
}
}
else
if ( pFilter.getPortletFilterType( ).equals( PortletFilter.PORTLET_NAME ) )
{
for ( int i = 0; i < pFilter.getPortletName( ).length; i++ )
{
daoUtil.setString( i + 4, "%" + pFilter.getPortletName( )[i] + "%" );
}
}
else
if ( pFilter.getPortletFilterType( ).equals( PortletFilter.PAGE_ID ) )
{
daoUtil.setInt( 4, pFilter.getIdPage( ) );
}
}
daoUtil.executeQuery( );
while ( daoUtil.next( ) )
{
list.addItem( daoUtil.getInt( 1 ), daoUtil.getString( 2 ) );
}
}
return list;
}
/**
* Tests if is a portlet is portlet type alias
*
* @param nPortletId
* The identifier of the document
* @return true if the portlet is alias, false otherwise
*/
public boolean checkIsAliasPortlet( int nPortletId )
{
boolean bIsAlias = false;
try ( DAOUtil daoUtil = new DAOUtil( SQL_QUERY_CHECK_IS_ALIAS ) )
{
daoUtil.setInt( 1, nPortletId );
daoUtil.executeQuery( );
if ( daoUtil.next( ) )
{
bIsAlias = true;
}
}
return bIsAlias;
} |
File |
Line |
fr/paris/lutece/plugins/document/business/DocumentDAO.java |
1213 |
fr/paris/lutece/plugins/document/business/DocumentDAO.java |
1256 |
daoUtil.executeQuery( );
if ( daoUtil.next( ) )
{
int nIndex = 1;
document = new Document( );
document.setId( daoUtil.getInt( nIndex++ ) );
document.setCodeDocumentType( daoUtil.getString( nIndex++ ) );
document.setTitle( daoUtil.getString( nIndex++ ) );
document.setDateCreation( daoUtil.getTimestamp( nIndex++ ) );
document.setDateModification( daoUtil.getTimestamp( nIndex++ ) );
document.setXmlWorkingContent( daoUtil.getString( nIndex++ ) );
document.setXmlValidatedContent( daoUtil.getString( nIndex++ ) );
document.setSpaceId( daoUtil.getInt( nIndex++ ) );
document.setSpace( daoUtil.getString( nIndex++ ) );
document.setStateId( daoUtil.getInt( nIndex++ ) );
document.setStateKey( daoUtil.getString( nIndex++ ) );
document.setType( daoUtil.getString( nIndex++ ) );
document.setSummary( daoUtil.getString( nIndex++ ) );
document.setComment( daoUtil.getString( nIndex++ ) );
document.setDateValidityBegin( daoUtil.getTimestamp( nIndex++ ) );
document.setDateValidityEnd( daoUtil.getTimestamp( nIndex++ ) );
document.setXmlMetadata( daoUtil.getString( nIndex++ ) );
document.setCreatorId( daoUtil.getInt( nIndex++ ) );
document.setMailingListId( daoUtil.getInt( nIndex++ ) );
document.setPageTemplateDocumentId( daoUtil.getInt( nIndex++ ) );
document.setSkipPortlet( daoUtil.getBoolean( nIndex++ ) );
document.setSkipCategories( daoUtil.getBoolean( nIndex++ ) );
}
}
return document;
} |
File |
Line |
fr/paris/lutece/plugins/document/business/DocumentDAO.java |
674 |
fr/paris/lutece/plugins/document/business/DocumentDAO.java |
1036 |
try ( DAOUtil daoUtil = getDaoFromFilter( SQL_QUERY_SELECT_BY_FILTER, filter ) )
{
daoUtil.executeQuery( );
while ( daoUtil.next( ) )
{
Document document = new Document( );
document.setId( daoUtil.getInt( 1 ) );
document.setCodeDocumentType( daoUtil.getString( 2 ) );
document.setTitle( daoUtil.getString( 3 ) );
document.setDateCreation( daoUtil.getTimestamp( 4 ) );
document.setDateModification( daoUtil.getTimestamp( 5 ) );
document.setXmlWorkingContent( daoUtil.getString( 6 ) );
document.setXmlValidatedContent( daoUtil.getString( 7 ) );
document.setSpaceId( daoUtil.getInt( 8 ) );
document.setSpace( daoUtil.getString( 9 ) );
document.setStateId( daoUtil.getInt( 10 ) );
document.setStateKey( daoUtil.getString( 11 ) );
document.setType( daoUtil.getString( 12 ) );
document.setSummary( daoUtil.getString( 13 ) );
document.setComment( daoUtil.getString( 14 ) );
document.setDateValidityBegin( daoUtil.getTimestamp( 15 ) );
document.setDateValidityEnd( daoUtil.getTimestamp( 16 ) );
document.setXmlMetadata( daoUtil.getString( 17 ) );
document.setCreatorId( daoUtil.getInt( 18 ) );
document.setMailingListId( daoUtil.getInt( 19 ) );
document.setPageTemplateDocumentId( daoUtil.getInt( 20 ) );
document.setSkipPortlet( daoUtil.getBoolean( 21 ) );
document.setSkipCategories( daoUtil.getBoolean( 22 ) ); |
File |
Line |
fr/paris/lutece/plugins/document/business/DocumentDAO.java |
308 |
fr/paris/lutece/plugins/document/business/DocumentDAO.java |
680 |
fr/paris/lutece/plugins/document/business/DocumentDAO.java |
1042 |
document = new Document( );
document.setId( daoUtil.getInt( 1 ) );
document.setCodeDocumentType( daoUtil.getString( 2 ) );
document.setTitle( daoUtil.getString( 3 ) );
document.setDateCreation( daoUtil.getTimestamp( 4 ) );
document.setDateModification( daoUtil.getTimestamp( 5 ) );
document.setXmlWorkingContent( daoUtil.getString( 6 ) );
document.setXmlValidatedContent( daoUtil.getString( 7 ) );
document.setSpaceId( daoUtil.getInt( 8 ) );
document.setSpace( daoUtil.getString( 9 ) );
document.setStateId( daoUtil.getInt( 10 ) );
document.setStateKey( daoUtil.getString( 11 ) );
document.setType( daoUtil.getString( 12 ) );
document.setSummary( daoUtil.getString( 13 ) );
document.setComment( daoUtil.getString( 14 ) );
document.setDateValidityBegin( daoUtil.getTimestamp( 15 ) );
document.setDateValidityEnd( daoUtil.getTimestamp( 16 ) );
document.setXmlMetadata( daoUtil.getString( 17 ) );
document.setCreatorId( daoUtil.getInt( 18 ) );
document.setMailingListId( daoUtil.getInt( 19 ) );
document.setPageTemplateDocumentId( daoUtil.getInt( 20 ) );
document.setSkipPortlet( daoUtil.getBoolean( 21 ) );
document.setSkipCategories( daoUtil.getBoolean( 22 ) ); |
File |
Line |
fr/paris/lutece/plugins/document/web/portlet/DocumentListPortletJspBean.java |
191 |
fr/paris/lutece/plugins/document/web/portlet/DocumentPortletJspBean.java |
192 |
DocumentListPortlet portlet = (DocumentListPortlet) DocumentListPortletHome.findByPrimaryKey( nPortletId );
int[] arrayOldIdCategories = portlet.getIdCategory( );
if ( arrayIdCategories != null )
{
Arrays.sort( arrayIdCategories );
}
if ( arrayOldIdCategories != null )
{
Arrays.sort( arrayOldIdCategories );
}
if ( ( !Arrays.equals( arrayIdCategories, arrayOldIdCategories ) ||
!portlet.getDocumentTypeCode( ).equals( strDocumentTypeCode ) ) &&
( PublishingService.getInstance( ).getAssignedDocumentsByPortletId( nPortletId ).size( ) != 0 ) )
{
return AdminMessageService.getMessageUrl( request, MESSAGE_ERROR_DOCUMENTS_MUST_BE_UNASSIGNED,
AdminMessage.TYPE_STOP );
}
// retrieve portlet common attributes
String strErrorUrl = setPortletCommonData( request, portlet );
if ( strErrorUrl != null )
{
return strErrorUrl;
}
portlet.setDocumentTypeCode( strDocumentTypeCode );
//Categories
portlet.setIdCategory( arrayIdCategories );
// updates the portlet
portlet.update( );
// displays the page withe the potlet updated
return getPageUrl( portlet.getPageId( ) );
}
/**
* Set the array of id categories
* @param request The http servlet request
* @return The array of id categories
*/
private int[] setIdCategory( HttpServletRequest request )
{
String[] strArrayIdCategory = request.getParameterValues( PARAMETER_CATEGORY );
if ( strArrayIdCategory != null )
{
int[] nArrayIdCategory = new int[strArrayIdCategory.length];
int i = 0;
for ( String strIdCategory : strArrayIdCategory )
{
nArrayIdCategory[i++] = IntegerUtils.convert( strIdCategory );
}
return nArrayIdCategory;
}
return new int[0];
}
/**
* Returns an html template containing the list of the portlet types
* @param strPortletId The Portet Identifier
* @return The html code
*/
private String getDocumentTypesList( String strPortletId )
{
String strCodeTypeDocument = StringUtils.EMPTY;
if ( IntegerUtils.isNumeric( strPortletId ) )
{ |
File |
Line |
fr/paris/lutece/plugins/document/business/DocumentDAO.java |
185 |
fr/paris/lutece/plugins/document/business/DocumentDAO.java |
606 |
try ( DAOUtil daoUtil = new DAOUtil( SQL_QUERY_INSERT ) )
{
daoUtil.setInt( 1, document.getId( ) );
daoUtil.setString( 2, document.getCodeDocumentType( ) );
daoUtil.setString( 3, document.getTitle( ) );
daoUtil.setTimestamp( 4, document.getDateCreation( ) );
daoUtil.setTimestamp( 5, document.getDateModification( ) );
daoUtil.setString( 6, document.getXmlWorkingContent( ) );
daoUtil.setString( 7, document.getXmlValidatedContent( ) );
daoUtil.setInt( 8, document.getSpaceId( ) );
daoUtil.setInt( 9, document.getStateId( ) );
daoUtil.setString( 10, document.getSummary( ) );
daoUtil.setString( 11, document.getComment( ) );
daoUtil.setTimestamp( 12, document.getDateValidityBegin( ) );
daoUtil.setTimestamp( 13, document.getDateValidityEnd( ) );
daoUtil.setString( 14, document.getXmlMetadata( ) );
daoUtil.setInt( 15, document.getCreatorId( ) );
daoUtil.setInt( 16, document.getMailingListId( ) );
daoUtil.setInt( 17, document.getPageTemplateDocumentId( ) );
daoUtil.setBoolean( 18, document.isSkipPortlet( ) );
daoUtil.setBoolean( 19, document.isSkipCategories( ) );
daoUtil.executeUpdate( ); |
File |
Line |
fr/paris/lutece/plugins/document/business/portlet/DocumentListPortletDAO.java |
100 |
fr/paris/lutece/plugins/document/business/portlet/DocumentPortletDAO.java |
99 |
DocumentListPortlet p = (DocumentListPortlet) portlet;
if ( p.getIdCategory( ) != null )
{
try ( DAOUtil daoUtil = new DAOUtil( SQL_QUERY_INSERT_CATEGORY_PORTLET ) )
{
for ( int nIdCategory : p.getIdCategory( ) )
{
daoUtil.setInt( 1, p.getId( ) );
daoUtil.setInt( 2, nIdCategory );
daoUtil.executeUpdate( );
}
}
}
}
/**
* Deletes records for a portlet identifier in the tables document_list_portlet, document_published, document_category_list_portlet
*
* @param nPortletId
* the portlet identifier
*/
public void delete( int nPortletId )
{
try( DAOUtil daoUtil = new DAOUtil( SQL_QUERY_DELETE ) )
{
daoUtil.setInt( 1, nPortletId );
daoUtil.executeUpdate( );
}
try ( DAOUtil daoUtil = new DAOUtil( SQL_QUERY_DELETE_PUBLISHED_DOCUMENT_PORTLET ) )
{
daoUtil.setInt( 1, nPortletId );
daoUtil.executeUpdate( );
}
deleteCategories( nPortletId );
deleteAutoPublication( nPortletId );
}
/**
* Delete categories for the specified portlet
*
* @param nPortletId
* The portlet identifier
*/
private void deleteCategories( int nPortletId )
{
try ( DAOUtil daoUtil = new DAOUtil( SQL_QUERY_DELETE_CATEGORY_PORTLET ) )
{
daoUtil.setInt( 1, nPortletId );
daoUtil.executeUpdate( );
}
}
/**
* Delete auto publication records for the specified portlet
*
* @param nPortletId
* The portlet identifier
*/
private void deleteAutoPublication( int nPortletId )
{
try ( DAOUtil daoUtil = new DAOUtil( SQL_QUERY_DELETE_AUTO_PUBLICATION_PORTLET ) )
{
daoUtil.setInt( 1, nPortletId );
daoUtil.executeUpdate( );
}
}
/**
* Loads the data of Document List Portlet whose identifier is specified in parameter
*
* @param nPortletId
* The Portlet identifier
* @return theDocumentListPortlet object
*/
public Portlet load( int nPortletId )
{ |
File |
Line |
fr/paris/lutece/plugins/document/business/DocumentDAO.java |
409 |
fr/paris/lutece/plugins/document/business/DocumentDAO.java |
464 |
daoUtil.setInt( 1, document.getId( ) );
daoUtil.executeQuery( );
while ( daoUtil.next( ) )
{
DocumentAttribute attribute = new DocumentAttribute( );
attribute.setId( daoUtil.getInt( 1 ) );
attribute.setCode( daoUtil.getString( 2 ) );
attribute.setCodeAttributeType( daoUtil.getString( 3 ) );
attribute.setCodeDocumentType( daoUtil.getString( 4 ) );
attribute.setName( daoUtil.getString( 5 ) );
attribute.setDescription( daoUtil.getString( 6 ) );
attribute.setAttributeOrder( daoUtil.getInt( 7 ) );
attribute.setRequired( daoUtil.getInt( 8 ) != 0 );
attribute.setSearchable( daoUtil.getInt( 9 ) != 0 );
String strContentType = daoUtil.getString( 11 );
if ( StringUtils.isNotBlank( strContentType ) )
{
// File attribute
attribute.setBinary( true );
attribute.setTextValue( daoUtil.getString( 10 ) );
attribute.setBinaryValue( daoUtil.getBytes( 12 ) ); |
File |
Line |
fr/paris/lutece/plugins/document/web/DocumentJspBean.java |
836 |
fr/paris/lutece/plugins/document/web/DocumentJspBean.java |
884 |
fr/paris/lutece/plugins/document/web/DocumentJspBean.java |
1293 |
public String doChangeState( HttpServletRequest request )
{
saveReferer( request );
String strDocumentId = request.getParameter( PARAMETER_DOCUMENT_ID );
String strActionId = request.getParameter( PARAMETER_ACTION_ID );
int nDocumentId = -1;
int nActionId = -1;
try
{
nDocumentId = Integer.parseInt( strDocumentId );
nActionId = Integer.parseInt( strActionId );
}
catch ( NumberFormatException ne )
{
AppLogService.error( ne );
}
Document document = DocumentHome.findByPrimaryKeyWithoutBinaries( nDocumentId );
DocumentAction action = DocumentActionHome.findByPrimaryKey( nActionId );
if ( ( action == null ) || ( action.getFinishDocumentState( ) == null ) || ( document == null ) ||
!DocumentService.getInstance( )
.isAuthorizedAdminDocument( document.getSpaceId( ),
document.getCodeDocumentType( ), action.getPermission( ), getUser( ) ) )
{
return getHomeUrl( request );
}
try
{
DocumentService.getInstance( )
.changeDocumentState( document, getUser( ), action.getFinishDocumentState( ).getId( ) ); |
File |
Line |
fr/paris/lutece/plugins/document/business/spaces/SpaceAction.java |
61 |
fr/paris/lutece/plugins/document/business/workflow/DocumentAction.java |
112 |
public void setLocale( Locale locale )
{
_locale = locale;
}
/**
* Returns the Url
*
* @return The Url
*/
public String getUrl( )
{
return _strUrl;
}
/**
* Sets the Url
*
* @param strUrl
* The Url
*/
public void setUrl( String strUrl )
{
_strUrl = strUrl;
}
/**
* Returns the NameKey
*
* @return The NameKey
*/
public String getNameKey( )
{
return _strNameKey;
}
/**
* Returns the Name
*
* @return The Name
*/
public String getName( )
{
return I18nService.getLocalizedString( _strNameKey, _locale );
}
/**
* Sets the NameKey
*
* @param strNameKey
* The NameKey
*/
public void setNameKey( String strNameKey )
{
_strNameKey = strNameKey;
}
/**
* Returns the DescriptionKey
*
* @return The DescriptionKey
*/
public String getDescriptionKey( )
{
return _strDescriptionKey;
}
/**
* Returns the Description
*
* @return The Description
*/
public String getDescription( )
{
return I18nService.getLocalizedString( _strDescriptionKey, _locale );
}
/**
* Sets the DescriptionKey
*
* @param strDescriptionKey
* The DescriptionKey
*/
public void setDescriptionKey( String strDescriptionKey )
{
_strDescriptionKey = strDescriptionKey;
}
/**
* Returns the IconUrl
*
* @return The IconUrl
*/
public String getIconUrl( )
{
return _strIconUrl;
}
/**
* Sets the IconUrl
*
* @param strIconUrl
* The IconUrl
*/
public void setIconUrl( String strIconUrl )
{
_strIconUrl = strIconUrl;
}
/**
* Returns the permission associated to the action
*
* @return The permission
*/
public String getPermission( )
{
return _strPermission;
}
/**
* Sets the Permission
*
* @param strPermission
* The Permission
*/
public void setPermission( String strPermission )
{
_strPermission = strPermission;
}
} |
File |
Line |
fr/paris/lutece/plugins/document/web/DocumentJspBean.java |
836 |
fr/paris/lutece/plugins/document/web/DocumentJspBean.java |
884 |
fr/paris/lutece/plugins/document/web/DocumentJspBean.java |
953 |
fr/paris/lutece/plugins/document/web/DocumentJspBean.java |
1293 |
public String doChangeState( HttpServletRequest request )
{
saveReferer( request );
String strDocumentId = request.getParameter( PARAMETER_DOCUMENT_ID );
String strActionId = request.getParameter( PARAMETER_ACTION_ID );
int nDocumentId = -1;
int nActionId = -1;
try
{
nDocumentId = Integer.parseInt( strDocumentId );
nActionId = Integer.parseInt( strActionId );
}
catch ( NumberFormatException ne )
{
AppLogService.error( ne );
}
Document document = DocumentHome.findByPrimaryKeyWithoutBinaries( nDocumentId );
DocumentAction action = DocumentActionHome.findByPrimaryKey( nActionId );
if ( ( action == null ) || ( action.getFinishDocumentState( ) == null ) || ( document == null ) ||
!DocumentService.getInstance( )
.isAuthorizedAdminDocument( document.getSpaceId( ),
document.getCodeDocumentType( ), action.getPermission( ), getUser( ) ) )
{
return getHomeUrl( request );
} |
File |
Line |
fr/paris/lutece/plugins/document/business/spaces/DocumentSpaceDAO.java |
275 |
fr/paris/lutece/plugins/document/business/spaces/DocumentSpaceDAO.java |
436 |
try (DAOUtil daoUtil = initSelectChildDAOUtil(nSpaceId, strCodeType))
{
daoUtil.executeQuery( );
while ( daoUtil.next( ) )
{
DocumentSpace space = new DocumentSpace( );
space.setId( daoUtil.getInt( 1 ) );
space.setIdParent( daoUtil.getInt( 2 ) );
space.setName( daoUtil.getString( 3 ) );
space.setDescription( daoUtil.getString( 4 ) );
space.setViewType( daoUtil.getString( 5 ) );
space.setIdIcon( daoUtil.getInt( 6 ) );
space.setIconUrl( daoUtil.getString( 7 ) );
space.setDocumentCreationAllowed( daoUtil.getInt( 8 ) != 0 );
space.setWorkgroup( daoUtil.getString( 9 ) );
listDocumentSpaces.add( space );
}
}
return listDocumentSpaces;
} |
File |
Line |
fr/paris/lutece/plugins/document/service/docsearch/DocSearchService.java |
211 |
fr/paris/lutece/plugins/document/service/docsearch/DocSearchService.java |
253 |
sbLogs.append( "Adding " );
sbLogs.append( doc.get( DocSearchItem.FIELD_TYPE ) );
sbLogs.append( " #" );
sbLogs.append( doc.get( DocSearchItem.FIELD_UID ) );
sbLogs.append( " - " );
sbLogs.append( doc.get( DocSearchItem.FIELD_TITLE ) );
sbLogs.append( "\r\n" );
}
}
}
catch ( Exception e )
{
sbLogs.append( "Indexing DocId " + luceneDocumentId + " Error durign document indexation parsing.\r\n" );
sbLogs.append( "Caught a " );
sbLogs.append( e.getClass( ) );
sbLogs.append( "\r\n with message: " );
sbLogs.append( e.getMessage( ) );
AppLogService.error( "Indexing error : ", e );
}
removeIndexerAction( action.getIdAction( ) );
}
//Update all document which must be update
for ( IndexerAction action : getAllIndexerActionByTask( IndexerAction.TASK_MODIFY ) ) |
File |
Line |
fr/paris/lutece/plugins/document/business/spaces/DocumentSpaceDAO.java |
338 |
fr/paris/lutece/plugins/document/business/spaces/DocumentSpaceDAO.java |
438 |
daoUtil.executeQuery( );
while ( daoUtil.next( ) )
{
DocumentSpace space = new DocumentSpace( );
space.setId( daoUtil.getInt( 1 ) );
space.setIdParent( daoUtil.getInt( 2 ) );
space.setName( daoUtil.getString( 3 ) );
space.setDescription( daoUtil.getString( 4 ) );
space.setViewType( daoUtil.getString( 5 ) );
space.setIdIcon( daoUtil.getInt( 6 ) );
space.setIconUrl( daoUtil.getString( 7 ) );
space.setDocumentCreationAllowed( daoUtil.getInt( 8 ) != 0 );
space.setWorkgroup( daoUtil.getString( 9 ) );
listDocumentSpaces.add( space );
}
}
return listDocumentSpaces;
}
/**
* Load the list of documentSpaces
*
* @return The Collection of the DocumentSpaces
*/
public ReferenceList getDocumentSpaceList( ) |
File |
Line |
fr/paris/lutece/plugins/document/business/spaces/DocumentSpaceDAO.java |
277 |
fr/paris/lutece/plugins/document/business/spaces/DocumentSpaceDAO.java |
338 |
daoUtil.executeQuery( );
while ( daoUtil.next( ) )
{
DocumentSpace space = new DocumentSpace( );
space.setId( daoUtil.getInt( 1 ) );
space.setIdParent( daoUtil.getInt( 2 ) );
space.setName( daoUtil.getString( 3 ) );
space.setDescription( daoUtil.getString( 4 ) );
space.setViewType( daoUtil.getString( 5 ) );
space.setIdIcon( daoUtil.getInt( 6 ) );
space.setIconUrl( daoUtil.getString( 7 ) );
space.setDocumentCreationAllowed( daoUtil.getInt( 8 ) != 0 );
space.setWorkgroup( daoUtil.getString( 9 ) );
listDocumentSpaces.add( space );
}
}
return listDocumentSpaces;
} |
File |
Line |
fr/paris/lutece/plugins/document/service/category/CategoryService.java |
103 |
fr/paris/lutece/plugins/document/service/category/CategoryService.java |
137 |
public static Collection<CategoryDisplay> getAllCategoriesDisplay( AdminUser user )
{
Collection<Category> listCategory = CategoryHome.findAll( );
listCategory = AdminWorkgroupService.getAuthorizedCollection( listCategory, user );
Collection<CategoryDisplay> listCategoryDisplay = new ArrayList<CategoryDisplay>( );
for ( Category category : listCategory )
{
CategoryDisplay categoryDisplay = _singleton.new CategoryDisplay( );
categoryDisplay.setCategory( category );
if(category.getIconContent() != null)
{
categoryDisplay.setIconUrl( getResourceImageCategory( categoryDisplay.getCategory( ).getId( ) ) );
}
else
{
categoryDisplay.setIconUrl( null );
}
categoryDisplay.setCountLinkedDocuments( CategoryHome.findCountIdDocuments( category.getId( ) ) );
categoryDisplay.setAssigned( false ); |
File |
Line |
fr/paris/lutece/plugins/document/business/attributes/DocumentAttributeDAO.java |
108 |
fr/paris/lutece/plugins/document/business/attributes/DocumentAttributeDAO.java |
219 |
daoUtil.setInt( 1, documentAttribute.getId( ) );
daoUtil.setString( 2, documentAttribute.getCodeDocumentType( ) );
daoUtil.setString( 3, documentAttribute.getCodeAttributeType( ) );
daoUtil.setString( 4, documentAttribute.getCode( ) );
daoUtil.setString( 5, documentAttribute.getName( ) );
daoUtil.setString( 6, documentAttribute.getDescription( ) );
daoUtil.setInt( 7, documentAttribute.getAttributeOrder( ) );
daoUtil.setInt( 8, documentAttribute.isRequired( ) ? 1 : 0 );
daoUtil.setInt( 9, documentAttribute.isSearchable( ) ? 1 : 0 );
daoUtil.executeUpdate( ); |
File |
Line |
fr/paris/lutece/plugins/document/service/DocumentTypeResourceIdService.java |
116 |
fr/paris/lutece/plugins/document/service/spaces/SpaceResourceIdService.java |
92 |
rt.setResourceTypeKey( DocumentType.RESOURCE_TYPE );
rt.setResourceTypeLabelKey( PROPERTY_LABEL_RESOURCE_TYPE );
Permission p = new Permission( );
p.setPermissionKey( PERMISSION_CREATE );
p.setPermissionTitleKey( PROPERTY_LABEL_CREATE );
rt.registerPermission( p );
p = new Permission( );
p.setPermissionKey( PERMISSION_VIEW );
p.setPermissionTitleKey( PROPERTY_LABEL_VIEW );
rt.registerPermission( p );
p = new Permission( );
p.setPermissionKey( PERMISSION_DELETE );
p.setPermissionTitleKey( PROPERTY_LABEL_DELETE );
rt.registerPermission( p );
p = new Permission( );
p.setPermissionKey( PERMISSION_MODIFY );
p.setPermissionTitleKey( PROPERTY_LABEL_MODIFY );
rt.registerPermission( p );
p = new Permission( );
p.setPermissionKey( PERMISSION_CHANGE ); |
File |
Line |
fr/paris/lutece/plugins/document/service/docsearch/DocSearchService.java |
194 |
fr/paris/lutece/plugins/document/service/docsearch/DocSearchService.java |
235 |
for ( IndexerAction action : getAllIndexerActionByTask( IndexerAction.TASK_CREATE ) )
{
ArrayList<Integer> luceneDocumentId = new ArrayList<Integer>( );
try
{
luceneDocumentId.add( action.getIdDocument( ) );
List<org.apache.lucene.document.Document> luceneDocument = _indexer.getDocuments( luceneDocumentId );
if ( ( luceneDocument != null ) && ( luceneDocument.size( ) > 0 ) )
{
Iterator<org.apache.lucene.document.Document> it = luceneDocument.iterator( );
while ( it.hasNext( ) )
{
org.apache.lucene.document.Document doc = it.next( );
writer.addDocument( doc ); |
File |
Line |
fr/paris/lutece/plugins/document/web/DocumentJspBean.java |
586 |
fr/paris/lutece/plugins/document/web/DocumentJspBean.java |
741 |
try
{
DocumentService.getInstance( )
.changeDocumentState( document, getUser( ), DocumentState.STATE_WAITING_FOR_APPROVAL );
//Reload document in case listeners have modified it in the database
document = DocumentHome.findByPrimaryKeyWithoutBinaries( IntegerUtils.convert( strDocumentId ) );
DocumentService.getInstance( )
.validateDocument( document, getUser( ), DocumentState.STATE_VALIDATE );
}
catch ( DocumentException e )
{
return getErrorMessageUrl( request, e.getI18nMessage( ) );
}
IndexationService.addIndexerAction( strDocumentId, DocumentIndexer.INDEXER_NAME, IndexerAction.TASK_MODIFY,
IndexationService.ALL_DOCUMENT );
DocumentIndexerUtils.addIndexerAction( strDocumentId, IndexerAction.TASK_MODIFY, IndexationService.ALL_DOCUMENT );
}
return getHomeUrl( request );
}
/**
* Gets the document modification page
* @param request The HTTP request
* @return The URL to go after performing the action
*/
public String getModifyDocument( HttpServletRequest request ) |
File |
Line |
fr/paris/lutece/plugins/document/business/attributes/DocumentAttributeDAO.java |
141 |
fr/paris/lutece/plugins/document/business/attributes/DocumentAttributeDAO.java |
288 |
documentAttribute = new DocumentAttribute( );
documentAttribute.setId( daoUtil.getInt( 1 ) );
documentAttribute.setCodeDocumentType( daoUtil.getString( 2 ) );
documentAttribute.setCodeAttributeType( daoUtil.getString( 3 ) );
documentAttribute.setCode( daoUtil.getString( 4 ) );
documentAttribute.setName( daoUtil.getString( 5 ) );
documentAttribute.setDescription( daoUtil.getString( 6 ) );
documentAttribute.setAttributeOrder( daoUtil.getInt( 7 ) );
documentAttribute.setRequired( daoUtil.getInt( 8 ) != 0 );
documentAttribute.setSearchable( daoUtil.getInt( 9 ) != 0 ); |
File |
Line |
fr/paris/lutece/plugins/document/business/spaces/DocumentSpaceDAO.java |
164 |
fr/paris/lutece/plugins/document/business/spaces/DocumentSpaceDAO.java |
281 |
fr/paris/lutece/plugins/document/business/spaces/DocumentSpaceDAO.java |
342 |
fr/paris/lutece/plugins/document/business/spaces/DocumentSpaceDAO.java |
442 |
space = new DocumentSpace( );
space.setId( daoUtil.getInt( 1 ) );
space.setIdParent( daoUtil.getInt( 2 ) );
space.setName( daoUtil.getString( 3 ) );
space.setDescription( daoUtil.getString( 4 ) );
space.setViewType( daoUtil.getString( 5 ) );
space.setIdIcon( daoUtil.getInt( 6 ) );
space.setIconUrl( daoUtil.getString( 7 ) );
space.setDocumentCreationAllowed( daoUtil.getInt( 8 ) != 0 );
space.setWorkgroup( daoUtil.getString( 9 ) ); |
File |
Line |
fr/paris/lutece/plugins/document/business/spaces/DocumentSpaceDAO.java |
111 |
fr/paris/lutece/plugins/document/business/spaces/DocumentSpaceDAO.java |
246 |
daoUtil.setInt( 1, space.getId( ) );
daoUtil.setInt( 2, space.getIdParent( ) );
daoUtil.setString( 3, space.getName( ) );
daoUtil.setString( 4, space.getDescription( ) );
daoUtil.setString( 5, space.getViewType( ) );
daoUtil.setInt( 6, space.getIdIcon( ) );
daoUtil.setInt( 7, space.isDocumentCreationAllowed( ) ? 1 : 0 );
daoUtil.setString( 8, space.getWorkgroup( ) );
daoUtil.executeUpdate( ); |