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