Fork me on GitHub

Résultats CPD

Le document suivant contient les résultats de l'inspection CPD CPD 6.13.0.

Duplicatas

Fichier Ligne
fr/paris/lutece/plugins/document/business/portlet/DocumentListPortletDAO.java 261
fr/paris/lutece/plugins/document/business/portlet/DocumentPortletDAO.java 260
    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( ) );

        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( );

        ReferenceList list = new ReferenceList( );

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

        daoUtil.free( );

        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;
        DAOUtil daoUtil = new DAOUtil( SQL_QUERY_CHECK_IS_ALIAS );

        daoUtil.setInt( 1, nPortletId );
        daoUtil.executeQuery( );

        if ( daoUtil.next( ) )
        {
            bIsAlias = true;
        }

        daoUtil.free( );

        return bIsAlias;
    }
Fichier Ligne
fr/paris/lutece/plugins/document/business/DocumentDAO.java 1206
fr/paris/lutece/plugins/document/business/DocumentDAO.java 1251
        daoUtil.setString( 1, strUserName );
        daoUtil.executeQuery( );

        Document document = null;

        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++ ) );
        }

        daoUtil.free( );

        return document;
    }
Fichier Ligne
fr/paris/lutece/plugins/document/business/DocumentDAO.java 663
fr/paris/lutece/plugins/document/business/DocumentDAO.java 1030
        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 ) );
Fichier Ligne
fr/paris/lutece/plugins/document/business/DocumentDAO.java 306
fr/paris/lutece/plugins/document/business/DocumentDAO.java 668
fr/paris/lutece/plugins/document/business/DocumentDAO.java 1035
            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 ) );
Fichier Ligne
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 ) )
        {
Fichier Ligne
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 )
        {
            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( );
            }

            daoUtil.free( );
        }
    }

    /**
     * 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 )
    {
        DAOUtil daoUtil = new DAOUtil( SQL_QUERY_DELETE );
        daoUtil.setInt( 1, nPortletId );
        daoUtil.executeUpdate( );
        daoUtil.free( );

        daoUtil = new DAOUtil( SQL_QUERY_DELETE_PUBLISHED_DOCUMENT_PORTLET );
        daoUtil.setInt( 1, nPortletId );
        daoUtil.executeUpdate( );
        daoUtil.free( );

        deleteCategories( nPortletId );
        deleteAutoPublication( nPortletId );
    }

    /**
     * Delete categories for the specified portlet
     * 
     * @param nPortletId
     *            The portlet identifier
     */
    private void deleteCategories( int nPortletId )
    {
        DAOUtil daoUtil = new DAOUtil( SQL_QUERY_DELETE_CATEGORY_PORTLET );
        daoUtil.setInt( 1, nPortletId );
        daoUtil.executeUpdate( );
        daoUtil.free( );
    }

    /**
     * Delete auto publication records for the specified portlet
     * 
     * @param nPortletId
     *            The portlet identifier
     */
    private void deleteAutoPublication( int nPortletId )
    {
        DAOUtil daoUtil = new DAOUtil( SQL_QUERY_DELETE_AUTO_PUBLICATION_PORTLET );
        daoUtil.setInt( 1, nPortletId );
        daoUtil.executeUpdate( );
        daoUtil.free( );
    }

    /**
     * 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 )
    {
        DAOUtil daoUtil = new DAOUtil( SQL_QUERY_SELECT );
        daoUtil.setInt( 1, nPortletId );
        daoUtil.executeQuery( );
Fichier Ligne
fr/paris/lutece/plugins/document/business/DocumentDAO.java 185
fr/paris/lutece/plugins/document/business/DocumentDAO.java 596
        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( );
Fichier Ligne
fr/paris/lutece/plugins/document/business/portlet/DocumentListPortletDAO.java 181
fr/paris/lutece/plugins/document/business/portlet/DocumentPortletDAO.java 180
        DocumentListPortlet portlet = new DocumentListPortlet( );

        if ( daoUtil.next( ) )
        {
            portlet.setId( daoUtil.getInt( 1 ) );
            portlet.setDocumentTypeCode( daoUtil.getString( 2 ) );
        }

        daoUtil.free( );

        portlet.setIdCategory( loadCategories( nPortletId ) );

        return portlet;
    }

    /**
     * Load a list of Id categories
     * 
     * @param nPortletId
     * @return Array of categories
     */
    private int [ ] loadCategories( int nPortletId )
    {
        DAOUtil daoUtil = new DAOUtil( SQL_QUERY_SELECT_CATEGORY_PORTLET );
        daoUtil.setInt( 1, nPortletId );
        daoUtil.executeQuery( );

        Collection<Integer> nListIdCategory = new ArrayList<Integer>( );

        while ( daoUtil.next( ) )
        {
            nListIdCategory.add( daoUtil.getInt( 1 ) );
        }

        daoUtil.free( );

        int [ ] nArrayIdCategory = new int [ nListIdCategory.size( )];
        int i = 0;

        for ( Integer nIdCategory : nListIdCategory )
        {
            nArrayIdCategory [i++] = nIdCategory.intValue( );
        }

        return nArrayIdCategory;
    }

    /**
     * Update the record in the table
     *
     * @param portlet
     *            A portlet
     */
    public void store( Portlet portlet )
    {
Fichier Ligne
fr/paris/lutece/plugins/document/business/DocumentDAO.java 405
fr/paris/lutece/plugins/document/business/DocumentDAO.java 459
        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 ) );
Fichier Ligne
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(  ) );
Fichier Ligne
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;
    }
}
Fichier Ligne
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 );
        }
Fichier Ligne
fr/paris/lutece/plugins/document/business/spaces/DocumentSpaceDAO.java 326
fr/paris/lutece/plugins/document/business/spaces/DocumentSpaceDAO.java 431
        daoUtil.setInt( 2, createDocumentIsAllowed );

        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 );
        }

        daoUtil.free( );

        return listDocumentSpaces;
    }

    /**
     * Load the list of documentSpaces
     * 
     * @return The Collection of the DocumentSpaces
     */
    public ReferenceList getDocumentSpaceList( )
Fichier Ligne
fr/paris/lutece/plugins/document/business/spaces/DocumentSpaceDAO.java 290
fr/paris/lutece/plugins/document/business/spaces/DocumentSpaceDAO.java 328
fr/paris/lutece/plugins/document/business/spaces/DocumentSpaceDAO.java 432
        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 );
        }

        daoUtil.free( );

        return listDocumentSpaces;
    }

    /**
     * Load the list of documentSpaces authorizing the selected document type
     *
     * @param strCodeType
     *            the document type filter
     * @return The Collection of the DocumentSpaces
     */
    public List<DocumentSpace> selectSpacesAllowingDocumentCreationByDocumentType( String strCodeType, int createDocumentIsAllowed )
Fichier Ligne
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 ) )
Fichier Ligne
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 );
Fichier Ligne
fr/paris/lutece/plugins/document/business/attributes/DocumentAttributeDAO.java 108
fr/paris/lutece/plugins/document/business/attributes/DocumentAttributeDAO.java 216
        documentAttribute.setId( newPrimaryKey( ) );
        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( );
Fichier Ligne
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 );
Fichier Ligne
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 );
Fichier Ligne
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 )
Fichier Ligne
fr/paris/lutece/plugins/document/business/attributes/DocumentAttributeDAO.java 141
fr/paris/lutece/plugins/document/business/attributes/DocumentAttributeDAO.java 286
            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 );
Fichier Ligne
fr/paris/lutece/plugins/document/business/spaces/DocumentSpaceDAO.java 165
fr/paris/lutece/plugins/document/business/spaces/DocumentSpaceDAO.java 294
fr/paris/lutece/plugins/document/business/spaces/DocumentSpaceDAO.java 332
fr/paris/lutece/plugins/document/business/spaces/DocumentSpaceDAO.java 436
            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 ) );
Fichier Ligne
fr/paris/lutece/plugins/document/business/history/HistoryEventDAO.java 99
fr/paris/lutece/plugins/document/business/history/HistoryEventDAO.java 131
        daoUtil.setInt( 1, nDocumentId );
        daoUtil.executeQuery( );

        while ( daoUtil.next( ) )
        {
            HistoryEvent event = new HistoryEvent( );
            event.setIdDocument( daoUtil.getInt( 1 ) );
            event.setDate( daoUtil.getTimestamp( 2 ) );
            event.setEventUser( daoUtil.getString( 3 ) );
            event.setEventMessageKey( daoUtil.getString( 4 ) );
            event.setDocumentStateKey( daoUtil.getString( 5 ) );
            event.setSpace( daoUtil.getString( 6 ) );

            listHistoryEvents.add( event );
        }

        daoUtil.free( );

        return listHistoryEvents;
    }
Fichier Ligne
fr/paris/lutece/plugins/document/business/spaces/DocumentSpaceDAO.java 111
fr/paris/lutece/plugins/document/business/spaces/DocumentSpaceDAO.java 246
        space.setId( newPrimaryKey( ) );
        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( );