*/
import com.opensymphony.xwork2.Preparable;
-import org.apache.maven.archiva.configuration.ArchivaConfiguration;
-import org.apache.maven.archiva.configuration.Configuration;
-import org.apache.maven.archiva.configuration.OrganisationInformation;
+import org.apache.archiva.admin.repository.admin.ArchivaAdministration;
+import org.apache.archiva.admin.repository.admin.OrganisationInformation;
import org.apache.maven.archiva.web.action.AbstractActionSupport;
import javax.inject.Inject;
{
@Inject
- protected ArchivaConfiguration configuration;
+ protected ArchivaAdministration archivaAdministration;
private String organisationLogo;
private String organisationName;
- public void setConfiguration( ArchivaConfiguration configuration )
- {
- this.configuration = configuration;
- }
-
public String getOrganisationLogo()
{
return organisationLogo;
public void prepare()
throws Exception
{
- Configuration config = configuration.getConfiguration();
- if ( config != null )
+
+ OrganisationInformation orgInfo = archivaAdministration.getOrganisationInformation();
+ if ( orgInfo != null )
{
- OrganisationInformation orgInfo = config.getOrganisationInfo();
- if ( orgInfo != null )
- {
- setOrganisationLogo( orgInfo.getLogoLocation() );
- setOrganisationName( orgInfo.getName() );
- setOrganisationUrl( orgInfo.getUrl() );
- }
+ setOrganisationLogo( orgInfo.getLogoLocation() );
+ setOrganisationName( orgInfo.getName() );
+ setOrganisationUrl( orgInfo.getUrl() );
}
+
+ }
+
+ public ArchivaAdministration getArchivaAdministration()
+ {
+ return archivaAdministration;
+ }
+
+ public void setArchivaAdministration( ArchivaAdministration archivaAdministration )
+ {
+ this.archivaAdministration = archivaAdministration;
}
}
*/
import com.opensymphony.xwork2.Validateable;
+import org.apache.archiva.admin.repository.RepositoryAdminException;
+import org.apache.archiva.admin.repository.admin.OrganisationInformation;
import org.apache.archiva.security.common.ArchivaRoleConstants;
import org.apache.commons.lang.StringUtils;
-import org.apache.maven.archiva.configuration.Configuration;
-import org.apache.maven.archiva.configuration.IndeterminateConfigurationException;
-import org.apache.maven.archiva.configuration.OrganisationInformation;
import org.codehaus.plexus.redback.rbac.Resource;
-import org.codehaus.plexus.registry.RegistryException;
import org.codehaus.redback.integration.interceptor.SecureAction;
import org.codehaus.redback.integration.interceptor.SecureActionBundle;
import org.codehaus.redback.integration.interceptor.SecureActionException;
{
@Override
public String execute()
- throws RegistryException, IndeterminateConfigurationException
+ throws RepositoryAdminException
{
- Configuration config = configuration.getConfiguration();
- if ( config != null )
- {
- OrganisationInformation orgInfo = config.getOrganisationInfo();
- if ( orgInfo == null )
- {
- config.setOrganisationInfo( orgInfo );
- }
- orgInfo.setLogoLocation( getOrganisationLogo() );
- orgInfo.setName( getOrganisationName() );
- orgInfo.setUrl( getOrganisationUrl() );
+ OrganisationInformation orgInfo = archivaAdministration.getOrganisationInformation();
- configuration.save( config );
- }
+ orgInfo.setLogoLocation( getOrganisationLogo() );
+ orgInfo.setName( getOrganisationName() );
+ orgInfo.setUrl( getOrganisationUrl() );
+
+ archivaAdministration.setOrganisationInformation( orgInfo );
return SUCCESS;
}
* under the License.
*/
+import org.apache.archiva.admin.repository.admin.DefaultArchivaAdministration;
import org.apache.maven.archiva.configuration.ArchivaConfiguration;
import org.apache.maven.archiva.configuration.Configuration;
import org.apache.maven.archiva.web.action.AbstractWebworkTestCase;
configuration = (ArchivaConfiguration) archivaConfigurationControl.getMock();
configuration.getConfiguration();
- archivaConfigurationControl.setReturnValue( config, 1, 2 );
+ archivaConfigurationControl.setReturnValue( config, 1, 5 );
configuration.save( config );
- archivaConfigurationControl.setVoidCallable( 1, 2 );
+ archivaConfigurationControl.setVoidCallable( 1, 4 );
archivaConfigurationControl.replay();
+
+ DefaultArchivaAdministration defaultArchivaAdministration = new DefaultArchivaAdministration();
+ defaultArchivaAdministration.setArchivaConfiguration( configuration );
+ getAction().setArchivaAdministration( defaultArchivaAdministration );
}
protected void reloadAction()
{
action = getAction();
- action.setConfiguration( configuration );
+ ( (DefaultArchivaAdministration) action.getArchivaAdministration() ).setArchivaConfiguration( configuration );
+
}
}
*/
import com.opensymphony.xwork2.validator.ActionValidatorManager;
+import org.apache.archiva.web.validator.utils.ValidatorUtil;
import org.apache.maven.archiva.configuration.OrganisationInformation;
import org.apache.maven.archiva.web.action.admin.repositories.DefaultActionValidatorManagerFactory;
-import org.apache.archiva.web.validator.utils.ValidatorUtil;
import java.util.ArrayList;
import java.util.HashMap;
action.execute();
+ orginfo = config.getOrganisationInfo();
+
assertEquals( "LOGO1", orginfo.getLogoLocation() );
assertEquals( "NAME1", orginfo.getName() );
assertEquals( "URL1", orginfo.getUrl() );
@Override
protected AbstractAppearanceAction getAction()
{
- //return (OrganisationInfoAction) lookup( Action.class.getName(), "organisationInfo" );
-
return (OrganisationInfoAction) getActionProxy( "/components/companyInfo.action" ).getAction();
}
}