continuum-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From eveni...@apache.org
Subject svn commit: r280557 - in /maven/continuum/trunk: continuum-api/src/main/java/org/apache/maven/continuum/ continuum-api/src/main/java/org/apache/maven/continuum/configuration/ continuum-core/src/main/java/org/apache/maven/continuum/ continuum-plexus-app...
Date Tue, 13 Sep 2005 14:07:11 GMT
Author: evenisse
Date: Tue Sep 13 07:06:57 2005
New Revision: 280557

URL: http://svn.apache.org/viewcvs?rev=280557&view=rev
Log:
[CONTINUUM-280] configurable company logo, name and url

Modified:
    maven/continuum/trunk/continuum-api/src/main/java/org/apache/maven/continuum/Continuum.java
    maven/continuum/trunk/continuum-api/src/main/java/org/apache/maven/continuum/configuration/ConfigurationService.java
    maven/continuum/trunk/continuum-api/src/main/java/org/apache/maven/continuum/configuration/DefaultConfigurationService.java
    maven/continuum/trunk/continuum-core/src/main/java/org/apache/maven/continuum/DefaultContinuum.java
    maven/continuum/trunk/continuum-plexus-application/src/conf/configuration.xml
    maven/continuum/trunk/continuum-web/pom.xml
    maven/continuum/trunk/continuum-web/src/main/resources/templates/navigations/DefaultTop.vm

Modified: maven/continuum/trunk/continuum-api/src/main/java/org/apache/maven/continuum/Continuum.java
URL: http://svn.apache.org/viewcvs/maven/continuum/trunk/continuum-api/src/main/java/org/apache/maven/continuum/Continuum.java?rev=280557&r1=280556&r2=280557&view=diff
==============================================================================
--- maven/continuum/trunk/continuum-api/src/main/java/org/apache/maven/continuum/Continuum.java
(original)
+++ maven/continuum/trunk/continuum-api/src/main/java/org/apache/maven/continuum/Continuum.java
Tue Sep 13 07:06:57 2005
@@ -16,6 +16,7 @@
  * limitations under the License.
  */
 
+import org.apache.maven.continuum.configuration.ConfigurationService;
 import org.apache.maven.continuum.model.project.BuildDefinition;
 import org.apache.maven.continuum.model.project.BuildResult;
 import org.apache.maven.continuum.model.project.Project;
@@ -159,7 +160,7 @@
         throws ContinuumException;
 
     // ----------------------------------------------------------------------
-    // Build Definition
+    // Schedule
     // ----------------------------------------------------------------------
 
     Schedule getSchedule( int id )
@@ -178,5 +179,14 @@
         throws ContinuumException;
 
     void removeSchedule( int scheduleId )
+        throws ContinuumException;
+
+    // ----------------------------------------------------------------------
+    // Configuration
+    // ----------------------------------------------------------------------
+
+    ConfigurationService getConfiguration();
+
+    void reloadConfiguration()
         throws ContinuumException;
 }

Modified: maven/continuum/trunk/continuum-api/src/main/java/org/apache/maven/continuum/configuration/ConfigurationService.java
URL: http://svn.apache.org/viewcvs/maven/continuum/trunk/continuum-api/src/main/java/org/apache/maven/continuum/configuration/ConfigurationService.java?rev=280557&r1=280556&r2=280557&view=diff
==============================================================================
--- maven/continuum/trunk/continuum-api/src/main/java/org/apache/maven/continuum/configuration/ConfigurationService.java
(original)
+++ maven/continuum/trunk/continuum-api/src/main/java/org/apache/maven/continuum/configuration/ConfigurationService.java
Tue Sep 13 07:06:57 2005
@@ -41,6 +41,12 @@
 
     String CONFIGURATION_WORKING_DIRECTORY = "working-directory";
 
+    String CONFIGURATION_COMPANY_LOGO = "company-logo";
+
+    String CONFIGURATION_COMPANY_NAME = "company-name";
+
+    String CONFIGURATION_COMPANY_URL = "company-url";
+
     // ----------------------------------------------------------------------
     //
     // ----------------------------------------------------------------------
@@ -66,6 +72,18 @@
     void setInMemoryMode( boolean inMemoryMode );
 
     boolean inMemoryMode();
+
+    String getCompanyLogo();
+
+    void setCompanyLogo( String companyLogoUrl );
+
+    String getCompanyName();
+
+    void setCompanyName( String companyName );
+
+    String getCompanyUrl();
+
+    void setCompanyUrl( String companyUrl );
 
     // ----------------------------------------------------------------------
     //

Modified: maven/continuum/trunk/continuum-api/src/main/java/org/apache/maven/continuum/configuration/DefaultConfigurationService.java
URL: http://svn.apache.org/viewcvs/maven/continuum/trunk/continuum-api/src/main/java/org/apache/maven/continuum/configuration/DefaultConfigurationService.java?rev=280557&r1=280556&r2=280557&view=diff
==============================================================================
--- maven/continuum/trunk/continuum-api/src/main/java/org/apache/maven/continuum/configuration/DefaultConfigurationService.java
(original)
+++ maven/continuum/trunk/continuum-api/src/main/java/org/apache/maven/continuum/configuration/DefaultConfigurationService.java
Tue Sep 13 07:06:57 2005
@@ -71,6 +71,12 @@
 
     private Map jdks;
 
+    private String companyLogoUrl;
+
+    private String companyName;
+
+    private String companyUrl;
+
     private static final String LS = System.getProperty( "line.separator" );
 
     // ----------------------------------------------------------------------
@@ -132,6 +138,36 @@
         return inMemoryMode;
     }
 
+    public String getCompanyLogo()
+    {
+        return companyLogoUrl;
+    }
+
+    public void setCompanyLogo( String companyLogoUrl )
+    {
+        this.companyLogoUrl = companyLogoUrl;
+    }
+
+    public String getCompanyName()
+    {
+        return companyName;
+    }
+
+    public void setCompanyName( String companyName )
+    {
+        this.companyName = companyName;
+    }
+
+    public String getCompanyUrl()
+    {
+        return companyUrl;
+    }
+
+    public void setCompanyUrl( String companyUrl )
+    {
+        this.companyUrl = companyUrl;
+    }
+
     // ----------------------------------------------------------------------
     // Process configuration to glean application specific values
     // ----------------------------------------------------------------------
@@ -163,6 +199,27 @@
         }
 
         workingDirectory = getFile( configuration, CONFIGURATION_WORKING_DIRECTORY );
+
+        Xpp3Dom companyLogoUrlDom = configuration.getChild( CONFIGURATION_COMPANY_LOGO );
+
+        if ( companyLogoUrlDom != null )
+        {
+            companyLogoUrl = companyLogoUrlDom.getValue();
+        }
+
+        Xpp3Dom companyNameDom = configuration.getChild( CONFIGURATION_COMPANY_NAME );
+
+        if ( companyNameDom != null )
+        {
+            companyName = companyNameDom.getValue();
+        }
+
+        Xpp3Dom companyUrlDom = configuration.getChild( CONFIGURATION_COMPANY_URL );
+
+        if ( companyUrlDom != null )
+        {
+            companyUrl = companyUrlDom.getValue();
+        }
     }
 
     private File getFile( Xpp3Dom configuration, String elementName )
@@ -211,6 +268,11 @@
         if ( workingDirectory != null )
         {
             configuration.addChild( createFileDom( CONFIGURATION_WORKING_DIRECTORY, workingDirectory
) );
+        }
+
+        if ( companyLogoUrl != null )
+        {
+            configuration.addChild( createDom( CONFIGURATION_COMPANY_LOGO, companyLogoUrl
) );
         }
     }
 

Modified: maven/continuum/trunk/continuum-core/src/main/java/org/apache/maven/continuum/DefaultContinuum.java
URL: http://svn.apache.org/viewcvs/maven/continuum/trunk/continuum-core/src/main/java/org/apache/maven/continuum/DefaultContinuum.java?rev=280557&r1=280556&r2=280557&view=diff
==============================================================================
--- maven/continuum/trunk/continuum-core/src/main/java/org/apache/maven/continuum/DefaultContinuum.java
(original)
+++ maven/continuum/trunk/continuum-core/src/main/java/org/apache/maven/continuum/DefaultContinuum.java
Tue Sep 13 07:06:57 2005
@@ -870,6 +870,28 @@
     }
 
     // ----------------------------------------------------------------------
+    // Configuration
+    // ----------------------------------------------------------------------
+
+    public ConfigurationService getConfiguration()
+    {
+        return configurationService;
+    }
+
+    public void reloadConfiguration()
+        throws ContinuumException
+    {
+        try
+        {
+            configurationService.load();
+        }
+        catch( ConfigurationLoadingException e )
+        {
+            throw new ContinuumException( "Can't reload configuration.", e );
+        }
+    }
+
+    // ----------------------------------------------------------------------
     // Lifecycle Management
     // ----------------------------------------------------------------------
 

Modified: maven/continuum/trunk/continuum-plexus-application/src/conf/configuration.xml
URL: http://svn.apache.org/viewcvs/maven/continuum/trunk/continuum-plexus-application/src/conf/configuration.xml?rev=280557&r1=280556&r2=280557&view=diff
==============================================================================
--- maven/continuum/trunk/continuum-plexus-application/src/conf/configuration.xml (original)
+++ maven/continuum/trunk/continuum-plexus-application/src/conf/configuration.xml Tue Sep
13 07:06:57 2005
@@ -1,4 +1,9 @@
 <configuration>
   <url>http://localhost:8080/continuum/servlet/continuum</url>
   <working-directory>working-directory</working-directory>
+  <!--
+  <company-logo>/continuum/images/your_logo.png</company-logo>
+  <company-name>YOUR_COMPANY_NAME</company-name>
+  <company-url>http://your_url</company-url>
+  -->
 </configuration>

Modified: maven/continuum/trunk/continuum-web/pom.xml
URL: http://svn.apache.org/viewcvs/maven/continuum/trunk/continuum-web/pom.xml?rev=280557&r1=280556&r2=280557&view=diff
==============================================================================
--- maven/continuum/trunk/continuum-web/pom.xml (original)
+++ maven/continuum/trunk/continuum-web/pom.xml Tue Sep 13 07:06:57 2005
@@ -40,7 +40,7 @@
     <dependency>
       <groupId>plexus</groupId>
       <artifactId>plexus-formica-web</artifactId>
-      <version>1.0-alpha-3</version>
+      <version>1.0-alpha-4</version>
     </dependency>
     <dependency>
       <groupId>plexus</groupId>

Modified: maven/continuum/trunk/continuum-web/src/main/resources/templates/navigations/DefaultTop.vm
URL: http://svn.apache.org/viewcvs/maven/continuum/trunk/continuum-web/src/main/resources/templates/navigations/DefaultTop.vm?rev=280557&r1=280556&r2=280557&view=diff
==============================================================================
--- maven/continuum/trunk/continuum-web/src/main/resources/templates/navigations/DefaultTop.vm
(original)
+++ maven/continuum/trunk/continuum-web/src/main/resources/templates/navigations/DefaultTop.vm
Tue Sep 13 07:06:57 2005
@@ -3,9 +3,19 @@
     <tbody>
       <tr>
         <td>
-          <a href="http://www.apache.org/">
-            Your company logo here
-          </a>
+          #if ( $continuum.getConfiguration().getCompanyLogo() )
+            #if ( $continuum.getConfiguration().getCompanyUrl() )
+              <a href="$continuum.getConfiguration().getCompanyUrl()">
+            #end
+                <img src="$continuum.getConfiguration().getCompanyLogo()" #if ( $continuum.getConfiguration().getCompanyName()
) alt="$continuum.getConfiguration().getCompanyName()" #end>
+            #if ( $continuum.getConfiguration().getCompanyUrl() )
+              </a>
+            #end
+          #else
+            <a href="http://maven.apache.org/continuum/">
+              [Your company logo here]
+            </a>
+          #end
         </td>
         <td>
           <a href="http://maven.apache.org/continuum">



Mime
View raw message