Search in sources :

Example 6 with WebappConfiguration

use of org.apache.archiva.configuration.model.WebappConfiguration in project archiva by apache.

the class ConfigurationRegistryReader method readWebappConfiguration.

private WebappConfiguration readWebappConfiguration(String prefix, Registry registry) {
    WebappConfiguration value = new WebappConfiguration();
    UserInterfaceOptions ui = readUserInterfaceOptions(prefix + "ui.", registry);
    value.setUi(ui);
    return value;
}
Also used : WebappConfiguration(org.apache.archiva.configuration.model.WebappConfiguration) UserInterfaceOptions(org.apache.archiva.configuration.model.UserInterfaceOptions)

Example 7 with WebappConfiguration

use of org.apache.archiva.configuration.model.WebappConfiguration in project archiva by apache.

the class ArchivaConfigurationMRM789Test method assertConfiguration.

/**
 * Ensures that the provided configuration matches the details present in the archiva-default.xml file.
 */
private void assertConfiguration(Configuration configuration, int managedExpected, int remoteExpected, int proxyConnectorExpected) throws Exception {
    assertEquals("check managed repositories: " + configuration.getManagedRepositories(), managedExpected, configuration.getManagedRepositories().size());
    assertEquals("check remote repositories: " + configuration.getRemoteRepositories(), remoteExpected, configuration.getRemoteRepositories().size());
    assertEquals("check proxy connectors:" + configuration.getProxyConnectors(), proxyConnectorExpected, configuration.getProxyConnectors().size());
    RepositoryScanningConfiguration repoScanning = configuration.getRepositoryScanning();
    assertNotNull("check repository scanning", repoScanning);
    assertEquals("check file types", 4, repoScanning.getFileTypes().size());
    assertEquals("check known consumers", 9, repoScanning.getKnownContentConsumers().size());
    assertEquals("check invalid consumers", 1, repoScanning.getInvalidContentConsumers().size());
    List<String> patterns = filetypes.getFileTypePatterns("artifacts");
    assertNotNull("check 'artifacts' file type", patterns);
    assertEquals("check 'artifacts' patterns", 13, patterns.size());
    WebappConfiguration webapp = configuration.getWebapp();
    assertNotNull("check webapp", webapp);
    UserInterfaceOptions ui = webapp.getUi();
    assertNotNull("check webapp ui", ui);
    assertTrue("check showFindArtifacts", ui.isShowFindArtifacts());
    assertTrue("check appletFindEnabled", ui.isAppletFindEnabled());
}
Also used : WebappConfiguration(org.apache.archiva.configuration.model.WebappConfiguration) UserInterfaceOptions(org.apache.archiva.configuration.model.UserInterfaceOptions) RepositoryScanningConfiguration(org.apache.archiva.configuration.model.RepositoryScanningConfiguration)

Example 8 with WebappConfiguration

use of org.apache.archiva.configuration.model.WebappConfiguration in project archiva by apache.

the class ArchivaConfigurationTest method assertConfiguration.

/**
 * Ensures that the provided configuration matches the details present in the archiva-default.xml file.
 */
private void assertConfiguration(Configuration configuration, int managedExpected, int remoteExpected, int proxyConnectorExpected) throws Exception {
    assertEquals("check managed repositories: " + configuration.getManagedRepositories(), managedExpected, configuration.getManagedRepositories().size());
    assertEquals("check remote repositories: " + configuration.getRemoteRepositories(), remoteExpected, configuration.getRemoteRepositories().size());
    assertEquals("check proxy connectors:" + configuration.getProxyConnectors(), proxyConnectorExpected, configuration.getProxyConnectors().size());
    RepositoryScanningConfiguration repoScanning = configuration.getRepositoryScanning();
    assertNotNull("check repository scanning", repoScanning);
    assertEquals("check file types", 4, repoScanning.getFileTypes().size());
    assertEquals("check known consumers", 9, repoScanning.getKnownContentConsumers().size());
    assertEquals("check invalid consumers", 1, repoScanning.getInvalidContentConsumers().size());
    List<String> patterns = filetypes.getFileTypePatterns("artifacts");
    assertNotNull("check 'artifacts' file type", patterns);
    assertEquals("check 'artifacts' patterns", 13, patterns.size());
    WebappConfiguration webapp = configuration.getWebapp();
    assertNotNull("check webapp", webapp);
    UserInterfaceOptions ui = webapp.getUi();
    assertNotNull("check webapp ui", ui);
    assertTrue("check showFindArtifacts", ui.isShowFindArtifacts());
    assertTrue("check appletFindEnabled", ui.isAppletFindEnabled());
}
Also used : WebappConfiguration(org.apache.archiva.configuration.model.WebappConfiguration) UserInterfaceOptions(org.apache.archiva.configuration.model.UserInterfaceOptions) RepositoryScanningConfiguration(org.apache.archiva.configuration.model.RepositoryScanningConfiguration)

Example 9 with WebappConfiguration

use of org.apache.archiva.configuration.model.WebappConfiguration in project archiva by apache.

the class ArchivaConfigurationTest method testGetConfigurationFromRegistryWithTwoConfigurationResources.

@Test
public void testGetConfigurationFromRegistryWithTwoConfigurationResources() throws Exception {
    ArchivaConfiguration archivaConfiguration = lookup(ArchivaConfiguration.class, "test-configuration-both");
    Configuration configuration = archivaConfiguration.getConfiguration();
    // from base
    assertEquals("check repositories", 2, configuration.getManagedRepositories().size());
    assertEquals("check repositories", 2, configuration.getRemoteRepositories().size());
    // from user
    assertEquals("check proxy connectors", 2, configuration.getProxyConnectors().size());
    WebappConfiguration webapp = configuration.getWebapp();
    assertNotNull("check webapp", webapp);
    UserInterfaceOptions ui = webapp.getUi();
    assertNotNull("check webapp ui", ui);
    // from base
    assertFalse("check showFindArtifacts", ui.isShowFindArtifacts());
    // from user
    assertFalse("check appletFindEnabled", ui.isAppletFindEnabled());
}
Also used : WebappConfiguration(org.apache.archiva.configuration.model.WebappConfiguration) ManagedRepositoryConfiguration(org.apache.archiva.configuration.model.ManagedRepositoryConfiguration) ProxyConnectorConfiguration(org.apache.archiva.configuration.model.ProxyConnectorConfiguration) RepositoryGroupConfiguration(org.apache.archiva.configuration.model.RepositoryGroupConfiguration) Configuration(org.apache.archiva.configuration.model.Configuration) RepositoryScanningConfiguration(org.apache.archiva.configuration.model.RepositoryScanningConfiguration) RemoteRepositoryConfiguration(org.apache.archiva.configuration.model.RemoteRepositoryConfiguration) WebappConfiguration(org.apache.archiva.configuration.model.WebappConfiguration) ContextConfiguration(org.springframework.test.context.ContextConfiguration) NetworkProxyConfiguration(org.apache.archiva.configuration.model.NetworkProxyConfiguration) UserInterfaceOptions(org.apache.archiva.configuration.model.UserInterfaceOptions) Test(org.junit.Test)

Example 10 with WebappConfiguration

use of org.apache.archiva.configuration.model.WebappConfiguration in project archiva by apache.

the class DefaultArchivaAdministration method getUiConfiguration.

@Override
public UiConfiguration getUiConfiguration() throws RepositoryAdminException {
    WebappConfiguration webappConfiguration = getArchivaConfiguration().getConfiguration().getWebapp();
    if (webappConfiguration == null) {
        return null;
    }
    UserInterfaceOptions userInterfaceOptions = webappConfiguration.getUi();
    if (userInterfaceOptions == null) {
        return null;
    }
    return getModelMapper().map(userInterfaceOptions, UiConfiguration.class);
}
Also used : WebappConfiguration(org.apache.archiva.configuration.model.WebappConfiguration) UserInterfaceOptions(org.apache.archiva.configuration.model.UserInterfaceOptions)

Aggregations

WebappConfiguration (org.apache.archiva.configuration.model.WebappConfiguration)10 UserInterfaceOptions (org.apache.archiva.configuration.model.UserInterfaceOptions)9 RepositoryScanningConfiguration (org.apache.archiva.configuration.model.RepositoryScanningConfiguration)8 Configuration (org.apache.archiva.configuration.model.Configuration)6 ManagedRepositoryConfiguration (org.apache.archiva.configuration.model.ManagedRepositoryConfiguration)6 NetworkProxyConfiguration (org.apache.archiva.configuration.model.NetworkProxyConfiguration)6 ProxyConnectorConfiguration (org.apache.archiva.configuration.model.ProxyConnectorConfiguration)6 RemoteRepositoryConfiguration (org.apache.archiva.configuration.model.RemoteRepositoryConfiguration)6 RepositoryGroupConfiguration (org.apache.archiva.configuration.model.RepositoryGroupConfiguration)6 LegacyArtifactPath (org.apache.archiva.configuration.model.LegacyArtifactPath)5 Test (org.junit.Test)5 ContextConfiguration (org.springframework.test.context.ContextConfiguration)5 Path (java.nio.file.Path)4 Iterator (java.util.Iterator)1 List (java.util.List)1 AbstractRepositoryConfiguration (org.apache.archiva.configuration.model.AbstractRepositoryConfiguration)1 AbstractRepositoryConnectorConfiguration (org.apache.archiva.configuration.model.AbstractRepositoryConnectorConfiguration)1 ArchivaDefaultConfiguration (org.apache.archiva.configuration.model.ArchivaDefaultConfiguration)1 ArchivaRuntimeConfiguration (org.apache.archiva.configuration.model.ArchivaRuntimeConfiguration)1 CacheConfiguration (org.apache.archiva.configuration.model.CacheConfiguration)1