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