jspwiki-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From mets...@apache.org
Subject svn commit: r1664666 - in /jspwiki/trunk: ./ jspwiki-war/src/main/java/org/apache/wiki/ jspwiki-war/src/main/java/org/apache/wiki/auth/authorize/ jspwiki-war/src/main/java/org/apache/wiki/auth/user/ jspwiki-war/src/main/java/org/apache/wiki/util/
Date Fri, 06 Mar 2015 15:51:02 GMT
Author: metskem
Date: Fri Mar  6 15:51:01 2015
New Revision: 1664666

URL: http://svn.apache.org/r1664666
Log:
2015-03-06  Harry Metske (metskem@apache.org)

       * 2.10.2-svn-14

       * Fixed JSPWIKI-878 (following up JSPWIKI-660) you can now also use environment variables
to configure JSPWiki


Modified:
    jspwiki/trunk/ChangeLog
    jspwiki/trunk/jspwiki-war/src/main/java/org/apache/wiki/Release.java
    jspwiki/trunk/jspwiki-war/src/main/java/org/apache/wiki/auth/authorize/XMLGroupDatabase.java
    jspwiki/trunk/jspwiki-war/src/main/java/org/apache/wiki/auth/user/XMLUserDatabase.java
    jspwiki/trunk/jspwiki-war/src/main/java/org/apache/wiki/util/TextUtil.java

Modified: jspwiki/trunk/ChangeLog
URL: http://svn.apache.org/viewvc/jspwiki/trunk/ChangeLog?rev=1664666&r1=1664665&r2=1664666&view=diff
==============================================================================
--- jspwiki/trunk/ChangeLog (original)
+++ jspwiki/trunk/ChangeLog Fri Mar  6 15:51:01 2015
@@ -1,3 +1,9 @@
+2015-03-06  Harry Metske (metskem@apache.org)
+
+       * 2.10.2-svn-14
+
+       * Fixed JSPWIKI-878 (following up JSPWIKI-660) you can now also use environment variables
to configure JSPWiki
+
 2015-02-12  David Vittor ()
 
        * 2.10.2-svn-13

Modified: jspwiki/trunk/jspwiki-war/src/main/java/org/apache/wiki/Release.java
URL: http://svn.apache.org/viewvc/jspwiki/trunk/jspwiki-war/src/main/java/org/apache/wiki/Release.java?rev=1664666&r1=1664665&r2=1664666&view=diff
==============================================================================
--- jspwiki/trunk/jspwiki-war/src/main/java/org/apache/wiki/Release.java (original)
+++ jspwiki/trunk/jspwiki-war/src/main/java/org/apache/wiki/Release.java Fri Mar  6 15:51:01
2015
@@ -72,7 +72,7 @@ public final class Release {
      *  <p>
      *  If the build identifier is empty, it is not added.
      */
-    public static final String     BUILD         = "13";
+    public static final String     BUILD         = "14";
 
     /**
      *  This is the generic version string you should use when printing out the version.
 It is of 

Modified: jspwiki/trunk/jspwiki-war/src/main/java/org/apache/wiki/auth/authorize/XMLGroupDatabase.java
URL: http://svn.apache.org/viewvc/jspwiki/trunk/jspwiki-war/src/main/java/org/apache/wiki/auth/authorize/XMLGroupDatabase.java?rev=1664666&r1=1664665&r2=1664666&view=diff
==============================================================================
--- jspwiki/trunk/jspwiki-war/src/main/java/org/apache/wiki/auth/authorize/XMLGroupDatabase.java
(original)
+++ jspwiki/trunk/jspwiki-war/src/main/java/org/apache/wiki/auth/authorize/XMLGroupDatabase.java
Fri Mar  6 15:51:01 2015
@@ -39,6 +39,7 @@ import javax.xml.parsers.ParserConfigura
 
 import org.apache.commons.lang.StringEscapeUtils;
 import org.apache.log4j.Logger;
+import org.apache.wiki.util.TextUtil;
 import org.w3c.dom.Document;
 import org.w3c.dom.Element;
 import org.w3c.dom.NodeList;
@@ -192,7 +193,7 @@ public class XMLGroupDatabase implements
         }
 
         // Get database file location
-        String file = props.getProperty( PROP_DATABASE );
+        String file = TextUtil.getStringProperty(props, PROP_DATABASE , defaultFile.getAbsolutePath());
         if ( file == null )
         {
             log.warn( "XML group database property " + PROP_DATABASE + " not found; trying
" + defaultFile );

Modified: jspwiki/trunk/jspwiki-war/src/main/java/org/apache/wiki/auth/user/XMLUserDatabase.java
URL: http://svn.apache.org/viewvc/jspwiki/trunk/jspwiki-war/src/main/java/org/apache/wiki/auth/user/XMLUserDatabase.java?rev=1664666&r1=1664665&r2=1664666&view=diff
==============================================================================
--- jspwiki/trunk/jspwiki-war/src/main/java/org/apache/wiki/auth/user/XMLUserDatabase.java
(original)
+++ jspwiki/trunk/jspwiki-war/src/main/java/org/apache/wiki/auth/user/XMLUserDatabase.java
Fri Mar  6 15:51:01 2015
@@ -45,6 +45,7 @@ import org.apache.wiki.auth.NoSuchPrinci
 import org.apache.wiki.auth.WikiPrincipal;
 import org.apache.wiki.auth.WikiSecurityException;
 import org.apache.wiki.util.Serializer;
+import org.apache.wiki.util.TextUtil;
 import org.w3c.dom.Document;
 import org.w3c.dom.Element;
 import org.w3c.dom.Node;
@@ -282,7 +283,7 @@ public class XMLUserDatabase extends Abs
         }
 
         // Get database file location
-        String file = props.getProperty( PROP_USERDATABASE );
+        String file = TextUtil.getStringProperty(props, PROP_USERDATABASE, defaultFile.getAbsolutePath());
         if( file == null )
         {
             log.warn( "XML user database property " + PROP_USERDATABASE + " not found; trying
" + defaultFile  );

Modified: jspwiki/trunk/jspwiki-war/src/main/java/org/apache/wiki/util/TextUtil.java
URL: http://svn.apache.org/viewvc/jspwiki/trunk/jspwiki-war/src/main/java/org/apache/wiki/util/TextUtil.java?rev=1664666&r1=1664665&r2=1664666&view=diff
==============================================================================
--- jspwiki/trunk/jspwiki-war/src/main/java/org/apache/wiki/util/TextUtil.java (original)
+++ jspwiki/trunk/jspwiki-war/src/main/java/org/apache/wiki/util/TextUtil.java Fri Mar  6
15:51:01 2015
@@ -355,7 +355,10 @@ public final class TextUtil {
      *  @return The property value as an integer (or defVal).
      */
     public static int getIntegerProperty( Properties props,  String key, int defVal ) {
-        String val = System.getProperties().getProperty( key, props.getProperty( key ) );
+        String val = System.getProperties().getProperty(key, System.getenv(key));
+        if (val == null) {
+            val = props.getProperty(key);
+        }
         return parseIntParameter( val, defVal );
     }
 
@@ -375,7 +378,10 @@ public final class TextUtil {
      *  @since 2.0.11
      */
     public static boolean getBooleanProperty( Properties props, String key, boolean defval
) {
-        String val = System.getProperties().getProperty( key, props.getProperty( key ) );
+        String val = System.getProperties().getProperty(key, System.getenv(key));
+        if (val == null) {
+            val = props.getProperty(key);
+        }
         if( val == null ) {
             return defval;
         }
@@ -394,10 +400,13 @@ public final class TextUtil {
      *  @return The property value.
      *  @since 2.1.151
      */
-    public static String getStringProperty( Properties props, String key, String defval )
{
-        String val = System.getProperties().getProperty( key, props.getProperty( key ) );
-        if( val == null ) {
-        	return defval;
+    public static String getStringProperty(Properties props, String key, String defval) {
+        String val = System.getProperties().getProperty(key, System.getenv(key));
+        if (val == null) {
+            val = props.getProperty(key);
+        }
+        if (val == null) {
+            return defval;
         }
         return val.trim();
     }
@@ -416,7 +425,10 @@ public final class TextUtil {
     public static String getCanonicalFilePathProperty(Properties props, String key, String
defval) {
 
         String result;
-        String val = System.getProperties().getProperty( key, props.getProperty( key ) );
+        String val = System.getProperties().getProperty(key, System.getenv(key));
+        if (val == null) {
+            val = props.getProperty(key);
+        }
 
         if( val == null ) {
             val = defval;



Mime
View raw message