use new shared app configuration

git-svn-id: https://svn.apache.org/repos/asf/maven/archiva/trunk@506466 13f79535-47bb-0310-9956-ffa450edef68
This commit is contained in:
Brett Porter 2007-02-12 14:43:47 +00:00
parent 20c01b2c7e
commit 5966573bef
4 changed files with 18 additions and 22 deletions

View File

@ -28,10 +28,8 @@ import org.apache.maven.model.Model;
import org.apache.maven.project.ProjectBuildingException;
import org.apache.maven.shared.app.company.CompanyPomHandler;
import org.apache.maven.shared.app.configuration.Configuration;
import org.apache.maven.shared.app.configuration.ConfigurationChangeException;
import org.apache.maven.shared.app.configuration.ConfigurationStore;
import org.apache.maven.shared.app.configuration.ConfigurationStoreException;
import org.apache.maven.shared.app.configuration.InvalidConfigurationException;
import org.apache.maven.shared.app.configuration.MavenAppConfiguration;
import org.codehaus.plexus.registry.RegistryException;
import org.codehaus.plexus.security.rbac.Resource;
import org.codehaus.plexus.security.ui.web.interceptor.SecureAction;
import org.codehaus.plexus.security.ui.web.interceptor.SecureActionBundle;
@ -52,7 +50,7 @@ public class ConfigureAppearanceAction
/**
* @plexus.requirement
*/
private ConfigurationStore appConfigurationStore;
private MavenAppConfiguration appConfigurationStore;
/**
* The configuration.
@ -67,9 +65,9 @@ public class ConfigureAppearanceAction
private CompanyPomHandler companyPomHandler;
public String execute()
throws IOException, ConfigurationStoreException, InvalidConfigurationException, ConfigurationChangeException
throws IOException, RegistryException
{
appConfigurationStore.storeConfiguration( configuration );
appConfigurationStore.save( configuration );
return SUCCESS;
}
@ -80,9 +78,9 @@ public class ConfigureAppearanceAction
}
public void prepare()
throws ConfigurationStoreException, ProjectBuildingException, ArtifactMetadataRetrievalException
throws ProjectBuildingException, ArtifactMetadataRetrievalException
{
configuration = appConfigurationStore.getConfigurationFromStore();
configuration = appConfigurationStore.getConfiguration();
companyModel = companyPomHandler.getCompanyPomModel( configuration.getCompanyPom(), createLocalRepository() );
}

View File

@ -30,10 +30,7 @@ import org.apache.maven.project.ProjectBuildingException;
import org.apache.maven.shared.app.company.CompanyPomHandler;
import org.apache.maven.shared.app.configuration.CompanyPom;
import org.apache.maven.shared.app.configuration.Configuration;
import org.apache.maven.shared.app.configuration.ConfigurationChangeException;
import org.apache.maven.shared.app.configuration.ConfigurationStore;
import org.apache.maven.shared.app.configuration.ConfigurationStoreException;
import org.apache.maven.shared.app.configuration.InvalidConfigurationException;
import org.apache.maven.shared.app.configuration.MavenAppConfiguration;
import org.codehaus.plexus.security.rbac.Resource;
import org.codehaus.plexus.security.ui.web.interceptor.SecureAction;
import org.codehaus.plexus.security.ui.web.interceptor.SecureActionBundle;
@ -54,7 +51,7 @@ public class EditPomAction
/**
* @plexus.requirement
*/
private ConfigurationStore appConfigurationStore;
private MavenAppConfiguration appConfigurationStore;
/**
* The configuration.
@ -69,8 +66,7 @@ public class EditPomAction
private Model companyModel;
public String execute()
throws IOException, ConfigurationStoreException, InvalidConfigurationException, ConfigurationChangeException,
ArtifactInstallationException
throws IOException, ArtifactInstallationException
{
// TODO: hack for passed in String[]
String[] logo = (String[]) companyModel.getProperties().get( "organization.logo" );
@ -90,9 +86,9 @@ public class EditPomAction
}
public void prepare()
throws ConfigurationStoreException, ProjectBuildingException, ArtifactMetadataRetrievalException
throws ProjectBuildingException, ArtifactMetadataRetrievalException
{
configuration = appConfigurationStore.getConfigurationFromStore();
configuration = appConfigurationStore.getConfiguration();
CompanyPom companyPom = configuration.getCompanyPom();
companyModel = companyPomHandler.getCompanyPomModel( companyPom, createLocalRepository() );

View File

@ -22,7 +22,7 @@ package org.apache.maven.archiva.web.action.component;
import org.apache.maven.archiva.web.action.AbstractConfiguredAction;
import org.apache.maven.model.Model;
import org.apache.maven.shared.app.company.CompanyPomHandler;
import org.apache.maven.shared.app.configuration.ConfigurationStore;
import org.apache.maven.shared.app.configuration.MavenAppConfiguration;
/**
* Stores the company information for displaying on the page.
@ -46,12 +46,12 @@ public class CompanyInfoAction
/**
* @plexus.requirement
*/
private ConfigurationStore appConfigurationStore;
private MavenAppConfiguration appConfigurationStore;
public String execute()
throws Exception
{
Model model = handler.getCompanyPomModel( appConfigurationStore.getConfigurationFromStore().getCompanyPom(),
Model model = handler.getCompanyPomModel( appConfigurationStore.getConfiguration().getCompanyPom(),
createLocalRepository() );
if ( model != null )

View File

@ -31,7 +31,9 @@
<jndi prefix="java:comp/env" config-optional="true"/>
<xml fileName="${user.home}/.m2/archiva.xml" config-optional="true" config-name="org.apache.maven.archiva"
config-at="org.apache.maven.archiva" config-forceCreate="true"/>
<xml fileName="${user.home}/.m2/shared.xml" config-optional="true"/>
<xml fileName="${user.home}/.m2/shared.xml" config-optional="true"
config-name="org.apache.maven.shared.app" config-at="org.apache.maven.shared.app"
config-forceCreate="true"/>
<properties fileName="${user.home}/.m2/security.properties" config-optional="true"
config-at="org.codehaus.plexus.security"/>
<properties fileName="${user.home}/.m2/archiva.properties" config-optional="true"