You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@turbine.apache.org by tv...@apache.org on 2010/04/27 22:57:52 UTC
svn commit: r938645 - in /turbine/core/trunk/src/java/org/apache/turbine: ./
modules/actions/ modules/actions/sessionvalidator/ modules/screens/
om/security/ services/rundata/ services/security/ util/ util/template/
util/uri/ util/velocity/
Author: tv
Date: Tue Apr 27 20:57:51 2010
New Revision: 938645
URL: http://svn.apache.org/viewvc?rev=938645&view=rev
Log:
Big merge of 2.3.3 into trunk
Modified:
turbine/core/trunk/src/java/org/apache/turbine/Turbine.java
turbine/core/trunk/src/java/org/apache/turbine/TurbineConstants.java
turbine/core/trunk/src/java/org/apache/turbine/modules/actions/AccessController.java
turbine/core/trunk/src/java/org/apache/turbine/modules/actions/DefaultAction.java
turbine/core/trunk/src/java/org/apache/turbine/modules/actions/InitContextsAction.java
turbine/core/trunk/src/java/org/apache/turbine/modules/actions/LoginUser.java
turbine/core/trunk/src/java/org/apache/turbine/modules/actions/LogoutUser.java
turbine/core/trunk/src/java/org/apache/turbine/modules/actions/VelocityAction.java
turbine/core/trunk/src/java/org/apache/turbine/modules/actions/VelocitySecureAction.java
turbine/core/trunk/src/java/org/apache/turbine/modules/actions/sessionvalidator/DefaultSessionValidator.java
turbine/core/trunk/src/java/org/apache/turbine/modules/actions/sessionvalidator/SessionValidator.java
turbine/core/trunk/src/java/org/apache/turbine/modules/actions/sessionvalidator/TemplateSecureSessionValidator.java
turbine/core/trunk/src/java/org/apache/turbine/modules/actions/sessionvalidator/TemplateSessionValidator.java
turbine/core/trunk/src/java/org/apache/turbine/modules/screens/BaseJspScreen.java
turbine/core/trunk/src/java/org/apache/turbine/modules/screens/Error.java
turbine/core/trunk/src/java/org/apache/turbine/modules/screens/JspErrorScreen.java
turbine/core/trunk/src/java/org/apache/turbine/modules/screens/RawScreen.java
turbine/core/trunk/src/java/org/apache/turbine/modules/screens/TemplateScreen.java
turbine/core/trunk/src/java/org/apache/turbine/modules/screens/VelocityDirectScreen.java
turbine/core/trunk/src/java/org/apache/turbine/modules/screens/VelocityErrorScreen.java
turbine/core/trunk/src/java/org/apache/turbine/modules/screens/VelocityScreen.java
turbine/core/trunk/src/java/org/apache/turbine/modules/screens/VelocitySecureScreen.java
turbine/core/trunk/src/java/org/apache/turbine/om/security/Group.java
turbine/core/trunk/src/java/org/apache/turbine/om/security/Permission.java
turbine/core/trunk/src/java/org/apache/turbine/om/security/Role.java
turbine/core/trunk/src/java/org/apache/turbine/om/security/User.java
turbine/core/trunk/src/java/org/apache/turbine/services/rundata/DefaultTurbineRunData.java
turbine/core/trunk/src/java/org/apache/turbine/services/rundata/RunDataService.java
turbine/core/trunk/src/java/org/apache/turbine/services/rundata/TurbineRunData.java
turbine/core/trunk/src/java/org/apache/turbine/services/rundata/TurbineRunDataService.java
turbine/core/trunk/src/java/org/apache/turbine/services/security/SecurityService.java
turbine/core/trunk/src/java/org/apache/turbine/services/security/TurbineSecurity.java
turbine/core/trunk/src/java/org/apache/turbine/services/security/UserManager.java
turbine/core/trunk/src/java/org/apache/turbine/util/TimeSelector.java
turbine/core/trunk/src/java/org/apache/turbine/util/TurbineConfig.java
turbine/core/trunk/src/java/org/apache/turbine/util/TurbineRuntimeException.java
turbine/core/trunk/src/java/org/apache/turbine/util/TurbineXmlConfig.java
turbine/core/trunk/src/java/org/apache/turbine/util/template/HtmlPageAttributes.java
turbine/core/trunk/src/java/org/apache/turbine/util/template/TemplateInfo.java
turbine/core/trunk/src/java/org/apache/turbine/util/uri/DataURI.java
turbine/core/trunk/src/java/org/apache/turbine/util/uri/TurbineURI.java
turbine/core/trunk/src/java/org/apache/turbine/util/velocity/VelocityEmail.java
Modified: turbine/core/trunk/src/java/org/apache/turbine/Turbine.java
URL: http://svn.apache.org/viewvc/turbine/core/trunk/src/java/org/apache/turbine/Turbine.java?rev=938645&r1=938644&r2=938645&view=diff
==============================================================================
--- turbine/core/trunk/src/java/org/apache/turbine/Turbine.java (original)
+++ turbine/core/trunk/src/java/org/apache/turbine/Turbine.java Tue Apr 27 20:57:51 2010
@@ -26,6 +26,7 @@ import java.io.FileNotFoundException;
import java.io.FileReader;
import java.io.IOException;
import java.io.Reader;
+import java.io.UnsupportedEncodingException;
import java.util.Properties;
import javax.servlet.ServletConfig;
@@ -158,6 +159,9 @@ public class Turbine
/** Our internal configuration object */
private static Configuration configuration = null;
+ /** Default Input encoding if the servlet container does not report an encoding */
+ private String inputEncoding = null;
+
/** Logging class from commons.logging */
private static Log log = LogFactory.getLog(Turbine.class);
@@ -197,6 +201,7 @@ public class Turbine
throw new TurbineException(
"No Template Service configured!");
}
+
if (getRunDataService() == null)
{
throw new TurbineException(
@@ -211,6 +216,7 @@ public class Turbine
log.fatal("Turbine: init() failed: ", e);
throw new ServletException("Turbine: init() failed", e);
}
+
log.info("Turbine: init() Ready to Rumble!");
}
}
@@ -308,7 +314,7 @@ public class Turbine
// This should eventually be a Configuration
// interface so that service and app configuration
// can be stored anywhere.
- configuration = (Configuration) new PropertiesConfiguration(confPath);
+ configuration = new PropertiesConfiguration(confPath);
confStyle = "Properties";
}
@@ -319,36 +325,39 @@ public class Turbine
String log4jFile = configuration.getString(TurbineConstants.LOG4J_CONFIG_FILE,
TurbineConstants.LOG4J_CONFIG_FILE_DEFAULT);
- log4jFile = getRealPath(log4jFile);
-
- //
- // Load the config file above into a Properties object and
- // fix up the Application root
- //
- Properties p = new Properties();
- try
+ if (StringUtils.isNotEmpty(log4jFile) &&
+ !log4jFile.equalsIgnoreCase("none"))
{
- p.load(new FileInputStream(log4jFile));
- p.setProperty(TurbineConstants.APPLICATION_ROOT_KEY, getApplicationRoot());
- PropertyConfigurator.configure(p);
-
+ log4jFile = getRealPath(log4jFile);
+
//
- // Rebuild our log object with a configured commons-logging
- log = LogFactory.getLog(this.getClass());
-
- log.info("Configured log4j from " + log4jFile);
- }
- catch (FileNotFoundException fnf)
- {
- System.err.println("Could not open Log4J configuration file "
- + log4jFile + ": ");
- fnf.printStackTrace();
+ // Load the config file above into a Properties object and
+ // fix up the Application root
+ //
+ Properties p = new Properties();
+ try
+ {
+ p.load(new FileInputStream(log4jFile));
+ p.setProperty(TurbineConstants.APPLICATION_ROOT_KEY, getApplicationRoot());
+ PropertyConfigurator.configure(p);
+
+ //
+ // Rebuild our log object with a configured commons-logging
+ log = LogFactory.getLog(this.getClass());
+
+ log.info("Configured log4j from " + log4jFile);
+ }
+ catch (FileNotFoundException fnf)
+ {
+ System.err.println("Could not open Log4J configuration file "
+ + log4jFile + ": ");
+ fnf.printStackTrace();
+ }
}
// Now report our successful configuration to the world
log.info("Loaded configuration (" + confStyle + ") from " + confFile + " (" + confPath + ")");
-
setTurbineServletConfig(config);
setTurbineServletContext(context);
@@ -467,6 +476,32 @@ public class Turbine
}
/**
+ * Initializes the services which need <code>RunData</code> to
+ * initialize themselves (post startup).
+ *
+ * @param data The first <code>GET</code> request.
+ */
+ public final void init(PipelineData data)
+ {
+ synchronized (Turbine.class)
+ {
+ if (firstDoGet)
+ {
+ // All we want to do here is save some servlet
+ // information so that services and processes
+ // that don't have direct access to a RunData
+ // object can still know something about
+ // the servlet environment.
+ saveServletInfo(data);
+
+ // Mark that we're done.
+ firstDoGet = false;
+ log.info("Turbine: first Request successful");
+ }
+ }
+ }
+
+ /**
* Return the current configuration with all keys included
*
* @return a Configuration Object
@@ -532,19 +567,35 @@ public class Turbine
* Return all the Turbine Servlet information (Server Name, Port,
* Scheme in a ServerData structure. This is generated from the
* values set when initializing the Turbine and may not be correct
- * if you're running in a clustered structure. This might be used
- * if you need a DataURI and have no RunData object handy-
+ * if you're running in a clustered structure. You can provide default
+ * values in your configuration for cases where access is requied before
+ * your application is first accessed by a user. This might be used
+ * if you need a DataURI and have no RunData object handy.
*
* @return An initialized ServerData object
*/
public static ServerData getDefaultServerData()
{
- if(serverData == null)
+ if (serverData == null)
{
- log.error("ServerData Information requested from Turbine before first request!");
+ String serverName
+ = configuration.getString(TurbineConstants.DEFAULT_SERVER_NAME_KEY);
+ if (serverName == null)
+ {
+ log.error("ServerData Information requested from Turbine before first request!");
+ }
+ else
+ {
+ log.info("ServerData Information retrieved from configuration.");
+ }
// Will be overwritten once the first request is run;
- serverData = new ServerData(null, URIConstants.HTTP_PORT,
- URIConstants.HTTP, null, null);
+ serverData = new ServerData(serverName,
+ configuration.getInt(TurbineConstants.DEFAULT_SERVER_PORT_KEY,
+ URIConstants.HTTP_PORT),
+ configuration.getString(TurbineConstants.DEFAULT_SERVER_SCHEME_KEY,
+ URIConstants.HTTP),
+ configuration.getString(TurbineConstants.DEFAULT_SCRIPT_NAME_KEY),
+ configuration.getString(TurbineConstants.DEFAULT_CONTEXT_PATH_KEY));
}
return serverData;
}
@@ -615,13 +666,8 @@ public class Turbine
public final void doGet(HttpServletRequest req, HttpServletResponse res)
throws IOException, ServletException
{
- // set to true if the request is to be redirected by the page
- boolean requestRedirected = false;
-
- // Placeholder for the RunData object.
- //RunData data = null;
+ PipelineData pipelineData = null;
- PipelineData pipelineData = null;//new DefaultPipelineData();
try
{
// Check to make sure that we started up properly.
@@ -629,25 +675,27 @@ public class Turbine
{
throw initFailure;
}
- // If this is the first invocation, perform some
- // initialization. Certain services need RunData to initialize
- // themselves.
- if (firstDoGet)
+
+ //
+ // If the servlet container gives us no clear indication about the
+ // Encoding of the contents, set it to our default value.
+ if (req.getCharacterEncoding() == null)
{
- synchronized (Turbine.class)
+ if (log.isDebugEnabled())
{
- // Store the context path for tools like ContentURI and
- // the UIManager that use webapp context path information
- // for constructing URLs.
- serverData = new ServerData(req);
-
- // Mark that we're done.
- firstDoGet = false;
- log.info("Turbine: first Request successful");
+ log.debug("Changing Input Encoding to " + inputEncoding);
}
+ try
+ {
+ req.setCharacterEncoding(inputEncoding);
+ }
+ catch (UnsupportedEncodingException uee)
+ {
+ log.warn("Could not change request encoding to " + inputEncoding, uee);
+ }
}
-
+
// Get general RunData here...
// Perform turbine specific initialization below.
pipelineData = getRunDataService().getRunData(req, res, getServletConfig());
@@ -656,6 +704,14 @@ public class Turbine
// put the data into the pipeline
// pipelineData.put(RunData.class, runDataMap);
+ // If this is the first invocation, perform some
+ // initialization. Certain services need RunData to initialize
+ // themselves.
+ if (firstDoGet)
+ {
+ init(pipelineData);
+ }
+
// Stages of Pipeline implementation execution
// configurable via attached Valve implementations in a
// XML properties file.
@@ -717,7 +773,7 @@ public class Turbine
private final void handleException(PipelineData pipelineData, HttpServletResponse res,
Throwable t)
{
- RunData data = (RunData)getRunData(pipelineData);
+ RunData data = getRunData(pipelineData);
// make sure that the stack trace makes it the log
log.error("Turbine.handleException: ", t);
@@ -763,6 +819,7 @@ public class Turbine
}
catch (Exception ignored)
{
+ // ignore
}
try
@@ -772,6 +829,7 @@ public class Turbine
}
catch (IOException ignored)
{
+ // ignore
}
log.error(data.getStackTrace(), e);
@@ -797,6 +855,7 @@ public class Turbine
}
catch (Exception ignored)
{
+ // ignore
}
log.error(reallyScrewedNow.getMessage(), reallyScrewedNow);
@@ -804,6 +863,26 @@ public class Turbine
}
/**
+ * Save some information about this servlet so that
+ * it can be utilized by object instances that do not
+ * have direct access to RunData.
+ *
+ * @param data Turbine request data
+ */
+ public static synchronized void saveServletInfo(PipelineData data)
+ {
+ // Store the context path for tools like ContentURI and
+ // the UIManager that use webapp context path information
+ // for constructing URLs.
+
+ //
+ // Bundle all the information above up into a convenient structure
+ //
+ ServerData requestServerData = (ServerData) data.get(ServerData.class);
+ serverData = (ServerData) requestServerData.clone();
+ }
+
+ /**
* Set the application root for the webapp.
*
* @param val New app root.
@@ -872,7 +951,8 @@ public class Turbine
* Static Helper method for looking up the RunDataService
* @return A RunDataService
*/
- private static RunDataService getRunDataService(){
+ private static RunDataService getRunDataService()
+ {
return (RunDataService) TurbineServices
.getInstance().getService(RunDataService.SERVICE_NAME);
}
Modified: turbine/core/trunk/src/java/org/apache/turbine/TurbineConstants.java
URL: http://svn.apache.org/viewvc/turbine/core/trunk/src/java/org/apache/turbine/TurbineConstants.java?rev=938645&r1=938644&r2=938645&view=diff
==============================================================================
--- turbine/core/trunk/src/java/org/apache/turbine/TurbineConstants.java (original)
+++ turbine/core/trunk/src/java/org/apache/turbine/TurbineConstants.java Tue Apr 27 20:57:51 2010
@@ -285,11 +285,36 @@ public interface TurbineConstants
/** Context Key for the Stack Trace */
String STACK_TRACE_PLACEHOLDER = "stackTrace";
+ /** Encoding for Parameter Parser */
+ String PARAMETER_ENCODING_KEY = "input.encoding";
+
+ /** Default Encoding for Parameter Parser */
+ String PARAMETER_ENCODING_DEFAULT = "ISO-8859-1";
+
+ /** Default serverName for ServerData */
+ String DEFAULT_SERVER_NAME_KEY
+ = "serverdata.default.serverName";
+
+ /** Default serverPort for ServerData */
+ String DEFAULT_SERVER_PORT_KEY
+ = "serverdata.default.serverPort";
+
+ /** Default serverScheme for ServerData */
+ String DEFAULT_SERVER_SCHEME_KEY
+ = "serverdata.default.serverScheme";
+
+ /** Default scriptName for ServerData */
+ String DEFAULT_SCRIPT_NAME_KEY
+ = "serverdata.default.scriptName";
+
+ /** Default contextPath for ServerData */
+ String DEFAULT_CONTEXT_PATH_KEY
+ = "serverdata.default.contextPath";
+
/**
* The fully qualified class name of the default {@link
* org.apache.turbine.Pipeline} implementation to use in the
* {@link org.apache.turbine.Turbine} servlet.
*/
- public static final String STANDARD_PIPELINE =
- TurbinePipeline.class.getName();
+ String STANDARD_PIPELINE = TurbinePipeline.class.getName();
}
Modified: turbine/core/trunk/src/java/org/apache/turbine/modules/actions/AccessController.java
URL: http://svn.apache.org/viewvc/turbine/core/trunk/src/java/org/apache/turbine/modules/actions/AccessController.java?rev=938645&r1=938644&r2=938645&view=diff
==============================================================================
--- turbine/core/trunk/src/java/org/apache/turbine/modules/actions/AccessController.java (original)
+++ turbine/core/trunk/src/java/org/apache/turbine/modules/actions/AccessController.java Tue Apr 27 20:57:51 2010
@@ -1,6 +1,5 @@
package org.apache.turbine.modules.actions;
-
/*
* Licensed to the Apache Software Foundation (ASF) under one
* or more contributor license agreements. See the NOTICE file
@@ -20,7 +19,6 @@ package org.apache.turbine.modules.actio
* under the License.
*/
-
import org.apache.commons.logging.Log;
import org.apache.commons.logging.LogFactory;
Modified: turbine/core/trunk/src/java/org/apache/turbine/modules/actions/DefaultAction.java
URL: http://svn.apache.org/viewvc/turbine/core/trunk/src/java/org/apache/turbine/modules/actions/DefaultAction.java?rev=938645&r1=938644&r2=938645&view=diff
==============================================================================
--- turbine/core/trunk/src/java/org/apache/turbine/modules/actions/DefaultAction.java (original)
+++ turbine/core/trunk/src/java/org/apache/turbine/modules/actions/DefaultAction.java Tue Apr 27 20:57:51 2010
@@ -1,6 +1,5 @@
package org.apache.turbine.modules.actions;
-
/*
* Licensed to the Apache Software Foundation (ASF) under one
* or more contributor license agreements. See the NOTICE file
Modified: turbine/core/trunk/src/java/org/apache/turbine/modules/actions/InitContextsAction.java
URL: http://svn.apache.org/viewvc/turbine/core/trunk/src/java/org/apache/turbine/modules/actions/InitContextsAction.java?rev=938645&r1=938644&r2=938645&view=diff
==============================================================================
--- turbine/core/trunk/src/java/org/apache/turbine/modules/actions/InitContextsAction.java (original)
+++ turbine/core/trunk/src/java/org/apache/turbine/modules/actions/InitContextsAction.java Tue Apr 27 20:57:51 2010
@@ -1,6 +1,5 @@
package org.apache.turbine.modules.actions;
-
/*
* Licensed to the Apache Software Foundation (ASF) under one
* or more contributor license agreements. See the NOTICE file
@@ -20,7 +19,6 @@ package org.apache.turbine.modules.actio
* under the License.
*/
-
import java.util.Hashtable;
import java.util.Iterator;
import java.util.Properties;
Modified: turbine/core/trunk/src/java/org/apache/turbine/modules/actions/LoginUser.java
URL: http://svn.apache.org/viewvc/turbine/core/trunk/src/java/org/apache/turbine/modules/actions/LoginUser.java?rev=938645&r1=938644&r2=938645&view=diff
==============================================================================
--- turbine/core/trunk/src/java/org/apache/turbine/modules/actions/LoginUser.java (original)
+++ turbine/core/trunk/src/java/org/apache/turbine/modules/actions/LoginUser.java Tue Apr 27 20:57:51 2010
@@ -1,6 +1,5 @@
package org.apache.turbine.modules.actions;
-
/*
* Licensed to the Apache Software Foundation (ASF) under one
* or more contributor license agreements. See the NOTICE file
@@ -20,7 +19,6 @@ package org.apache.turbine.modules.actio
* under the License.
*/
-
import org.apache.commons.configuration.Configuration;
import org.apache.commons.lang.StringUtils;
Modified: turbine/core/trunk/src/java/org/apache/turbine/modules/actions/LogoutUser.java
URL: http://svn.apache.org/viewvc/turbine/core/trunk/src/java/org/apache/turbine/modules/actions/LogoutUser.java?rev=938645&r1=938644&r2=938645&view=diff
==============================================================================
--- turbine/core/trunk/src/java/org/apache/turbine/modules/actions/LogoutUser.java (original)
+++ turbine/core/trunk/src/java/org/apache/turbine/modules/actions/LogoutUser.java Tue Apr 27 20:57:51 2010
@@ -1,6 +1,5 @@
package org.apache.turbine.modules.actions;
-
/*
* Licensed to the Apache Software Foundation (ASF) under one
* or more contributor license agreements. See the NOTICE file
@@ -20,7 +19,6 @@ package org.apache.turbine.modules.actio
* under the License.
*/
-
import org.apache.commons.configuration.Configuration;
import org.apache.turbine.Turbine;
Modified: turbine/core/trunk/src/java/org/apache/turbine/modules/actions/VelocityAction.java
URL: http://svn.apache.org/viewvc/turbine/core/trunk/src/java/org/apache/turbine/modules/actions/VelocityAction.java?rev=938645&r1=938644&r2=938645&view=diff
==============================================================================
--- turbine/core/trunk/src/java/org/apache/turbine/modules/actions/VelocityAction.java (original)
+++ turbine/core/trunk/src/java/org/apache/turbine/modules/actions/VelocityAction.java Tue Apr 27 20:57:51 2010
@@ -1,6 +1,5 @@
package org.apache.turbine.modules.actions;
-
/*
* Licensed to the Apache Software Foundation (ASF) under one
* or more contributor license agreements. See the NOTICE file
@@ -20,7 +19,6 @@ package org.apache.turbine.modules.actio
* under the License.
*/
-
import org.apache.turbine.modules.screens.TemplateScreen;
import org.apache.turbine.pipeline.PipelineData;
import org.apache.turbine.services.velocity.TurbineVelocity;
Modified: turbine/core/trunk/src/java/org/apache/turbine/modules/actions/VelocitySecureAction.java
URL: http://svn.apache.org/viewvc/turbine/core/trunk/src/java/org/apache/turbine/modules/actions/VelocitySecureAction.java?rev=938645&r1=938644&r2=938645&view=diff
==============================================================================
--- turbine/core/trunk/src/java/org/apache/turbine/modules/actions/VelocitySecureAction.java (original)
+++ turbine/core/trunk/src/java/org/apache/turbine/modules/actions/VelocitySecureAction.java Tue Apr 27 20:57:51 2010
@@ -1,6 +1,5 @@
package org.apache.turbine.modules.actions;
-
/*
* Licensed to the Apache Software Foundation (ASF) under one
* or more contributor license agreements. See the NOTICE file
Modified: turbine/core/trunk/src/java/org/apache/turbine/modules/actions/sessionvalidator/DefaultSessionValidator.java
URL: http://svn.apache.org/viewvc/turbine/core/trunk/src/java/org/apache/turbine/modules/actions/sessionvalidator/DefaultSessionValidator.java?rev=938645&r1=938644&r2=938645&view=diff
==============================================================================
--- turbine/core/trunk/src/java/org/apache/turbine/modules/actions/sessionvalidator/DefaultSessionValidator.java (original)
+++ turbine/core/trunk/src/java/org/apache/turbine/modules/actions/sessionvalidator/DefaultSessionValidator.java Tue Apr 27 20:57:51 2010
@@ -1,6 +1,5 @@
package org.apache.turbine.modules.actions.sessionvalidator;
-
/*
* Licensed to the Apache Software Foundation (ASF) under one
* or more contributor license agreements. See the NOTICE file
@@ -20,7 +19,6 @@ package org.apache.turbine.modules.actio
* under the License.
*/
-
import org.apache.commons.configuration.Configuration;
import org.apache.commons.lang.StringUtils;
Modified: turbine/core/trunk/src/java/org/apache/turbine/modules/actions/sessionvalidator/SessionValidator.java
URL: http://svn.apache.org/viewvc/turbine/core/trunk/src/java/org/apache/turbine/modules/actions/sessionvalidator/SessionValidator.java?rev=938645&r1=938644&r2=938645&view=diff
==============================================================================
--- turbine/core/trunk/src/java/org/apache/turbine/modules/actions/sessionvalidator/SessionValidator.java (original)
+++ turbine/core/trunk/src/java/org/apache/turbine/modules/actions/sessionvalidator/SessionValidator.java Tue Apr 27 20:57:51 2010
@@ -1,6 +1,5 @@
package org.apache.turbine.modules.actions.sessionvalidator;
-
/*
* Licensed to the Apache Software Foundation (ASF) under one
* or more contributor license agreements. See the NOTICE file
@@ -20,7 +19,6 @@ package org.apache.turbine.modules.actio
* under the License.
*/
-
import org.apache.turbine.modules.Action;
/**
Modified: turbine/core/trunk/src/java/org/apache/turbine/modules/actions/sessionvalidator/TemplateSecureSessionValidator.java
URL: http://svn.apache.org/viewvc/turbine/core/trunk/src/java/org/apache/turbine/modules/actions/sessionvalidator/TemplateSecureSessionValidator.java?rev=938645&r1=938644&r2=938645&view=diff
==============================================================================
--- turbine/core/trunk/src/java/org/apache/turbine/modules/actions/sessionvalidator/TemplateSecureSessionValidator.java (original)
+++ turbine/core/trunk/src/java/org/apache/turbine/modules/actions/sessionvalidator/TemplateSecureSessionValidator.java Tue Apr 27 20:57:51 2010
@@ -1,6 +1,5 @@
package org.apache.turbine.modules.actions.sessionvalidator;
-
/*
* Licensed to the Apache Software Foundation (ASF) under one
* or more contributor license agreements. See the NOTICE file
@@ -20,7 +19,6 @@ package org.apache.turbine.modules.actio
* under the License.
*/
-
import org.apache.commons.configuration.Configuration;
import org.apache.commons.lang.StringUtils;
Modified: turbine/core/trunk/src/java/org/apache/turbine/modules/actions/sessionvalidator/TemplateSessionValidator.java
URL: http://svn.apache.org/viewvc/turbine/core/trunk/src/java/org/apache/turbine/modules/actions/sessionvalidator/TemplateSessionValidator.java?rev=938645&r1=938644&r2=938645&view=diff
==============================================================================
--- turbine/core/trunk/src/java/org/apache/turbine/modules/actions/sessionvalidator/TemplateSessionValidator.java (original)
+++ turbine/core/trunk/src/java/org/apache/turbine/modules/actions/sessionvalidator/TemplateSessionValidator.java Tue Apr 27 20:57:51 2010
@@ -1,6 +1,5 @@
package org.apache.turbine.modules.actions.sessionvalidator;
-
/*
* Licensed to the Apache Software Foundation (ASF) under one
* or more contributor license agreements. See the NOTICE file
@@ -20,7 +19,6 @@ package org.apache.turbine.modules.actio
* under the License.
*/
-
import org.apache.commons.configuration.Configuration;
import org.apache.commons.lang.StringUtils;
Modified: turbine/core/trunk/src/java/org/apache/turbine/modules/screens/BaseJspScreen.java
URL: http://svn.apache.org/viewvc/turbine/core/trunk/src/java/org/apache/turbine/modules/screens/BaseJspScreen.java?rev=938645&r1=938644&r2=938645&view=diff
==============================================================================
--- turbine/core/trunk/src/java/org/apache/turbine/modules/screens/BaseJspScreen.java (original)
+++ turbine/core/trunk/src/java/org/apache/turbine/modules/screens/BaseJspScreen.java Tue Apr 27 20:57:51 2010
@@ -1,6 +1,5 @@
package org.apache.turbine.modules.screens;
-
/*
* Licensed to the Apache Software Foundation (ASF) under one
* or more contributor license agreements. See the NOTICE file
@@ -20,7 +19,6 @@ package org.apache.turbine.modules.scree
* under the License.
*/
-
import org.apache.commons.lang.StringUtils;
import org.apache.ecs.ConcreteElement;
import org.apache.turbine.pipeline.PipelineData;
Modified: turbine/core/trunk/src/java/org/apache/turbine/modules/screens/Error.java
URL: http://svn.apache.org/viewvc/turbine/core/trunk/src/java/org/apache/turbine/modules/screens/Error.java?rev=938645&r1=938644&r2=938645&view=diff
==============================================================================
--- turbine/core/trunk/src/java/org/apache/turbine/modules/screens/Error.java (original)
+++ turbine/core/trunk/src/java/org/apache/turbine/modules/screens/Error.java Tue Apr 27 20:57:51 2010
@@ -1,6 +1,5 @@
package org.apache.turbine.modules.screens;
-
/*
* Licensed to the Apache Software Foundation (ASF) under one
* or more contributor license agreements. See the NOTICE file
@@ -20,7 +19,6 @@ package org.apache.turbine.modules.scree
* under the License.
*/
-
import java.util.Iterator;
import java.util.Map;
Modified: turbine/core/trunk/src/java/org/apache/turbine/modules/screens/JspErrorScreen.java
URL: http://svn.apache.org/viewvc/turbine/core/trunk/src/java/org/apache/turbine/modules/screens/JspErrorScreen.java?rev=938645&r1=938644&r2=938645&view=diff
==============================================================================
--- turbine/core/trunk/src/java/org/apache/turbine/modules/screens/JspErrorScreen.java (original)
+++ turbine/core/trunk/src/java/org/apache/turbine/modules/screens/JspErrorScreen.java Tue Apr 27 20:57:51 2010
@@ -1,6 +1,5 @@
package org.apache.turbine.modules.screens;
-
/*
* Licensed to the Apache Software Foundation (ASF) under one
* or more contributor license agreements. See the NOTICE file
@@ -20,7 +19,6 @@ package org.apache.turbine.modules.scree
* under the License.
*/
-
import org.apache.turbine.Turbine;
import org.apache.turbine.TurbineConstants;
Modified: turbine/core/trunk/src/java/org/apache/turbine/modules/screens/RawScreen.java
URL: http://svn.apache.org/viewvc/turbine/core/trunk/src/java/org/apache/turbine/modules/screens/RawScreen.java?rev=938645&r1=938644&r2=938645&view=diff
==============================================================================
--- turbine/core/trunk/src/java/org/apache/turbine/modules/screens/RawScreen.java (original)
+++ turbine/core/trunk/src/java/org/apache/turbine/modules/screens/RawScreen.java Tue Apr 27 20:57:51 2010
@@ -1,6 +1,5 @@
package org.apache.turbine.modules.screens;
-
/*
* Licensed to the Apache Software Foundation (ASF) under one
* or more contributor license agreements. See the NOTICE file
Modified: turbine/core/trunk/src/java/org/apache/turbine/modules/screens/TemplateScreen.java
URL: http://svn.apache.org/viewvc/turbine/core/trunk/src/java/org/apache/turbine/modules/screens/TemplateScreen.java?rev=938645&r1=938644&r2=938645&view=diff
==============================================================================
--- turbine/core/trunk/src/java/org/apache/turbine/modules/screens/TemplateScreen.java (original)
+++ turbine/core/trunk/src/java/org/apache/turbine/modules/screens/TemplateScreen.java Tue Apr 27 20:57:51 2010
@@ -1,6 +1,5 @@
package org.apache.turbine.modules.screens;
-
/*
* Licensed to the Apache Software Foundation (ASF) under one
* or more contributor license agreements. See the NOTICE file
@@ -20,7 +19,6 @@ package org.apache.turbine.modules.scree
* under the License.
*/
-
import org.apache.commons.logging.Log;
import org.apache.commons.logging.LogFactory;
Modified: turbine/core/trunk/src/java/org/apache/turbine/modules/screens/VelocityDirectScreen.java
URL: http://svn.apache.org/viewvc/turbine/core/trunk/src/java/org/apache/turbine/modules/screens/VelocityDirectScreen.java?rev=938645&r1=938644&r2=938645&view=diff
==============================================================================
--- turbine/core/trunk/src/java/org/apache/turbine/modules/screens/VelocityDirectScreen.java (original)
+++ turbine/core/trunk/src/java/org/apache/turbine/modules/screens/VelocityDirectScreen.java Tue Apr 27 20:57:51 2010
@@ -1,6 +1,5 @@
package org.apache.turbine.modules.screens;
-
/*
* Licensed to the Apache Software Foundation (ASF) under one
* or more contributor license agreements. See the NOTICE file
@@ -20,7 +19,6 @@ package org.apache.turbine.modules.scree
* under the License.
*/
-
import org.apache.commons.lang.StringUtils;
import org.apache.commons.lang.exception.ExceptionUtils;
import org.apache.ecs.ConcreteElement;
Modified: turbine/core/trunk/src/java/org/apache/turbine/modules/screens/VelocityErrorScreen.java
URL: http://svn.apache.org/viewvc/turbine/core/trunk/src/java/org/apache/turbine/modules/screens/VelocityErrorScreen.java?rev=938645&r1=938644&r2=938645&view=diff
==============================================================================
--- turbine/core/trunk/src/java/org/apache/turbine/modules/screens/VelocityErrorScreen.java (original)
+++ turbine/core/trunk/src/java/org/apache/turbine/modules/screens/VelocityErrorScreen.java Tue Apr 27 20:57:51 2010
@@ -1,6 +1,5 @@
package org.apache.turbine.modules.screens;
-
/*
* Licensed to the Apache Software Foundation (ASF) under one
* or more contributor license agreements. See the NOTICE file
@@ -20,7 +19,6 @@ package org.apache.turbine.modules.scree
* under the License.
*/
-
import org.apache.turbine.Turbine;
import org.apache.turbine.TurbineConstants;
Modified: turbine/core/trunk/src/java/org/apache/turbine/modules/screens/VelocityScreen.java
URL: http://svn.apache.org/viewvc/turbine/core/trunk/src/java/org/apache/turbine/modules/screens/VelocityScreen.java?rev=938645&r1=938644&r2=938645&view=diff
==============================================================================
--- turbine/core/trunk/src/java/org/apache/turbine/modules/screens/VelocityScreen.java (original)
+++ turbine/core/trunk/src/java/org/apache/turbine/modules/screens/VelocityScreen.java Tue Apr 27 20:57:51 2010
@@ -1,6 +1,5 @@
package org.apache.turbine.modules.screens;
-
/*
* Licensed to the Apache Software Foundation (ASF) under one
* or more contributor license agreements. See the NOTICE file
@@ -20,7 +19,6 @@ package org.apache.turbine.modules.scree
* under the License.
*/
-
import org.apache.commons.lang.StringUtils;
import org.apache.commons.lang.exception.ExceptionUtils;
import org.apache.ecs.ConcreteElement;
Modified: turbine/core/trunk/src/java/org/apache/turbine/modules/screens/VelocitySecureScreen.java
URL: http://svn.apache.org/viewvc/turbine/core/trunk/src/java/org/apache/turbine/modules/screens/VelocitySecureScreen.java?rev=938645&r1=938644&r2=938645&view=diff
==============================================================================
--- turbine/core/trunk/src/java/org/apache/turbine/modules/screens/VelocitySecureScreen.java (original)
+++ turbine/core/trunk/src/java/org/apache/turbine/modules/screens/VelocitySecureScreen.java Tue Apr 27 20:57:51 2010
@@ -1,6 +1,5 @@
package org.apache.turbine.modules.screens;
-
/*
* Licensed to the Apache Software Foundation (ASF) under one
* or more contributor license agreements. See the NOTICE file
@@ -31,7 +30,7 @@ import org.apache.velocity.context.Conte
* VelocitySecureScreen
*
* Always performs a Security Check that you've defined before
- * executing the doBuildtemplate(). You should extend this class and
+ * executing the doBuildTemplate(). You should extend this class and
* add the specific security check needed. If you have a number of
* screens that need to perform the same check, you could make a base
* screen by extending this class and implementing the isAuthorized().
@@ -111,8 +110,7 @@ public abstract class VelocitySecureScre
/**
* Implement this method to perform the security check needed.
* You should set the template in this method that you want the
- * user to be sent to if they're unauthorized. See the
- * VelocitySecurityCheck utility.
+ * user to be sent to if they're unauthorized.
*
* @deprecated Use PipelineData version instead.
* @param data Turbine information.
Modified: turbine/core/trunk/src/java/org/apache/turbine/om/security/Group.java
URL: http://svn.apache.org/viewvc/turbine/core/trunk/src/java/org/apache/turbine/om/security/Group.java?rev=938645&r1=938644&r2=938645&view=diff
==============================================================================
--- turbine/core/trunk/src/java/org/apache/turbine/om/security/Group.java (original)
+++ turbine/core/trunk/src/java/org/apache/turbine/om/security/Group.java Tue Apr 27 20:57:51 2010
@@ -20,6 +20,7 @@ package org.apache.turbine.om.security;
* under the License.
*/
+import java.io.Serializable;
import org.apache.turbine.util.security.RoleSet;
import org.apache.turbine.util.security.TurbineSecurityException;
@@ -34,7 +35,7 @@ import org.apache.turbine.util.security.
* @author <a href="mailto:hps@intermeta.de">Henning P. Schmiedehausen</a>
* @version $Id$
*/
-public interface Group extends SecurityEntity
+public interface Group extends SecurityEntity, Serializable
{
/**
* The name of the <a href="#global">global group</a>
Modified: turbine/core/trunk/src/java/org/apache/turbine/om/security/Permission.java
URL: http://svn.apache.org/viewvc/turbine/core/trunk/src/java/org/apache/turbine/om/security/Permission.java?rev=938645&r1=938644&r2=938645&view=diff
==============================================================================
--- turbine/core/trunk/src/java/org/apache/turbine/om/security/Permission.java (original)
+++ turbine/core/trunk/src/java/org/apache/turbine/om/security/Permission.java Tue Apr 27 20:57:51 2010
@@ -1,6 +1,5 @@
package org.apache.turbine.om.security;
-
/*
* Licensed to the Apache Software Foundation (ASF) under one
* or more contributor license agreements. See the NOTICE file
@@ -20,6 +19,7 @@ package org.apache.turbine.om.security;
* under the License.
*/
+import java.io.Serializable;
import org.apache.turbine.util.security.TurbineSecurityException;
@@ -35,7 +35,7 @@ import org.apache.turbine.util.security.
* @author <a href="mailto:hps@intermeta.de">Henning P. Schmiedehausen</a>
* @version $Id$
*/
-public interface Permission extends SecurityEntity
+public interface Permission extends SecurityEntity, Serializable
{
/**
* Makes changes made to the Permission attributes permanent.
Modified: turbine/core/trunk/src/java/org/apache/turbine/om/security/Role.java
URL: http://svn.apache.org/viewvc/turbine/core/trunk/src/java/org/apache/turbine/om/security/Role.java?rev=938645&r1=938644&r2=938645&view=diff
==============================================================================
--- turbine/core/trunk/src/java/org/apache/turbine/om/security/Role.java (original)
+++ turbine/core/trunk/src/java/org/apache/turbine/om/security/Role.java Tue Apr 27 20:57:51 2010
@@ -20,6 +20,7 @@ package org.apache.turbine.om.security;
* under the License.
*/
+import java.io.Serializable;
import org.apache.turbine.util.security.PermissionSet;
import org.apache.turbine.util.security.TurbineSecurityException;
@@ -34,7 +35,7 @@ import org.apache.turbine.util.security.
* @author <a href="mailto:hps@intermeta.de">Henning P. Schmiedehausen</a>
* @version $Id$
*/
-public interface Role extends SecurityEntity
+public interface Role extends SecurityEntity, Serializable
{
/**
* Returns the set of Permissions associated with this Role.
Modified: turbine/core/trunk/src/java/org/apache/turbine/om/security/User.java
URL: http://svn.apache.org/viewvc/turbine/core/trunk/src/java/org/apache/turbine/om/security/User.java?rev=938645&r1=938644&r2=938645&view=diff
==============================================================================
--- turbine/core/trunk/src/java/org/apache/turbine/om/security/User.java (original)
+++ turbine/core/trunk/src/java/org/apache/turbine/om/security/User.java Tue Apr 27 20:57:51 2010
@@ -1,6 +1,5 @@
package org.apache.turbine.om.security;
-
/*
* Licensed to the Apache Software Foundation (ASF) under one
* or more contributor license agreements. See the NOTICE file
@@ -20,7 +19,6 @@ package org.apache.turbine.om.security;
* under the License.
*/
-
import java.io.Serializable;
import java.util.Hashtable;
Modified: turbine/core/trunk/src/java/org/apache/turbine/services/rundata/DefaultTurbineRunData.java
URL: http://svn.apache.org/viewvc/turbine/core/trunk/src/java/org/apache/turbine/services/rundata/DefaultTurbineRunData.java?rev=938645&r1=938644&r2=938645&view=diff
==============================================================================
--- turbine/core/trunk/src/java/org/apache/turbine/services/rundata/DefaultTurbineRunData.java (original)
+++ turbine/core/trunk/src/java/org/apache/turbine/services/rundata/DefaultTurbineRunData.java Tue Apr 27 20:57:51 2010
@@ -1,6 +1,5 @@
package org.apache.turbine.services.rundata;
-
/*
* Licensed to the Apache Software Foundation (ASF) under one
* or more contributor license agreements. See the NOTICE file
@@ -20,7 +19,6 @@ package org.apache.turbine.services.rund
* under the License.
*/
-
import java.io.IOException;
import java.io.PrintWriter;
import java.util.ArrayList;
@@ -980,12 +978,13 @@ public class DefaultTurbineRunData
{
this.locale = locale;
- if (parameters != null)
+ // propagate the locale to the parsers
+ if (this.parameters != null)
{
parameters.setLocale(locale);
}
- if (cookies != null)
+ if (this.cookies != null)
{
cookies.setLocale(locale);
}
@@ -1358,6 +1357,11 @@ public class DefaultTurbineRunData
* Gets the parameter parser without parsing the parameters.
*
* @return the parameter parser.
+ * @todo Does this method make sense? Pulling the parameter out of
+ * the run data object before setting a request (which happens
+ * only in getParameters() leads to the Parameter parser having
+ * no object and thus the default or even an undefined encoding
+ * instead of the actual request character encoding).
*/
public ParameterParser getParameterParser()
{
Modified: turbine/core/trunk/src/java/org/apache/turbine/services/rundata/RunDataService.java
URL: http://svn.apache.org/viewvc/turbine/core/trunk/src/java/org/apache/turbine/services/rundata/RunDataService.java?rev=938645&r1=938644&r2=938645&view=diff
==============================================================================
--- turbine/core/trunk/src/java/org/apache/turbine/services/rundata/RunDataService.java (original)
+++ turbine/core/trunk/src/java/org/apache/turbine/services/rundata/RunDataService.java Tue Apr 27 20:57:51 2010
@@ -1,6 +1,5 @@
package org.apache.turbine.services.rundata;
-
/*
* Licensed to the Apache Software Foundation (ASF) under one
* or more contributor license agreements. See the NOTICE file
@@ -20,7 +19,6 @@ package org.apache.turbine.services.rund
* under the License.
*/
-
import javax.servlet.ServletConfig;
import javax.servlet.http.HttpServletRequest;
import javax.servlet.http.HttpServletResponse;
Modified: turbine/core/trunk/src/java/org/apache/turbine/services/rundata/TurbineRunData.java
URL: http://svn.apache.org/viewvc/turbine/core/trunk/src/java/org/apache/turbine/services/rundata/TurbineRunData.java?rev=938645&r1=938644&r2=938645&view=diff
==============================================================================
--- turbine/core/trunk/src/java/org/apache/turbine/services/rundata/TurbineRunData.java (original)
+++ turbine/core/trunk/src/java/org/apache/turbine/services/rundata/TurbineRunData.java Tue Apr 27 20:57:51 2010
@@ -1,6 +1,5 @@
package org.apache.turbine.services.rundata;
-
/*
* Licensed to the Apache Software Foundation (ASF) under one
* or more contributor license agreements. See the NOTICE file
@@ -20,7 +19,6 @@ package org.apache.turbine.services.rund
* under the License.
*/
-
import javax.servlet.ServletConfig;
import javax.servlet.http.HttpServletRequest;
Modified: turbine/core/trunk/src/java/org/apache/turbine/services/rundata/TurbineRunDataService.java
URL: http://svn.apache.org/viewvc/turbine/core/trunk/src/java/org/apache/turbine/services/rundata/TurbineRunDataService.java?rev=938645&r1=938644&r2=938645&view=diff
==============================================================================
--- turbine/core/trunk/src/java/org/apache/turbine/services/rundata/TurbineRunDataService.java (original)
+++ turbine/core/trunk/src/java/org/apache/turbine/services/rundata/TurbineRunDataService.java Tue Apr 27 20:57:51 2010
@@ -1,6 +1,5 @@
package org.apache.turbine.services.rundata;
-
/*
* Licensed to the Apache Software Foundation (ASF) under one
* or more contributor license agreements. See the NOTICE file
@@ -20,7 +19,6 @@ package org.apache.turbine.services.rund
* under the License.
*/
-
import java.util.HashMap;
import java.util.Iterator;
import java.util.Locale;
@@ -94,7 +92,6 @@ public class TurbineRunDataService
* Initializes the service by setting the pool capacity.
*
* @throws InitializationException if initialization fails.
- * @throws ServiceException
*/
public void init()
throws InitializationException
Modified: turbine/core/trunk/src/java/org/apache/turbine/services/security/SecurityService.java
URL: http://svn.apache.org/viewvc/turbine/core/trunk/src/java/org/apache/turbine/services/security/SecurityService.java?rev=938645&r1=938644&r2=938645&view=diff
==============================================================================
--- turbine/core/trunk/src/java/org/apache/turbine/services/security/SecurityService.java (original)
+++ turbine/core/trunk/src/java/org/apache/turbine/services/security/SecurityService.java Tue Apr 27 20:57:51 2010
@@ -66,104 +66,104 @@ public interface SecurityService
extends Service
{
/** The name of the service */
- static final String SERVICE_NAME = "SecurityService";
+ String SERVICE_NAME = "SecurityService";
/**
* the key within services's properties for user implementation
* classname (user.class)
*/
- static final String USER_CLASS_KEY = "user.class";
+ String USER_CLASS_KEY = "user.class";
/**
* the default implementation of User interface
* (org.apache.turbine.om.security.TurbineUser)
*/
- static final String USER_CLASS_DEFAULT
+ String USER_CLASS_DEFAULT
= TurbineUser.class.getName();
/**
* The key within services' properties for the GROUP
* implementation classname (group.class)
*/
- static final String GROUP_CLASS_KEY = "group.class";
+ String GROUP_CLASS_KEY = "group.class";
/**
* The default implementation of the Group interface
* (org.apache.turbine.om.security.TurbineGroup)
*/
- static final String GROUP_CLASS_DEFAULT
+ String GROUP_CLASS_DEFAULT
= TurbineGroup.class.getName();
/**
* The key within services' properties for the PERMISSION
* implementation classname (permission.class)
*/
- static final String PERMISSION_CLASS_KEY = "permission.class";
+ String PERMISSION_CLASS_KEY = "permission.class";
/**
* The default implementation of the Permissions interface
* (org.apache.turbine.om.security.TurbinePermission)
*/
- static final String PERMISSION_CLASS_DEFAULT
+ String PERMISSION_CLASS_DEFAULT
= TurbinePermission.class.getName();
/**
* The key within services' properties for the ROLE
* implementation classname (role.class)
*/
- static final String ROLE_CLASS_KEY = "role.class";
+ String ROLE_CLASS_KEY = "role.class";
/**
* The default implementation of the Role Interface
* (org.apache.turbine.om.security.TurbineRole)
*/
- static final String ROLE_CLASS_DEFAULT
+ String ROLE_CLASS_DEFAULT
= TurbineRole.class.getName();
/**
* The key within services' properties for the
* ACL implementation classname (acl.class)
*/
- static final String ACL_CLASS_KEY = "acl.class";
+ String ACL_CLASS_KEY = "acl.class";
/**
* The default implementation of the Acl Interface
* (org.apache.turbine.util.security.TurbineAccessControlList)
*/
- static final String ACL_CLASS_DEFAULT
+ String ACL_CLASS_DEFAULT
= TurbineAccessControlList.class.getName();
/**
* the key within services's properties for user implementation
* classname (user.manager)
*/
- static final String USER_MANAGER_KEY = "user.manager";
+ String USER_MANAGER_KEY = "user.manager";
/**
* the default implementation of UserManager interface
* (org.apache.turbine.services.security.passive.PassiveUserManager)
*/
- static final String USER_MANAGER_DEFAULT
+ String USER_MANAGER_DEFAULT
= PassiveUserManager.class.getName();
/**
* the key within services's properties for secure passwords flag
* (secure.passwords)
*/
- static final String SECURE_PASSWORDS_KEY = "secure.passwords";
+ String SECURE_PASSWORDS_KEY = "secure.passwords";
/** the value of secure passwords flag (false) */
- static final String SECURE_PASSWORDS_DEFAULT = "false";
+ String SECURE_PASSWORDS_DEFAULT = "false";
/**
* the key within services's properties for secure passwords algorithm
* (secure.passwords.algorithm)
*/
- static final String SECURE_PASSWORDS_ALGORITHM_KEY
+ String SECURE_PASSWORDS_ALGORITHM_KEY
= "secure.passwords.algorithm";
/** the default algorithm for password encryption (SHA) */
- static final String SECURE_PASSWORDS_ALGORITHM_DEFAULT = "SHA";
+ String SECURE_PASSWORDS_ALGORITHM_DEFAULT = "SHA";
/*-----------------------------------------------------------------------
Management of User objects
Modified: turbine/core/trunk/src/java/org/apache/turbine/services/security/TurbineSecurity.java
URL: http://svn.apache.org/viewvc/turbine/core/trunk/src/java/org/apache/turbine/services/security/TurbineSecurity.java?rev=938645&r1=938644&r2=938645&view=diff
==============================================================================
--- turbine/core/trunk/src/java/org/apache/turbine/services/security/TurbineSecurity.java (original)
+++ turbine/core/trunk/src/java/org/apache/turbine/services/security/TurbineSecurity.java Tue Apr 27 20:57:51 2010
@@ -1,6 +1,5 @@
package org.apache.turbine.services.security;
-
/*
* Licensed to the Apache Software Foundation (ASF) under one
* or more contributor license agreements. See the NOTICE file
Modified: turbine/core/trunk/src/java/org/apache/turbine/services/security/UserManager.java
URL: http://svn.apache.org/viewvc/turbine/core/trunk/src/java/org/apache/turbine/services/security/UserManager.java?rev=938645&r1=938644&r2=938645&view=diff
==============================================================================
--- turbine/core/trunk/src/java/org/apache/turbine/services/security/UserManager.java (original)
+++ turbine/core/trunk/src/java/org/apache/turbine/services/security/UserManager.java Tue Apr 27 20:57:51 2010
@@ -1,6 +1,5 @@
package org.apache.turbine.services.security;
-
/*
* Licensed to the Apache Software Foundation (ASF) under one
* or more contributor license agreements. See the NOTICE file
@@ -20,7 +19,6 @@ package org.apache.turbine.services.secu
* under the License.
*/
-
import java.util.List;
import org.apache.commons.configuration.Configuration;
@@ -174,7 +172,7 @@ public interface UserManager
* @exception DataBackendException if there is a problem accessing the
* storage.
*/
- public void saveOnSessionUnbind(User user)
+ void saveOnSessionUnbind(User user)
throws UnknownEntityException, DataBackendException;
/**
Modified: turbine/core/trunk/src/java/org/apache/turbine/util/TimeSelector.java
URL: http://svn.apache.org/viewvc/turbine/core/trunk/src/java/org/apache/turbine/util/TimeSelector.java?rev=938645&r1=938644&r2=938645&view=diff
==============================================================================
--- turbine/core/trunk/src/java/org/apache/turbine/util/TimeSelector.java (original)
+++ turbine/core/trunk/src/java/org/apache/turbine/util/TimeSelector.java Tue Apr 27 20:57:51 2010
@@ -1,6 +1,5 @@
package org.apache.turbine.util;
-
/*
* Licensed to the Apache Software Foundation (ASF) under one
* or more contributor license agreements. See the NOTICE file
@@ -20,7 +19,6 @@ package org.apache.turbine.util;
* under the License.
*/
-
import java.text.NumberFormat;
import java.util.Calendar;
import java.util.Date;
Modified: turbine/core/trunk/src/java/org/apache/turbine/util/TurbineConfig.java
URL: http://svn.apache.org/viewvc/turbine/core/trunk/src/java/org/apache/turbine/util/TurbineConfig.java?rev=938645&r1=938644&r2=938645&view=diff
==============================================================================
--- turbine/core/trunk/src/java/org/apache/turbine/util/TurbineConfig.java (original)
+++ turbine/core/trunk/src/java/org/apache/turbine/util/TurbineConfig.java Tue Apr 27 20:57:51 2010
@@ -177,6 +177,17 @@ public class TurbineConfig
}
/**
+ * Initialization requiring a HTTP <code>GET</code> request.
+ */
+ public void init(RunData data)
+ {
+ if (turbine != null)
+ {
+ turbine.init(data);
+ }
+ }
+
+ /**
* Shutdown the Turbine System, lifecycle style
*
*/
Modified: turbine/core/trunk/src/java/org/apache/turbine/util/TurbineRuntimeException.java
URL: http://svn.apache.org/viewvc/turbine/core/trunk/src/java/org/apache/turbine/util/TurbineRuntimeException.java?rev=938645&r1=938644&r2=938645&view=diff
==============================================================================
--- turbine/core/trunk/src/java/org/apache/turbine/util/TurbineRuntimeException.java (original)
+++ turbine/core/trunk/src/java/org/apache/turbine/util/TurbineRuntimeException.java Tue Apr 27 20:57:51 2010
@@ -20,7 +20,6 @@ package org.apache.turbine.util;
* under the License.
*/
-
import org.apache.commons.lang.exception.NestableRuntimeException;
/**
Modified: turbine/core/trunk/src/java/org/apache/turbine/util/TurbineXmlConfig.java
URL: http://svn.apache.org/viewvc/turbine/core/trunk/src/java/org/apache/turbine/util/TurbineXmlConfig.java?rev=938645&r1=938644&r2=938645&view=diff
==============================================================================
--- turbine/core/trunk/src/java/org/apache/turbine/util/TurbineXmlConfig.java (original)
+++ turbine/core/trunk/src/java/org/apache/turbine/util/TurbineXmlConfig.java Tue Apr 27 20:57:51 2010
@@ -20,7 +20,6 @@ package org.apache.turbine.util;
* under the License.
*/
-
import java.util.HashMap;
import java.util.Map;
Modified: turbine/core/trunk/src/java/org/apache/turbine/util/template/HtmlPageAttributes.java
URL: http://svn.apache.org/viewvc/turbine/core/trunk/src/java/org/apache/turbine/util/template/HtmlPageAttributes.java?rev=938645&r1=938644&r2=938645&view=diff
==============================================================================
--- turbine/core/trunk/src/java/org/apache/turbine/util/template/HtmlPageAttributes.java (original)
+++ turbine/core/trunk/src/java/org/apache/turbine/util/template/HtmlPageAttributes.java Tue Apr 27 20:57:51 2010
@@ -115,8 +115,8 @@ public class HtmlPageAttributes
/** Script references */
private List scripts = new ArrayList();
- /** Stylesheet references */
- private List styleSheets = new ArrayList();
+ /** External references */
+ private List linkTags = new ArrayList();
/** Inline styles */
private List styles = new ArrayList();
@@ -158,7 +158,7 @@ public class HtmlPageAttributes
this.title = null;
this.bodyAttributes.clear();
this.scripts.clear();
- this.styleSheets.clear();
+ this.linkTags.clear();
this.styles.clear();
this.metaTags.clear();
this.httpEquivs.clear();
@@ -302,11 +302,11 @@ public class HtmlPageAttributes
public HtmlPageAttributes addStyleSheet(String styleSheetURL,
String media, String title, String type)
{
- StyleSheet ss = new StyleSheet(styleSheetURL);
+ LinkTag ss = new LinkTag("stylesheet", styleSheetURL);
ss.setMedia(media);
ss.setTitle(title);
ss.setType(type);
- this.styleSheets.add(ss);
+ this.linkTags.add(ss);
return this;
}
@@ -340,13 +340,68 @@ public class HtmlPageAttributes
}
/**
+ * Adds a generic external reference
+ *
+ * @param relation type of the reference (prev, next, first, last, top, etc.)
+ * @param linkURL URL of the reference
+ * @return a <code>HtmlPageAttributes</code> (self).
+ */
+ public HtmlPageAttributes addLink(String relation, String linkURL)
+ {
+ return addLink(relation, linkURL, null, null);
+ }
+
+ /**
+ * Adds a generic external reference
+ *
+ * @param relation type of the reference (prev, next, first, last, top, etc.)
+ * @param linkURL URL of the reference
+ * @param title title of the reference
+ * @return a <code>HtmlPageAttributes</code> (self).
+ */
+ public HtmlPageAttributes addLink(String relation, String linkURL, String title)
+ {
+ return addLink(relation, linkURL, title, null);
+ }
+
+ /**
+ * Adds a generic external reference
+ *
+ * @param relation type of the reference (prev, next, first, last, top, etc.)
+ * @param linkURL URL of the reference
+ * @param title title of the reference
+ * @param type content type
+ * @return a <code>HtmlPageAttributes</code> (self).
+ */
+ public HtmlPageAttributes addLink(String relation, String linkURL, String title,
+ String type)
+ {
+ LinkTag ss = new LinkTag(relation, linkURL);
+ ss.setTitle(title);
+ ss.setType(type);
+ this.linkTags.add(ss);
+ return this;
+ }
+
+ /**
* Returns a collection of script URLs
*
- * @return list StyleSheet objects (inner class)
+ * @return list LinkTag objects (inner class)
+ * @deprecated use getLinks() instead
*/
public List getStyleSheets()
{
- return this.styleSheets;
+ return this.linkTags;
+ }
+
+ /**
+ * Returns a collection of link URLs
+ *
+ * @return list LinkTag objects (inner class)
+ */
+ public List getLinks()
+ {
+ return this.linkTags;
}
/**
@@ -531,22 +586,26 @@ public class HtmlPageAttributes
}
/**
- * Helper class to hold data about a stylesheet
+ * Helper class to hold data about a <link ... /> html header tag
*/
- public class StyleSheet
+ public class LinkTag
{
+ private String relation;
private String url;
private String title;
private String media;
private String type;
/**
- * Constructor requiring the URL to be set
+ * Constructor requiring the URL and relation to be set
*
- * @param url URL of the external style sheet
+ * @param relation Relation type the external link such as prev, next,
+ * stylesheet, shortcut icon
+ * @param url URL of the external link
*/
- public StyleSheet(String url)
+ public LinkTag(String relation, String url)
{
+ setRelation(relation);
setUrl(url);
}
@@ -628,6 +687,25 @@ public class HtmlPageAttributes
this.media = media;
}
+ /**
+ * Gets the relation type of the tag.
+ *
+ * @return name of the relation
+ */
+ public String getRelation()
+ {
+ return (StringUtils.isEmpty(relation) ? "" : relation);
+ }
+
+ /**
+ * Sets the relation type of the tag.
+ *
+ * @param relation name of the relation
+ */
+ public void setRelation(String relation)
+ {
+ this.relation = relation;
+ }
}
/**
Modified: turbine/core/trunk/src/java/org/apache/turbine/util/template/TemplateInfo.java
URL: http://svn.apache.org/viewvc/turbine/core/trunk/src/java/org/apache/turbine/util/template/TemplateInfo.java?rev=938645&r1=938644&r2=938645&view=diff
==============================================================================
--- turbine/core/trunk/src/java/org/apache/turbine/util/template/TemplateInfo.java (original)
+++ turbine/core/trunk/src/java/org/apache/turbine/util/template/TemplateInfo.java Tue Apr 27 20:57:51 2010
@@ -24,9 +24,6 @@ package org.apache.turbine.util.template
import java.util.Map;
import java.util.HashMap;
-import org.apache.commons.logging.Log;
-import org.apache.commons.logging.LogFactory;
-
import org.apache.turbine.services.template.TurbineTemplate;
import org.apache.turbine.util.RunData;
import org.apache.turbine.util.uri.URIConstants;
@@ -44,9 +41,6 @@ import org.apache.turbine.util.uri.URICo
*/
public class TemplateInfo
{
- /** Logging */
- private static Log log = LogFactory.getLog(TemplateInfo.class);
-
/* Constants for tempStorage hash map. */
public static final String NAVIGATION_TEMPLATE = "00navigation_template00";
Modified: turbine/core/trunk/src/java/org/apache/turbine/util/uri/DataURI.java
URL: http://svn.apache.org/viewvc/turbine/core/trunk/src/java/org/apache/turbine/util/uri/DataURI.java?rev=938645&r1=938644&r2=938645&view=diff
==============================================================================
--- turbine/core/trunk/src/java/org/apache/turbine/util/uri/DataURI.java (original)
+++ turbine/core/trunk/src/java/org/apache/turbine/util/uri/DataURI.java Tue Apr 27 20:57:51 2010
@@ -115,7 +115,7 @@ public class DataURI
* tui.getAbsoluteLink();
* </pre></code>
*
- * The above call to absoluteLink() would return the String:
+ * The above call to getAbsoluteLink() would return the String:
*
* <p>
* http://www.server.com/servlets/Turbine/screen/UserScreen/user/jon
@@ -153,7 +153,7 @@ public class DataURI
* tui.getRelativeLink();
* </pre></code>
*
- * The above call to absoluteLink() would return the String:
+ * The above call to getRelativeLink() would return the String:
*
* <p>
* /servlets/Turbine/screen/UserScreen/user/jon
Modified: turbine/core/trunk/src/java/org/apache/turbine/util/uri/TurbineURI.java
URL: http://svn.apache.org/viewvc/turbine/core/trunk/src/java/org/apache/turbine/util/uri/TurbineURI.java?rev=938645&r1=938644&r2=938645&view=diff
==============================================================================
--- turbine/core/trunk/src/java/org/apache/turbine/util/uri/TurbineURI.java (original)
+++ turbine/core/trunk/src/java/org/apache/turbine/util/uri/TurbineURI.java Tue Apr 27 20:57:51 2010
@@ -281,6 +281,17 @@ public class TurbineURI
}
/**
+ * Sets the fired eventSubmit= value for this URL.
+ *
+ * @param event The event to fire.
+ *
+ */
+ public void setEvent(String event)
+ {
+ add(PATH_INFO, EVENT_PREFIX + event, event);
+ }
+
+ /**
* Sets the action= and eventSubmit= values for this URL.
*
* By default it adds the information to the path_info instead
@@ -296,7 +307,7 @@ public class TurbineURI
setAction(action);
if(StringUtils.isNotEmpty(event))
{
- add(PATH_INFO, EVENT_PREFIX + event, event);
+ setEvent(event);
}
}
@@ -376,7 +387,7 @@ public class TurbineURI
*/
public void addPathInfo(String name, Object value)
{
- add(PATH_INFO, name, value.toString());
+ add(PATH_INFO, name, null == value ? null : value.toString());
}
/**
@@ -431,7 +442,7 @@ public class TurbineURI
*/
public void addQueryData(String name, Object value)
{
- add(QUERY_DATA, name, value.toString());
+ add(QUERY_DATA, name, null == value ? null : value.toString());
}
/**
@@ -764,16 +775,22 @@ public class TurbineURI
{
URIParam uriParam = (URIParam) it.next();
String key = URLEncoder.encode(uriParam.getKey());
- String val = String.valueOf(uriParam.getValue());
+ String val = null == uriParam.getValue()
+ ? null : String.valueOf(uriParam.getValue());
output.append(key);
output.append(valueDelim);
if(StringUtils.isEmpty(val))
{
- if (val == null && log.isDebugEnabled())
+ if (val == null)
{
- log.debug("Found a null value for " + key);
+ if (log.isWarnEnabled())
+ {
+ log.warn("Found a null value for " + key);
+ }
+ // For backwards compatibility:
+ val = "null";
}
output.append(val);
}
Modified: turbine/core/trunk/src/java/org/apache/turbine/util/velocity/VelocityEmail.java
URL: http://svn.apache.org/viewvc/turbine/core/trunk/src/java/org/apache/turbine/util/velocity/VelocityEmail.java?rev=938645&r1=938644&r2=938645&view=diff
==============================================================================
--- turbine/core/trunk/src/java/org/apache/turbine/util/velocity/VelocityEmail.java (original)
+++ turbine/core/trunk/src/java/org/apache/turbine/util/velocity/VelocityEmail.java Tue Apr 27 20:57:51 2010
@@ -20,8 +20,6 @@ package org.apache.turbine.util.velocity
* under the License.
*/
-
-
import org.apache.commons.lang.StringUtils;
import org.apache.commons.lang.WordUtils;
import org.apache.commons.logging.Log;
@@ -140,7 +138,7 @@ public class VelocityEmail extends Simpl
* @param toName A String with the TO toName.
* @param toEmail A String with the TO toEmail.
* @deprecated use addTo(email,name) instead
- * @throws MessagingException email address could not be parsed
+ * @throws EmailException email address could not be parsed
* @return A VelocityEmail (self).
*/
public VelocityEmail setTo(String toName, String toEmail)
@@ -259,8 +257,8 @@ public class VelocityEmail extends Simpl
// If the caller desires word-wrapping, do it here
if (wordWrap > 0)
{
- body = WordUtils.wrap(body,wordWrap,
- System.getProperty("line.separator"),true);
+ body = WordUtils.wrap(body, wordWrap,
+ System.getProperty("line.separator"), false);
}
setMsg(body);