Search in sources :

Example 21 with Configuration

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

the class DefaultArchivaAdministration method setOrganisationInformation.

@Override
public void setOrganisationInformation(OrganisationInformation organisationInformation) throws RepositoryAdminException {
    organisationInformation.setUrl(fixUrl(organisationInformation.getUrl(), "url"));
    organisationInformation.setLogoLocation(fixUrl(organisationInformation.getLogoLocation(), "logoLocation"));
    Configuration configuration = getArchivaConfiguration().getConfiguration();
    if (organisationInformation != null) {
        organisationInformation.setName(convertName(organisationInformation.getName()));
        org.apache.archiva.configuration.model.OrganisationInformation organisationInformationModel = getModelMapper().map(organisationInformation, org.apache.archiva.configuration.model.OrganisationInformation.class);
        configuration.setOrganisationInfo(organisationInformationModel);
    } else {
        configuration.setOrganisationInfo(null);
    }
    saveConfiguration(configuration);
}
Also used : WebappConfiguration(org.apache.archiva.configuration.model.WebappConfiguration) Configuration(org.apache.archiva.configuration.model.Configuration)

Example 22 with Configuration

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

the class DefaultArchivaAdministration method deleteLegacyArtifactPath.

@Override
public void deleteLegacyArtifactPath(String path, AuditInformation auditInformation) throws RepositoryAdminException {
    Configuration configuration = getArchivaConfiguration().getConfiguration();
    org.apache.archiva.configuration.model.LegacyArtifactPath legacyArtifactPath = new org.apache.archiva.configuration.model.LegacyArtifactPath();
    legacyArtifactPath.setPath(path);
    configuration.removeLegacyArtifactPath(legacyArtifactPath);
    saveConfiguration(configuration);
    triggerAuditEvent("", "", AuditEvent.REMOVE_LEGACY_PATH, auditInformation);
}
Also used : WebappConfiguration(org.apache.archiva.configuration.model.WebappConfiguration) Configuration(org.apache.archiva.configuration.model.Configuration)

Example 23 with Configuration

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

the class DefaultArchivaAdministration method updateUiConfiguration.

@Override
public void updateUiConfiguration(UiConfiguration uiConfiguration) throws RepositoryAdminException {
    Configuration configuration = getArchivaConfiguration().getConfiguration();
    if (uiConfiguration != null) {
        UserInterfaceOptions userInterfaceOptions = getModelMapper().map(uiConfiguration, UserInterfaceOptions.class);
        configuration.getWebapp().setUi(userInterfaceOptions);
    } else {
        configuration.getWebapp().setUi(null);
    }
    saveConfiguration(configuration);
}
Also used : WebappConfiguration(org.apache.archiva.configuration.model.WebappConfiguration) Configuration(org.apache.archiva.configuration.model.Configuration) UserInterfaceOptions(org.apache.archiva.configuration.model.UserInterfaceOptions)

Example 24 with Configuration

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

the class DefaultArchivaAdministration method removeKnownContentConsumer.

@Override
public void removeKnownContentConsumer(String knownContentConsumer, AuditInformation auditInformation) throws RepositoryAdminException {
    Configuration configuration = getArchivaConfiguration().getConfiguration();
    configuration.getRepositoryScanning().removeKnownContentConsumer(knownContentConsumer);
    saveConfiguration(configuration);
    triggerAuditEvent("", "", AuditEvent.DISABLE_REPO_CONSUMER, auditInformation);
}
Also used : WebappConfiguration(org.apache.archiva.configuration.model.WebappConfiguration) Configuration(org.apache.archiva.configuration.model.Configuration)

Example 25 with Configuration

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

the class DefaultArchivaAdministration method addFileType.

@Override
public void addFileType(FileType fileType, AuditInformation auditInformation) throws RepositoryAdminException {
    Configuration configuration = getArchivaConfiguration().getConfiguration();
    if (getFileTypeById(fileType.getId(), configuration) != null) {
        throw new RepositoryAdminException("impossible to FileType with id " + fileType.getId() + " already exists");
    }
    configuration.getRepositoryScanning().addFileType(getModelMapper().map(fileType, org.apache.archiva.configuration.model.FileType.class));
    saveConfiguration(configuration);
}
Also used : WebappConfiguration(org.apache.archiva.configuration.model.WebappConfiguration) Configuration(org.apache.archiva.configuration.model.Configuration) RepositoryAdminException(org.apache.archiva.admin.model.RepositoryAdminException)

Aggregations

Configuration (org.apache.archiva.configuration.model.Configuration)94 ManagedRepositoryConfiguration (org.apache.archiva.configuration.model.ManagedRepositoryConfiguration)56 ContextConfiguration (org.springframework.test.context.ContextConfiguration)45 RemoteRepositoryConfiguration (org.apache.archiva.configuration.model.RemoteRepositoryConfiguration)42 ProxyConnectorConfiguration (org.apache.archiva.configuration.model.ProxyConnectorConfiguration)34 ArchivaConfiguration (org.apache.archiva.configuration.provider.ArchivaConfiguration)34 WebappConfiguration (org.apache.archiva.configuration.model.WebappConfiguration)32 RepositoryGroupConfiguration (org.apache.archiva.configuration.model.RepositoryGroupConfiguration)29 Path (java.nio.file.Path)27 Test (org.junit.Test)26 NetworkProxyConfiguration (org.apache.archiva.configuration.model.NetworkProxyConfiguration)23 RepositoryScanningConfiguration (org.apache.archiva.configuration.model.RepositoryScanningConfiguration)23 RepositoryException (org.apache.archiva.repository.RepositoryException)22 RepositoryAdminException (org.apache.archiva.admin.model.RepositoryAdminException)14 ManagedRepository (org.apache.archiva.repository.ManagedRepository)13 IOException (java.io.IOException)12 ArrayList (java.util.ArrayList)12 RemoteRepository (org.apache.archiva.repository.RemoteRepository)12 Test (org.junit.jupiter.api.Test)12 LegacyArtifactPath (org.apache.archiva.configuration.model.LegacyArtifactPath)11