]> source.dussan.org Git - archiva.git/blob
6a87b564459450304fb33060b9453ba4326812c1
[archiva.git] /
1 package org.apache.maven.archiva.web.action.admin;
2
3 /*
4  * Licensed to the Apache Software Foundation (ASF) under one
5  * or more contributor license agreements.  See the NOTICE file
6  * distributed with this work for additional information
7  * regarding copyright ownership.  The ASF licenses this file
8  * to you under the Apache License, Version 2.0 (the
9  * "License"); you may not use this file except in compliance
10  * with the License.  You may obtain a copy of the License at
11  *
12  *   http://www.apache.org/licenses/LICENSE-2.0
13  *
14  * Unless required by applicable law or agreed to in writing,
15  * software distributed under the License is distributed on an
16  * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
17  * KIND, either express or implied.  See the License for the
18  * specific language governing permissions and limitations
19  * under the License.
20  */
21
22 import com.opensymphony.xwork.ModelDriven;
23 import com.opensymphony.xwork.Preparable;
24 import org.apache.maven.archiva.security.ArchivaRoleConstants;
25 import org.apache.maven.archiva.web.action.AbstractConfiguredAction;
26 //import org.apache.maven.artifact.metadata.ArtifactMetadataRetrievalException;
27 //import org.apache.maven.model.Model;
28 //import org.apache.maven.project.ProjectBuildingException;
29 //import org.apache.maven.shared.app.company.CompanyPomHandler;
30 //import org.apache.maven.shared.app.configuration.Configuration;
31 //import org.apache.maven.shared.app.configuration.MavenAppConfiguration;
32 import org.codehaus.plexus.registry.RegistryException;
33 import org.codehaus.plexus.security.rbac.Resource;
34 import org.codehaus.plexus.security.ui.web.interceptor.SecureAction;
35 import org.codehaus.plexus.security.ui.web.interceptor.SecureActionBundle;
36 import org.codehaus.plexus.security.ui.web.interceptor.SecureActionException;
37
38 import java.io.IOException;
39
40 /**
41  * @author <a href="mailto:brett@apache.org">Brett Porter</a>
42  * @version $Id: ConfigurationAction.java 480950 2006-11-30 14:58:35Z evenisse $
43  * @TODO plexus.component role="com.opensymphony.xwork.Action"
44  * role-hint="configureAppearance"
45  */
46 public class ConfigureAppearanceAction
47     extends AbstractConfiguredAction
48     implements ModelDriven, SecureAction, Preparable
49 {
50 //    /**
51 //     * @plexus.requirement
52 //     */
53 //    private MavenAppConfiguration appConfigurationStore;
54 //
55 //    /**
56 //     * The configuration.
57 //     */
58 //    private Configuration configuration;
59 //
60 //    private Model companyModel;
61 //
62 //    /**
63 //     * @plexus.requirement
64 //     */
65 //    private CompanyPomHandler companyPomHandler;
66 //
67     public String execute()
68         throws IOException, RegistryException
69     {
70 //        appConfigurationStore.save( configuration );
71
72         return SUCCESS;
73     }
74
75     public Object getModel()
76     {
77         return new Object();
78 //        return configuration;
79     }
80
81     public void prepare()
82 //        throws ProjectBuildingException, ArtifactMetadataRetrievalException
83     {
84 //        configuration = appConfigurationStore.getConfiguration();
85 //
86 //        companyModel = companyPomHandler.getCompanyPomModel( configuration.getCompanyPom(), createLocalRepository() );
87     }
88
89     public SecureActionBundle getSecureActionBundle()
90         throws SecureActionException
91     {
92         SecureActionBundle bundle = new SecureActionBundle();
93         bundle.setRequiresAuthentication( true );
94         bundle.addRequiredAuthorization( ArchivaRoleConstants.OPERATION_MANAGE_CONFIGURATION, Resource.GLOBAL );
95
96         return bundle;
97     }
98 //
99 //    public Model getCompanyModel()
100 //    {
101 //        return companyModel;
102 //    }
103 }