Package org.apache.archiva.web.model

Examples of org.apache.archiva.web.model.ApplicationRuntimeInfo


        RuntimeInfoService service =
            JAXRSClientFactory.create( getBaseUrl() + "/" + getRestServicesPath() + "/archivaUiServices/",
                                       RuntimeInfoService.class,
                                       Collections.singletonList( new JacksonJaxbJsonProvider() ) );

        ApplicationRuntimeInfo applicationRuntimeInfo = service.getApplicationRuntimeInfo( "en" );

        assertEquals( System.getProperty( "expectedVersion" ), applicationRuntimeInfo.getVersion() );
        assertFalse( applicationRuntimeInfo.isJavascriptLog() );
        assertTrue( applicationRuntimeInfo.isLogMissingI18n() );

    }
View Full Code Here


    @Override
    public ApplicationRuntimeInfo getApplicationRuntimeInfo( String locale )
        throws ArchivaRestServiceException
    {
        ApplicationRuntimeInfo applicationRuntimeInfo = new ApplicationRuntimeInfo();
        applicationRuntimeInfo.setBuildNumber( this.archivaRuntimeInfo.getBuildNumber() );
        applicationRuntimeInfo.setTimestamp( this.archivaRuntimeInfo.getTimestamp() );
        applicationRuntimeInfo.setVersion( this.archivaRuntimeInfo.getVersion() );
        applicationRuntimeInfo.setBaseUrl( getBaseUrl( httpServletRequest ) );

        SimpleDateFormat sfd = new SimpleDateFormat( "yyyy-MM-dd'T'HH:mm:ssz",
                                                     new Locale( StringUtils.isEmpty( locale ) ? "en" : locale ) );
        applicationRuntimeInfo.setTimestampStr( sfd.format( new Date( archivaRuntimeInfo.getTimestamp() ) ) );

        CookieInformation cookieInformation = new CookieInformation();

        RedbackRuntimeConfiguration redbackRuntimeConfiguration =
            redbackRuntimeConfigurationService.getRedbackRuntimeConfiguration();

        cookieInformation.setDomain(
            redbackRuntimeConfiguration.getConfigurationProperties().get( UserConfigurationKeys.REMEMBER_ME_DOMAIN ) );
        cookieInformation.setPath(
            redbackRuntimeConfiguration.getConfigurationProperties().get( UserConfigurationKeys.REMEMBER_ME_PATH ) );
        cookieInformation.setSecure(
            redbackRuntimeConfiguration.getConfigurationProperties().get( UserConfigurationKeys.REMEMBER_ME_SECURE ) );
        cookieInformation.setTimeout(
            redbackRuntimeConfiguration.getConfigurationProperties().get( UserConfigurationKeys.REMEMBER_ME_TIMEOUT ) );
        cookieInformation.setRememberMeEnabled( BooleanUtils.toBoolean(
            redbackRuntimeConfiguration.getConfigurationProperties().get(
                UserConfigurationKeys.REMEMBER_ME_ENABLED ) ) );

        applicationRuntimeInfo.setCookieInformation( cookieInformation );

        return applicationRuntimeInfo;
    }
View Full Code Here

        RuntimeInfoService service =
            JAXRSClientFactory.create( getBaseUrl() + "/" + getRestServicesPath() + "/archivaUiServices/",
                                       RuntimeInfoService.class,
                                       Collections.singletonList( new JacksonJaxbJsonProvider() ) );

        ApplicationRuntimeInfo applicationRuntimeInfo = service.getApplicationRuntimeInfo( "en" );

        assertEquals( System.getProperty( "expectedVersion" ), applicationRuntimeInfo.getVersion() );
        assertFalse( applicationRuntimeInfo.isJavascriptLog() );
        assertTrue( applicationRuntimeInfo.isLogMissingI18n() );

    }
View Full Code Here

    }

    public ApplicationRuntimeInfo getApplicationRuntimeInfo( String locale )
        throws ArchivaRestServiceException
    {
        ApplicationRuntimeInfo applicationRuntimeInfo = new ApplicationRuntimeInfo();
        applicationRuntimeInfo.setBuildNumber( this.archivaRuntimeInfo.getBuildNumber() );
        applicationRuntimeInfo.setTimestamp( this.archivaRuntimeInfo.getTimestamp() );
        applicationRuntimeInfo.setVersion( this.archivaRuntimeInfo.getVersion() );
        applicationRuntimeInfo.setBaseUrl( getBaseUrl( httpServletRequest ) );

        SimpleDateFormat sfd = new SimpleDateFormat( "yyyy-MM-dd'T'HH:mm:ssz",
                                                     new Locale( StringUtils.isEmpty( locale ) ? "en" : locale ) );
        applicationRuntimeInfo.setTimestampStr( sfd.format( new Date( archivaRuntimeInfo.getTimestamp() ) ) );

        CookieInformation cookieInformation = new CookieInformation();

        RedbackRuntimeConfiguration redbackRuntimeConfiguration =
            redbackRuntimeConfigurationService.getRedbackRuntimeConfiguration();

        cookieInformation.setDomain(
            redbackRuntimeConfiguration.getConfigurationProperties().get( UserConfigurationKeys.REMEMBER_ME_DOMAIN ) );
        cookieInformation.setPath(
            redbackRuntimeConfiguration.getConfigurationProperties().get( UserConfigurationKeys.REMEMBER_ME_PATH ) );
        cookieInformation.setSecure(
            redbackRuntimeConfiguration.getConfigurationProperties().get( UserConfigurationKeys.REMEMBER_ME_SECURE ) );
        cookieInformation.setTimeout(
            redbackRuntimeConfiguration.getConfigurationProperties().get( UserConfigurationKeys.REMEMBER_ME_TIMEOUT ) );
        cookieInformation.setRememberMeEnabled( BooleanUtils.toBoolean(
            redbackRuntimeConfiguration.getConfigurationProperties().get(
                UserConfigurationKeys.REMEMBER_ME_ENABLED ) ) );

        applicationRuntimeInfo.setCookieInformation( cookieInformation );

        return applicationRuntimeInfo;
    }
View Full Code Here

TOP

Related Classes of org.apache.archiva.web.model.ApplicationRuntimeInfo

Copyright © 2018 www.massapicom. All rights reserved.
All source code are property of their respective owners. Java is a trademark of Sun Microsystems, Inc and owned by ORACLE Inc. Contact coftware#gmail.com.