continuum-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From br...@apache.org
Subject svn commit: r506475 - in /maven/continuum/trunk/continuum-webapp/src/main: java/org/apache/maven/continuum/web/action/admin/ java/org/apache/maven/continuum/web/action/component/ resources/META-INF/plexus/
Date Mon, 12 Feb 2007 15:13:53 GMT
Author: brett
Date: Mon Feb 12 07:13:52 2007
New Revision: 506475

URL: http://svn.apache.org/viewvc?view=rev&rev=506475
Log:
use a registry based config for shared config

Modified:
    maven/continuum/trunk/continuum-webapp/src/main/java/org/apache/maven/continuum/web/action/admin/ConfigureAppearanceAction.java
    maven/continuum/trunk/continuum-webapp/src/main/java/org/apache/maven/continuum/web/action/admin/EditPomAction.java
    maven/continuum/trunk/continuum-webapp/src/main/java/org/apache/maven/continuum/web/action/component/CompanyInfoAction.java
    maven/continuum/trunk/continuum-webapp/src/main/resources/META-INF/plexus/application.xml

Modified: maven/continuum/trunk/continuum-webapp/src/main/java/org/apache/maven/continuum/web/action/admin/ConfigureAppearanceAction.java
URL: http://svn.apache.org/viewvc/maven/continuum/trunk/continuum-webapp/src/main/java/org/apache/maven/continuum/web/action/admin/ConfigureAppearanceAction.java?view=diff&rev=506475&r1=506474&r2=506475
==============================================================================
--- maven/continuum/trunk/continuum-webapp/src/main/java/org/apache/maven/continuum/web/action/admin/ConfigureAppearanceAction.java
(original)
+++ maven/continuum/trunk/continuum-webapp/src/main/java/org/apache/maven/continuum/web/action/admin/ConfigureAppearanceAction.java
Mon Feb 12 07:13:52 2007
@@ -19,25 +19,6 @@
  * under the License.
  */
 
-/*
- * Licensed to the Apache Software Foundation (ASF) under one
- * or more contributor license agreements.  See the NOTICE file
- * distributed with this work for additional information
- * regarding copyright ownership.  The ASF licenses this file
- * to you under the Apache License, Version 2.0 (the
- * "License"); you may not use this file except in compliance
- * with the License.  You may obtain a copy of the License at
- *
- *   http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing,
- * software distributed under the License is distributed on an
- * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
- * KIND, either express or implied.  See the License for the
- * specific language governing permissions and limitations
- * under the License.
- */
-
 import com.opensymphony.xwork.ModelDriven;
 import org.apache.maven.artifact.metadata.ArtifactMetadataRetrievalException;
 import org.apache.maven.continuum.execution.maven.m2.MavenBuilderHelper;
@@ -48,10 +29,8 @@
 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;
@@ -72,7 +51,7 @@
     /**
      * @plexus.requirement
      */
-    private ConfigurationStore configurationStore;
+    private MavenAppConfiguration appConfiguration;
 
     /**
      * The configuration.
@@ -92,9 +71,9 @@
     private MavenBuilderHelper helper;
 
     public String execute()
-        throws IOException, ConfigurationStoreException, InvalidConfigurationException, ConfigurationChangeException
+        throws IOException, RegistryException
     {
-        configurationStore.storeConfiguration( configuration );
+        appConfiguration.save( configuration );
 
         return SUCCESS;
     }
@@ -105,10 +84,9 @@
     }
 
     public void prepare()
-        throws ConfigurationStoreException, ProjectBuildingException, ArtifactMetadataRetrievalException,
-        SettingsConfigurationException
+        throws ProjectBuildingException, ArtifactMetadataRetrievalException, SettingsConfigurationException
     {
-        configuration = configurationStore.getConfigurationFromStore();
+        configuration = appConfiguration.getConfiguration();
 
         companyModel =
             companyPomHandler.getCompanyPomModel( configuration.getCompanyPom(), helper.getLocalRepository()
);

Modified: maven/continuum/trunk/continuum-webapp/src/main/java/org/apache/maven/continuum/web/action/admin/EditPomAction.java
URL: http://svn.apache.org/viewvc/maven/continuum/trunk/continuum-webapp/src/main/java/org/apache/maven/continuum/web/action/admin/EditPomAction.java?view=diff&rev=506475&r1=506474&r2=506475
==============================================================================
--- maven/continuum/trunk/continuum-webapp/src/main/java/org/apache/maven/continuum/web/action/admin/EditPomAction.java
(original)
+++ maven/continuum/trunk/continuum-webapp/src/main/java/org/apache/maven/continuum/web/action/admin/EditPomAction.java
Mon Feb 12 07:13:52 2007
@@ -19,25 +19,6 @@
  * under the License.
  */
 
-/*
- * Licensed to the Apache Software Foundation (ASF) under one
- * or more contributor license agreements.  See the NOTICE file
- * distributed with this work for additional information
- * regarding copyright ownership.  The ASF licenses this file
- * to you under the Apache License, Version 2.0 (the
- * "License"); you may not use this file except in compliance
- * with the License.  You may obtain a copy of the License at
- *
- *   http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing,
- * software distributed under the License is distributed on an
- * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
- * KIND, either express or implied.  See the License for the
- * specific language governing permissions and limitations
- * under the License.
- */
-
 import com.opensymphony.xwork.ModelDriven;
 import org.apache.maven.artifact.installer.ArtifactInstallationException;
 import org.apache.maven.artifact.metadata.ArtifactMetadataRetrievalException;
@@ -50,10 +31,7 @@
 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;
@@ -74,7 +52,7 @@
     /**
      * @plexus.requirement
      */
-    private ConfigurationStore configurationStore;
+    private MavenAppConfiguration appConfiguration;
 
     /**
      * The configuration.
@@ -94,8 +72,7 @@
     private MavenBuilderHelper helper;
 
     public String execute()
-        throws IOException, ConfigurationStoreException, InvalidConfigurationException, ConfigurationChangeException,
-        ArtifactInstallationException, SettingsConfigurationException
+        throws IOException, ArtifactInstallationException, SettingsConfigurationException
     {
         // TODO: hack for passed in String[]
         String[] logo = (String[]) companyModel.getProperties().get( "organization.logo"
);
@@ -115,10 +92,9 @@
     }
 
     public void prepare()
-        throws ConfigurationStoreException, ProjectBuildingException, ArtifactMetadataRetrievalException,
-        SettingsConfigurationException
+        throws ProjectBuildingException, ArtifactMetadataRetrievalException, SettingsConfigurationException
     {
-        configuration = configurationStore.getConfigurationFromStore();
+        configuration = appConfiguration.getConfiguration();
 
         CompanyPom companyPom = configuration.getCompanyPom();
         companyModel = companyPomHandler.getCompanyPomModel( companyPom, helper.getLocalRepository()
);

Modified: maven/continuum/trunk/continuum-webapp/src/main/java/org/apache/maven/continuum/web/action/component/CompanyInfoAction.java
URL: http://svn.apache.org/viewvc/maven/continuum/trunk/continuum-webapp/src/main/java/org/apache/maven/continuum/web/action/component/CompanyInfoAction.java?view=diff&rev=506475&r1=506474&r2=506475
==============================================================================
--- maven/continuum/trunk/continuum-webapp/src/main/java/org/apache/maven/continuum/web/action/component/CompanyInfoAction.java
(original)
+++ maven/continuum/trunk/continuum-webapp/src/main/java/org/apache/maven/continuum/web/action/component/CompanyInfoAction.java
Mon Feb 12 07:13:52 2007
@@ -19,30 +19,11 @@
  * under the License.
  */
 
-/*
- * Licensed to the Apache Software Foundation (ASF) under one
- * or more contributor license agreements.  See the NOTICE file
- * distributed with this work for additional information
- * regarding copyright ownership.  The ASF licenses this file
- * to you under the Apache License, Version 2.0 (the
- * "License"); you may not use this file except in compliance
- * with the License.  You may obtain a copy of the License at
- *
- *   http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing,
- * software distributed under the License is distributed on an
- * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
- * KIND, either express or implied.  See the License for the
- * specific language governing permissions and limitations
- * under the License.
- */
-
 import com.opensymphony.xwork.ActionSupport;
 import org.apache.maven.continuum.execution.maven.m2.MavenBuilderHelper;
 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.
@@ -66,7 +47,7 @@
     /**
      * @plexus.requirement
      */
-    private ConfigurationStore configurationStore;
+    private MavenAppConfiguration appConfiguration;
 
     /**
      * @plexus.requirement
@@ -76,7 +57,7 @@
     public String execute()
         throws Exception
     {
-        Model model = handler.getCompanyPomModel( configurationStore.getConfigurationFromStore().getCompanyPom(),
+        Model model = handler.getCompanyPomModel( appConfiguration.getConfiguration().getCompanyPom(),
                                                   helper.getLocalRepository() );
 
         if ( model != null )

Modified: maven/continuum/trunk/continuum-webapp/src/main/resources/META-INF/plexus/application.xml
URL: http://svn.apache.org/viewvc/maven/continuum/trunk/continuum-webapp/src/main/resources/META-INF/plexus/application.xml?view=diff&rev=506475&r1=506474&r2=506475
==============================================================================
--- maven/continuum/trunk/continuum-webapp/src/main/resources/META-INF/plexus/application.xml
(original)
+++ maven/continuum/trunk/continuum-webapp/src/main/resources/META-INF/plexus/application.xml
Mon Feb 12 07:13:52 2007
@@ -48,6 +48,37 @@
   </load-on-start>
 
   <components>
+    <component>
+      <role>org.codehaus.plexus.registry.Registry</role>
+      <implementation>org.codehaus.plexus.registry.CommonsConfigurationRegistry</implementation>
+      <role-hint>commons-configuration</role-hint>
+      <configuration>
+        <properties>
+          <system/>
+          <jndi prefix="java:comp/env" config-optional="true"/>
+          <xml fileName="${user.home}/.m2/continuum.xml" config-optional="true" config-name="org.apache.maven.continuum"
+               config-at="org.apache.maven.continuum" config-forceCreate="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/continuum.properties" config-optional="true"
+                      config-at="org.codehaus.plexus.security"/>
+          <xml fileName="${appserver.base}/conf/continuum.xml" config-optional="true"
+               config-at="org.apache.maven.continuum"/>
+          <xml fileName="${appserver.base}/conf/common.xml" config-optional="true"/>
+          <properties fileName="${appserver.base}/security.properties" config-optional="true"
+                      config-at="org.codehaus.plexus.security"/>
+          <xml fileName="${appserver.home}/conf/continuum.xml" config-optional="true"
+               config-at="org.apache.maven.continuum"/>
+          <xml fileName="${appserver.home}/conf/common.xml" config-optional="true"/>
+          <properties fileName="${appserver.home}/security.properties" config-optional="true"
+                      config-at="org.codehaus.plexus.security"/>
+        </properties>
+      </configuration>
+    </component>
+
     <!--
     | The XML-RPC service
     |-->
@@ -475,19 +506,6 @@
         </levels>
       </configuration>
     </component>
-
-    <component>
-      <role>org.codehaus.plexus.security.configuration.UserConfiguration</role>
-      <implementation>org.codehaus.plexus.security.configuration.UserConfiguration</implementation>
-      <configuration>
-        <configs>
-          <config>${user.home}/.m2/security.properties</config>
-          <config>${user.home}/.m2/continuum.properties</config>
-          <config>/org/apache/maven/continuum/security.properties</config>
-        </configs>
-      </configuration>
-    </component>
-
   </components>
 
   <!-- Override default configuration of components -->



Mime
View raw message