maven-doxia-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From denn...@apache.org
Subject svn commit: r1055222 - in /maven/doxia/doxia-sitetools/trunk/doxia-site-renderer/src/main/java/org/apache/maven/doxia/siterenderer: DefaultSiteRenderer.java SiteRenderingContext.java
Date Tue, 04 Jan 2011 22:38:42 GMT
Author: dennisl
Date: Tue Jan  4 22:38:41 2011
New Revision: 1055222

URL: http://svn.apache.org/viewvc?rev=1055222&view=rev
Log:
[DOXIASITETOOLS-40] List of site locales should be available in the rendering context.
Submitted by: Yevgeny Nyden
Reviewed by: Dennis Lundberg

Modified:
    maven/doxia/doxia-sitetools/trunk/doxia-site-renderer/src/main/java/org/apache/maven/doxia/siterenderer/DefaultSiteRenderer.java
    maven/doxia/doxia-sitetools/trunk/doxia-site-renderer/src/main/java/org/apache/maven/doxia/siterenderer/SiteRenderingContext.java

Modified: maven/doxia/doxia-sitetools/trunk/doxia-site-renderer/src/main/java/org/apache/maven/doxia/siterenderer/DefaultSiteRenderer.java
URL: http://svn.apache.org/viewvc/maven/doxia/doxia-sitetools/trunk/doxia-site-renderer/src/main/java/org/apache/maven/doxia/siterenderer/DefaultSiteRenderer.java?rev=1055222&r1=1055221&r2=1055222&view=diff
==============================================================================
--- maven/doxia/doxia-sitetools/trunk/doxia-site-renderer/src/main/java/org/apache/maven/doxia/siterenderer/DefaultSiteRenderer.java
(original)
+++ maven/doxia/doxia-sitetools/trunk/doxia-site-renderer/src/main/java/org/apache/maven/doxia/siterenderer/DefaultSiteRenderer.java
Tue Jan  4 22:38:41 2011
@@ -42,6 +42,7 @@ import java.text.SimpleDateFormat;
 
 import java.util.Arrays;
 import java.util.Collection;
+import java.util.Collections;
 import java.util.Date;
 import java.util.Enumeration;
 import java.util.Iterator;
@@ -488,7 +489,8 @@ public class DefaultSiteRenderer
         context.put( "alignedFileName", PathTool.calculateLink( currentFileName, renderingContext.getRelativePath()
) );
 
         context.put( "locale", locale );
-
+        context.put( "supportedLocales", Collections.unmodifiableList( siteRenderingContext.getSiteLocales()
) );
+                                        
         // Add user properties
         Map templateProperties = siteRenderingContext.getTemplateProperties();
 

Modified: maven/doxia/doxia-sitetools/trunk/doxia-site-renderer/src/main/java/org/apache/maven/doxia/siterenderer/SiteRenderingContext.java
URL: http://svn.apache.org/viewvc/maven/doxia/doxia-sitetools/trunk/doxia-site-renderer/src/main/java/org/apache/maven/doxia/siterenderer/SiteRenderingContext.java?rev=1055222&r1=1055221&r2=1055222&view=diff
==============================================================================
--- maven/doxia/doxia-sitetools/trunk/doxia-site-renderer/src/main/java/org/apache/maven/doxia/siterenderer/SiteRenderingContext.java
(original)
+++ maven/doxia/doxia-sitetools/trunk/doxia-site-renderer/src/main/java/org/apache/maven/doxia/siterenderer/SiteRenderingContext.java
Tue Jan  4 22:38:41 2011
@@ -50,6 +50,8 @@ public class SiteRenderingContext
 
     private Locale locale = Locale.getDefault();
 
+    private List siteLocales = new ArrayList();
+
     private DecorationModel decoration;
 
     private String defaultWindowTitle;
@@ -159,6 +161,25 @@ public class SiteRenderingContext
         this.locale = locale;
     }
 
+   /**
+     * <p>Getter for the field <code>siteLocales</code> -
+     * a list of locales available for this site context.</p>
+     *
+     * @return a {@link java.util.List} object with {@link java.util.Locale} objects.
+     */
+    public List getSiteLocales() {
+        return siteLocales;
+    }
+
+   /**
+    * <p>Adds passed locales to the list of site locales.</p>
+    *
+    * @param locales List of {@link java.util.Locale} objects to add to the site locales
list.
+    */
+    public void addSiteLocales( List locales ) {
+        siteLocales.addAll( locales );
+    }
+
     /**
      * <p>Getter for the field <code>decoration</code>.</p>
      *



Mime
View raw message