labs-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From simo...@apache.org
Subject svn commit: r763961 - in /labs/magma/trunk: foundation-basics/src/main/java/org/apache/magma/settings/ website-developer/src/main/java/org/apache/magma/website/developer/ website-developer/src/main/resources/org/apache/magma/website/developer/
Date Fri, 10 Apr 2009 15:26:32 GMT
Author: simoneg
Date: Fri Apr 10 15:26:28 2009
New Revision: 763961

URL: http://svn.apache.org/viewvc?rev=763961&view=rev
Log:
LABS-332 : make username lowercase and without spaces, just to be sure. Also enhanced developer
display of settings.

Modified:
    labs/magma/trunk/foundation-basics/src/main/java/org/apache/magma/settings/Settings.java
    labs/magma/trunk/website-developer/src/main/java/org/apache/magma/website/developer/DeveloperHandler.java
    labs/magma/trunk/website-developer/src/main/resources/org/apache/magma/website/developer/settings.vm

Modified: labs/magma/trunk/foundation-basics/src/main/java/org/apache/magma/settings/Settings.java
URL: http://svn.apache.org/viewvc/labs/magma/trunk/foundation-basics/src/main/java/org/apache/magma/settings/Settings.java?rev=763961&r1=763960&r2=763961&view=diff
==============================================================================
--- labs/magma/trunk/foundation-basics/src/main/java/org/apache/magma/settings/Settings.java
(original)
+++ labs/magma/trunk/foundation-basics/src/main/java/org/apache/magma/settings/Settings.java
Fri Apr 10 15:26:28 2009
@@ -62,6 +62,13 @@
 	static String environment = System.getProperty("magma.env", DEVEL_ENV);
 	static String username = System.getProperty("user.name");
 	
+	static {
+		if (username != null) {
+			username = username.replace(' ', '_');
+			username = username.toLowerCase();
+		}
+	}
+	
 	/**
 	 * Retrieves the value of a setting. If settings have not yet been loaded, they are loaded
when needed.
 	 * @param name The name of the setting property to retrieve.
@@ -147,6 +154,13 @@
 	public static String getEnvironment() {
 		return environment;
 	}
+	
+	/**
+	 * @return The current user.
+	 */
+	public static String getUser() {
+		return username;
+	}
 
 	/**
 	 * Sets the current environment name.

Modified: labs/magma/trunk/website-developer/src/main/java/org/apache/magma/website/developer/DeveloperHandler.java
URL: http://svn.apache.org/viewvc/labs/magma/trunk/website-developer/src/main/java/org/apache/magma/website/developer/DeveloperHandler.java?rev=763961&r1=763960&r2=763961&view=diff
==============================================================================
--- labs/magma/trunk/website-developer/src/main/java/org/apache/magma/website/developer/DeveloperHandler.java
(original)
+++ labs/magma/trunk/website-developer/src/main/java/org/apache/magma/website/developer/DeveloperHandler.java
Fri Apr 10 15:26:28 2009
@@ -64,6 +64,8 @@
 		VelocityHtmlProducer prod = new VelocityHtmlProducer();
 		prod.addParameter("sources", URLExplainer.explainAll(SettingsStats.getAll()));
 		prod.addParameter("settings", Settings.getAll());
+		prod.addParameter("magmaEnv", Settings.getEnvironment());
+		prod.addParameter("magmaUser", Settings.getUser());
 		return prod;
 	}
 	

Modified: labs/magma/trunk/website-developer/src/main/resources/org/apache/magma/website/developer/settings.vm
URL: http://svn.apache.org/viewvc/labs/magma/trunk/website-developer/src/main/resources/org/apache/magma/website/developer/settings.vm?rev=763961&r1=763960&r2=763961&view=diff
==============================================================================
--- labs/magma/trunk/website-developer/src/main/resources/org/apache/magma/website/developer/settings.vm
(original)
+++ labs/magma/trunk/website-developer/src/main/resources/org/apache/magma/website/developer/settings.vm
Fri Apr 10 15:26:28 2009
@@ -16,6 +16,12 @@
 limitations under the License.
 -->
 	<h1>Magma settings</h1>
+	<h2>Environment</h2>
+	<p>
+		Magma env : $magmaEnv<br/>
+		Magma user : $magmaUser<br/>
+	</p>
+	<h2>Settings</h2>
 	<p>These are all the settings files currently loaded by magma. 
 	Please note the order in which they appear, cause it's the order they are loaded, so
 	if the same property is declared in more than one file the newer one will override the older
one</p>



---------------------------------------------------------------------
To unsubscribe, e-mail: commits-unsubscribe@labs.apache.org
For additional commands, e-mail: commits-help@labs.apache.org


Mime
View raw message