Fork me on GitHub

CPD Results

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

Duplications

File Line
fr/paris/lutece/plugins/mydashboard/modules/identity/web/EditIdentityXPage.java 149
fr/paris/lutece/plugins/mydashboard/modules/identity/web/EditIdentityXPage.java 207
    public XPage getEditIdentityInformations( HttpServletRequest request ) throws UserNotSignedException
    {
        LuteceUser luteceUser = SecurityService.isAuthenticationEnable( ) ? SecurityService.getInstance( ).getRegisteredUser( request ) : null;

        if ( luteceUser == null )
        {
            throw new UserNotSignedException( );
        }
        
        if ( ( _dashboardIdentity == null ) || ( _dashboardIdentity.getConnectionId( ) == null ) || !_dashboardIdentity.getConnectionId( ).getValue( ).equals( luteceUser.getName( ) ) )
        {
            IdentityDto identity = DashboardIdentityUtils.getInstance( ).getIdentity( luteceUser.getName( ) );
            _dashboardIdentity = DashboardIdentityUtils.getInstance( ).convertToDashboardIdentity( identity );
        }        
        
        Map<String, Object> model = getModel( );
        
        model.put( MARK_MYDASHBOARD_SITE_PROPERTIES, DatastoreService.getDataByPrefix( _dashboardPropertiesGroup.getDatastoreKeysPrefix( ) ).toMap( ) );
        model.put( MARK_PAGE_TITLE, I18nService.getLocalizedString( MESSAGE_IDENTITY_INFOS_PAGE_TITLE, request.getLocale( ) ) );
File Line
fr/paris/lutece/plugins/mydashboard/modules/identity/web/EditIdentityXPage.java 175
fr/paris/lutece/plugins/mydashboard/modules/identity/web/IdentityXPage.java 309
        addMessage( request, model );
        
        return getXPage( TEMPLATE_GET_VIEW_MODIFY_IDENTITY, request.getLocale( ), model );
    }
    
    private void addMessage( HttpServletRequest request, Map<String, Object> model )
    {
        String strErrorMessageInSession = DashboardIdentityUtils.getInstance( ).getMessageInSession( true, true, request );
        String stInfoMessageInSession = DashboardIdentityUtils.getInstance( ).getMessageInSession( false, true, request );
        
        if( StringUtils.isNotEmpty( strErrorMessageInSession ) )
        {
            addError( strErrorMessageInSession, request.getLocale( ) );
            fillCommons( model );
        }
        if( StringUtils.isNotEmpty( stInfoMessageInSession ) )
        {
            addInfo( stInfoMessageInSession, request.getLocale( ) );
            fillCommons( model );
        }
    }
    
    /**
     * Get the edit identity of the coordinates user view
     *
     * @param request
     *            The request, with the user logged in
     * @return The XPage to edit the identity of the user
     * @throws UserNotSignedException
     *             If the user is not logged in
     */
    @View( value = VIEW_GET_EDIT_IDENTITY_COORDINATES )
File Line
fr/paris/lutece/plugins/mydashboard/modules/identity/web/IdentityXPage.java 234
fr/paris/lutece/plugins/mydashboard/modules/identity/web/IdentityXPage.java 294
        model.put( MARK_AVATAR_URL, getAvatarUrl( request ) );
        model.put( MARK_TOKEN, _securityTokenService.getToken( request, ACTION_DO_MODIFY_IDENTITY ) );

        // check back url
        String strBackUrl = AuthorizedUrlService.getInstance( ).getServiceBackUrl( request );

        if ( !StringUtils.isEmpty( strBackUrl ) )
        {
            model.put( MARK_SERVICE_URL, strBackUrl );
            String strServiceName = !StringUtils.isEmpty( _strAppCode ) ? AuthorizedUrlService.getInstance( ).getNameByApplicationCode( _strAppCode, strBackUrl ) : AuthorizedUrlService.getInstance( ).getName( strBackUrl );
            if ( !StringUtils.isEmpty( strServiceName ) )
            {
                model.put( MARK_SERVICE_NAME, strServiceName );
            }
        }
        
        addMessage( request, model );
        
        return getXPage( TEMPLATE_GET_VIEW_MODIFY_IDENTITY, request.getLocale( ), model );
    }
File Line
fr/paris/lutece/plugins/mydashboard/modules/identity/util/DashboardIdentityUtils.java 153
fr/paris/lutece/plugins/mydashboard/modules/identity/web/IdentityXPage.java 174
            _instance._identityService = SpringContextService.getBean( BEAN_IDENTITYSTORE_SERVICE );
            _lstGenderList = new ReferenceList( );

            int i = 0;

            for ( String sItem : Constants.PROPERTY_KEY_GENDER_LIST.split( SPLIT_PATTERN ) )
            {
                ReferenceItem refItm = new ReferenceItem( );
                refItm.setName( sItem );
                refItm.setCode( String.valueOf( i ) );
                _lstGenderList.add( refItm );
                i++;
            }

            _lstContactModeList = new ReferenceList( );

            for ( String sItem : Constants.PROPERTY_KEY_CONTACT_MODE_LIST.split( SPLIT_PATTERN ) )
            {
                ReferenceItem refItm = new ReferenceItem( );
                refItm.setName( sItem );
                refItm.setCode( sItem );
                _lstContactModeList.add( refItm );
            }
        }
File Line
fr/paris/lutece/plugins/mydashboard/modules/identity/service/DashboardIdentityService.java 117
fr/paris/lutece/plugins/mydashboard/modules/identity/util/DashboardIdentityUtils.java 153
            _instance._identityQualityService = SpringContextService.getBean( BEAN_SERVICE_IDENTITY_QUALITYSERVICE );
            _lstGenderList = new ReferenceList( );

            int i = 0;

            for ( String sItem : Constants.PROPERTY_KEY_GENDER_LIST.split( SPLIT_PATTERN ) )
            {
                ReferenceItem refItm = new ReferenceItem( );
                refItm.setName( sItem );
                refItm.setCode( String.valueOf( i ) );
                _lstGenderList.add( refItm );
                i++;
            }

            _lstContactModeList = new ReferenceList( );

            for ( String sItem : Constants.PROPERTY_KEY_CONTACT_MODE_LIST.split( SPLIT_PATTERN ) )
            {
                ReferenceItem refItm = new ReferenceItem( );
                refItm.setName( sItem );
                refItm.setCode( sItem );
                _lstContactModeList.add( refItm );
            }
        }
            return _instance;
    }
File Line
fr/paris/lutece/plugins/mydashboard/modules/identity/service/DashboardIdentityService.java 117
fr/paris/lutece/plugins/mydashboard/modules/identity/web/IdentityXPage.java 174
            _instance._identityQualityService = SpringContextService.getBean( BEAN_SERVICE_IDENTITY_QUALITYSERVICE );
            _lstGenderList = new ReferenceList( );

            int i = 0;

            for ( String sItem : Constants.PROPERTY_KEY_GENDER_LIST.split( SPLIT_PATTERN ) )
            {
                ReferenceItem refItm = new ReferenceItem( );
                refItm.setName( sItem );
                refItm.setCode( String.valueOf( i ) );
                _lstGenderList.add( refItm );
                i++;
            }

            _lstContactModeList = new ReferenceList( );

            for ( String sItem : Constants.PROPERTY_KEY_CONTACT_MODE_LIST.split( SPLIT_PATTERN ) )
            {
                ReferenceItem refItm = new ReferenceItem( );
                refItm.setName( sItem );
                refItm.setCode( sItem );
                _lstContactModeList.add( refItm );
            }
        }