CPD Results

The following document contains the results of PMD's CPD 4.3.

Duplications

FileLine
fr/paris/lutece/portal/util/mvc/admin/MVCAdminJspBean.java130
fr/paris/lutece/portal/util/mvc/xpage/MVCApplication.java371
    }

    ////////////////////////////////////////////////////////////////////////////
    // Page utils 

    /**
     * Add an error message
     * @param strMessage The message
     */
    protected void addError( String strMessage )
    {
        _listErrors.add( new MVCMessage( strMessage ) );
    }

    /**
     * Add an error message
     * @param strMessageKey The message
     * @param locale The locale
     */
    protected void addError( String strMessageKey, Locale locale )
    {
        _listErrors.add( new MVCMessage( I18nService.getLocalizedString( strMessageKey, locale ) ) );
    }

    /**
     * Add an info message
     * @param strMessage The message
     */
    protected void addInfo( String strMessage )
    {
        _listInfos.add( new MVCMessage( strMessage ) );
    }

    /**
     * Add an info message
     * @param strMessageKey The message key
     * @param locale The locale
     */
    protected void addInfo( String strMessageKey, Locale locale )
    {
        _listInfos.add( new MVCMessage( I18nService.getLocalizedString( strMessageKey, locale ) ) );
    }

    /**
    * Fill the model with commons objects used in templates
    * @param model The model
    */
    protected void fillCommons( Map<String, Object> model )
    {
        List<ErrorMessage> listErrors = new ArrayList<ErrorMessage>( _listErrors );
        List<ErrorMessage> listInfos = new ArrayList<ErrorMessage>( _listInfos );
        model.put( MARK_ERRORS, listErrors );
        model.put( MARK_INFOS, listInfos );
        _listErrors.clear(  );
        _listInfos.clear(  );
    }

    /**
     * Get a model Object filled with default values
     * @return The model
     */
    protected Map<String, Object> getModel(  )