You are viewing a plain text version of this content. The canonical link for it is here.
Posted to dev@turbine.apache.org by mp...@apache.org on 2003/06/21 00:09:14 UTC
cvs commit: jakarta-turbine-2/src/java/org/apache/turbine/modules/actions/sessionvalidator TemplateSessionValidator.java DefaultSessionValidator.java TemplateSecureSessionValidator.java
mpoeschl 2003/06/20 15:09:13
Modified: src/java/org/apache/turbine/modules/layouts
DefaultLayout.java VelocityECSLayout.java
VelocityOnlyLayout.java
src/java/org/apache/turbine/modules/actions LoginUser.java
DefaultAction.java VelocityAction.java
InitContextsAction.java VelocitySecureAction.java
src/java/org/apache/turbine/modules/navigations
TemplateNavigation.java BaseJspNavigation.java
DefaultTopNavigation.java
src/java/org/apache/turbine/modules/actions/sessionvalidator
TemplateSessionValidator.java
DefaultSessionValidator.java
TemplateSecureSessionValidator.java
Log:
javadoc and style fixes
Revision Changes Path
1.6 +3 -3 jakarta-turbine-2/src/java/org/apache/turbine/modules/layouts/DefaultLayout.java
Index: DefaultLayout.java
===================================================================
RCS file: /home/cvs/jakarta-turbine-2/src/java/org/apache/turbine/modules/layouts/DefaultLayout.java,v
retrieving revision 1.5
retrieving revision 1.6
diff -u -r1.5 -r1.6
--- DefaultLayout.java 9 Mar 2003 02:37:56 -0000 1.5
+++ DefaultLayout.java 20 Jun 2003 22:09:12 -0000 1.6
@@ -88,8 +88,8 @@
public void doBuild(RunData data) throws Exception
{
// Execute the Top Navigation portion for this Layout.
- ConcreteElement topNav =
- NavigationLoader.getInstance().eval(data, "DefaultTopNavigation");
+ ConcreteElement topNav = NavigationLoader.getInstance()
+ .eval(data, "DefaultTopNavigation");
if (topNav != null)
{
1.12 +2 -2 jakarta-turbine-2/src/java/org/apache/turbine/modules/layouts/VelocityECSLayout.java
Index: VelocityECSLayout.java
===================================================================
RCS file: /home/cvs/jakarta-turbine-2/src/java/org/apache/turbine/modules/layouts/VelocityECSLayout.java,v
retrieving revision 1.11
retrieving revision 1.12
diff -u -r1.11 -r1.12
--- VelocityECSLayout.java 3 Jun 2003 13:41:26 -0000 1.11
+++ VelocityECSLayout.java 20 Jun 2003 22:09:12 -0000 1.12
@@ -148,6 +148,6 @@
// Finally, generate the layout template and add it to the body of the
// Document in the RunData.
data.getPage().getBody().addElement(TurbineVelocity
- .handleRequest(context, prefix + templateName));
+ .handleRequest(context, prefix + templateName));
}
}
1.12 +5 -5 jakarta-turbine-2/src/java/org/apache/turbine/modules/layouts/VelocityOnlyLayout.java
Index: VelocityOnlyLayout.java
===================================================================
RCS file: /home/cvs/jakarta-turbine-2/src/java/org/apache/turbine/modules/layouts/VelocityOnlyLayout.java,v
retrieving revision 1.11
retrieving revision 1.12
diff -u -r1.11 -r1.12
--- VelocityOnlyLayout.java 3 Jun 2003 13:41:26 -0000 1.11
+++ VelocityOnlyLayout.java 20 Jun 2003 22:09:12 -0000 1.12
@@ -74,8 +74,8 @@
* screens and navigations there should be relatively few reasons to
* subclass this Layout.
*
- * To get the same functionality as with VelocityECSLayout, you can
- * use two supplied VelocityMacros, TurbineHtmlHead and TurbineHtmlBodyAttributes
+ * To get the same functionality as with VelocityECSLayout, you can use two
+ * supplied VelocityMacros, TurbineHtmlHead and TurbineHtmlBodyAttributes
* in your templates. These are used to put HtmlPageAttributes into a page
* before rendering.
*
@@ -90,8 +90,8 @@
* </html>
*
* As the layout template is rendered _after_ the screen template, you
- * can of course, add information to the $page tool in your screen
- * template. This will be added correctly to the <head>...</head> and
+ * can of course, add information to the $page tool in your screen template.
+ * This will be added correctly to the <head>...</head> and
* <body> tags.
*
* @author <a href="mailto:john.mcnally@clearink.com">John D. McNally</a>
1.13 +5 -3 jakarta-turbine-2/src/java/org/apache/turbine/modules/actions/LoginUser.java
Index: LoginUser.java
===================================================================
RCS file: /home/cvs/jakarta-turbine-2/src/java/org/apache/turbine/modules/actions/LoginUser.java,v
retrieving revision 1.12
retrieving revision 1.13
diff -u -r1.12 -r1.13
--- LoginUser.java 21 Mar 2003 12:11:40 -0000 1.12
+++ LoginUser.java 20 Jun 2003 22:09:12 -0000 1.13
@@ -118,7 +118,8 @@
try
{
// Authenticate the user and get the object.
- User user = TurbineSecurity.getAuthenticatedUser(username, password);
+ User user = TurbineSecurity.getAuthenticatedUser(
+ username, password);
// Store the user object.
data.setUser(user);
@@ -158,7 +159,8 @@
data.setMessage(conf.getString(TurbineConstants.LOGIN_ERROR, ""));
data.setUser (TurbineSecurity.getAnonymousUser());
- String loginTemplate = conf.getString(TurbineConstants.TEMPLATE_LOGIN);
+ String loginTemplate = conf.getString(
+ TurbineConstants.TEMPLATE_LOGIN);
if (StringUtils.isNotEmpty(loginTemplate))
{
1.4 +2 -2 jakarta-turbine-2/src/java/org/apache/turbine/modules/actions/DefaultAction.java
Index: DefaultAction.java
===================================================================
RCS file: /home/cvs/jakarta-turbine-2/src/java/org/apache/turbine/modules/actions/DefaultAction.java,v
retrieving revision 1.3
retrieving revision 1.4
diff -u -r1.3 -r1.4
--- DefaultAction.java 9 Mar 2003 02:37:06 -0000 1.3
+++ DefaultAction.java 20 Jun 2003 22:09:12 -0000 1.4
@@ -71,7 +71,7 @@
* Execute the action.
*
* @param data Turbine information.
- * @exception Exception, a generic exception.
+ * @throws Exception a generic exception.
*/
public void doPerform(RunData data)
throws Exception
1.5 +5 -5 jakarta-turbine-2/src/java/org/apache/turbine/modules/actions/VelocityAction.java
Index: VelocityAction.java
===================================================================
RCS file: /home/cvs/jakarta-turbine-2/src/java/org/apache/turbine/modules/actions/VelocityAction.java,v
retrieving revision 1.4
retrieving revision 1.5
diff -u -r1.4 -r1.5
--- VelocityAction.java 9 Mar 2003 02:37:06 -0000 1.4
+++ VelocityAction.java 20 Jun 2003 22:09:12 -0000 1.5
@@ -76,7 +76,7 @@
* action.
*
* @param data Turbine information.
- * @exception Exception, a generic exception.
+ * @throws Exception a generic exception.
*/
public void doPerform(RunData data)
throws Exception
@@ -90,7 +90,7 @@
*
* @param data Turbine information.
* @param context Context for web pages.
- * @exception Exception, a generic exception.
+ * @throws Exception a generic exception.
*/
public abstract void doPerform(RunData data,
Context context)
@@ -102,7 +102,7 @@
* themselves!
*
* @param data Turbine information.
- * @exception Exception, a generic exception.
+ * @throws Exception a generic exception.
*/
protected void perform(RunData data)
throws Exception
@@ -126,7 +126,7 @@
/**
* Return the Context needed by Velocity.
*
- * @param RunData data
+ * @param data Turbine information.
* @return Context, a context for web pages.
*/
protected Context getContext(RunData data)
1.8 +7 -7 jakarta-turbine-2/src/java/org/apache/turbine/modules/actions/InitContextsAction.java
Index: InitContextsAction.java
===================================================================
RCS file: /home/cvs/jakarta-turbine-2/src/java/org/apache/turbine/modules/actions/InitContextsAction.java,v
retrieving revision 1.7
retrieving revision 1.8
diff -u -r1.7 -r1.8
--- InitContextsAction.java 12 Mar 2003 18:43:13 -0000 1.7
+++ InitContextsAction.java 20 Jun 2003 22:09:12 -0000 1.8
@@ -97,7 +97,8 @@
// instance.
Hashtable contextPropsList = new Hashtable();
- for (Iterator contextKeys = conf.getKeys("context."); contextKeys.hasNext();)
+ for (Iterator contextKeys = conf.getKeys("context.");
+ contextKeys.hasNext();)
{
String key = (String) contextKeys.next();
int start = key.indexOf(".") + 1;
@@ -106,8 +107,7 @@
Properties contextProps = null;
if (contextPropsList.containsKey(contextName))
{
- contextProps =
- (Properties) contextPropsList.get(contextName);
+ contextProps = (Properties) contextPropsList.get(contextName);
}
else
{
@@ -117,11 +117,11 @@
conf.getString(key));
contextPropsList.put(contextName, contextProps);
}
- for (Iterator contextPropsKeys = contextPropsList.keySet().iterator(); contextPropsKeys.hasNext();)
+ for (Iterator contextPropsKeys = contextPropsList.keySet().iterator();
+ contextPropsKeys.hasNext();)
{
String key = (String) contextPropsKeys.next();
- Properties contextProps =
- (Properties) contextPropsList.get(key);
+ Properties contextProps = (Properties) contextPropsList.get(key);
InitialContext context = new InitialContext(contextProps);
data.getJNDIContexts().put(key, context);
}
1.4 +5 -6 jakarta-turbine-2/src/java/org/apache/turbine/modules/actions/VelocitySecureAction.java
Index: VelocitySecureAction.java
===================================================================
RCS file: /home/cvs/jakarta-turbine-2/src/java/org/apache/turbine/modules/actions/VelocitySecureAction.java,v
retrieving revision 1.3
retrieving revision 1.4
diff -u -r1.3 -r1.4
--- VelocitySecureAction.java 9 Mar 2003 02:37:06 -0000 1.3
+++ VelocitySecureAction.java 20 Jun 2003 22:09:12 -0000 1.4
@@ -80,7 +80,7 @@
*
* @param data Turbine information.
* @param context Context for web pages.
- * @exception Exception, a generic exception.
+ * @throws Exception a generic exception.
*/
public abstract void doPerform(RunData data, Context context)
throws Exception;
@@ -90,7 +90,7 @@
* perform a security check first.
*
* @param data Turbine information.
- * @exception Exception, a generic exception.
+ * @throws Exception a generic exception.
*/
protected void perform(RunData data) throws Exception
{
@@ -103,12 +103,11 @@
/**
* 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
- * WebMacroSecurityCheck utility.
+ * user to be sent to if they're unauthorized.
*
* @param data Turbine information.
* @return True if the user is authorized to access the screen.
- * @exception Exception, a generic exception.
+ * @throws Exception a generic exception.
*/
protected abstract boolean isAuthorized(RunData data)
throws Exception;
1.5 +4 -4 jakarta-turbine-2/src/java/org/apache/turbine/modules/navigations/TemplateNavigation.java
Index: TemplateNavigation.java
===================================================================
RCS file: /home/cvs/jakarta-turbine-2/src/java/org/apache/turbine/modules/navigations/TemplateNavigation.java,v
retrieving revision 1.4
retrieving revision 1.5
diff -u -r1.4 -r1.5
--- TemplateNavigation.java 11 Mar 2003 13:55:22 -0000 1.4
+++ TemplateNavigation.java 20 Jun 2003 22:09:13 -0000 1.5
@@ -75,7 +75,7 @@
* information to the context.
*
* @param data Turbine information.
- * @exception Exception, a generic exception.
+ * @throws Exception a generic exception.
*/
protected abstract void doBuildTemplate(RunData data)
throws Exception;
@@ -85,7 +85,7 @@
*
* @param data Turbine information.
* @return A ConcreteElement.
- * @exception Exception, a generic exception.
+ * @throws Exception a generic exception.
*/
public abstract ConcreteElement buildTemplate(RunData data)
throws Exception;
@@ -95,7 +95,7 @@
*
* @param data Turbine information.
* @return A ConcreteElement.
- * @exception Exception, a generic exception.
+ * @throws Exception a generic exception.
*/
protected ConcreteElement doBuild(RunData data)
throws Exception
1.5 +5 -3 jakarta-turbine-2/src/java/org/apache/turbine/modules/navigations/BaseJspNavigation.java
Index: BaseJspNavigation.java
===================================================================
RCS file: /home/cvs/jakarta-turbine-2/src/java/org/apache/turbine/modules/navigations/BaseJspNavigation.java,v
retrieving revision 1.4
retrieving revision 1.5
diff -u -r1.4 -r1.5
--- BaseJspNavigation.java 11 Mar 2003 13:55:22 -0000 1.4
+++ BaseJspNavigation.java 20 Jun 2003 22:09:13 -0000 1.5
@@ -79,7 +79,8 @@
/**
* Method to be overidden by subclasses to include data in beans, etc.
*
- * @param data, the Rundata object
+ * @param data the Rundata object
+ * @throws Exception a generic exception.
*/
protected void doBuildTemplate(RunData data)
throws Exception
@@ -89,8 +90,9 @@
/**
* Method that sets up beans and forward the request to the JSP.
*
- * @param RunData
+ * @param data the Rundata object
* @return null - the JSP sends the information
+ * @throws Exception a generic exception.
*/
public ConcreteElement buildTemplate(RunData data)
throws Exception
1.6 +4 -3 jakarta-turbine-2/src/java/org/apache/turbine/modules/navigations/DefaultTopNavigation.java
Index: DefaultTopNavigation.java
===================================================================
RCS file: /home/cvs/jakarta-turbine-2/src/java/org/apache/turbine/modules/navigations/DefaultTopNavigation.java,v
retrieving revision 1.5
retrieving revision 1.6
diff -u -r1.5 -r1.6
--- DefaultTopNavigation.java 11 Mar 2003 13:56:04 -0000 1.5
+++ DefaultTopNavigation.java 20 Jun 2003 22:09:13 -0000 1.6
@@ -72,8 +72,9 @@
public class DefaultTopNavigation
extends Navigation
{
- private static String txt =
- "Turbine - A Servlet Framework for building Secure Dynamic Websites.";
+ /** The string to display */
+ private static String txt = "Turbine - A Servlet Framework for building "
+ + "Secure Dynamic Websites.";
/**
* Build the Navigation.
1.9 +16 -12 jakarta-turbine-2/src/java/org/apache/turbine/modules/actions/sessionvalidator/TemplateSessionValidator.java
Index: TemplateSessionValidator.java
===================================================================
RCS file: /home/cvs/jakarta-turbine-2/src/java/org/apache/turbine/modules/actions/sessionvalidator/TemplateSessionValidator.java,v
retrieving revision 1.8
retrieving revision 1.9
diff -u -r1.8 -r1.9
--- TemplateSessionValidator.java 9 Mar 2003 02:34:36 -0000 1.8
+++ TemplateSessionValidator.java 20 Jun 2003 22:09:13 -0000 1.9
@@ -117,10 +117,11 @@
}
// make sure we have some way to return a response
- if (!data.hasScreen() &&
- StringUtils.isEmpty(data.getTemplateInfo().getScreenTemplate()))
+ if (!data.hasScreen() && StringUtils.isEmpty(
+ data.getTemplateInfo().getScreenTemplate()))
{
- String template = conf.getString(TurbineConstants.TEMPLATE_HOMEPAGE);
+ String template = conf.getString(
+ TurbineConstants.TEMPLATE_HOMEPAGE);
if (StringUtils.isNotEmpty(template))
{
@@ -128,7 +129,8 @@
}
else
{
- data.setScreen(conf.getString(TurbineConstants.SCREEN_HOMEPAGE));
+ data.setScreen(conf.getString(
+ TurbineConstants.SCREEN_HOMEPAGE));
}
}
// the session_access_counter can be placed as a hidden field in
@@ -137,22 +139,24 @@
else if (data.getParameters().containsKey("_session_access_counter"))
{
// See comments in screens.error.InvalidState.
- if (data.getParameters().getInt("_session_access_counter") <
- (((Integer) data.getUser().getTemp("_session_access_counter"))
- .intValue() - 1))
+ if (data.getParameters().getInt("_session_access_counter")
+ < (((Integer) data.getUser().getTemp(
+ "_session_access_counter")).intValue() - 1))
{
if (data.getTemplateInfo().getScreenTemplate() != null)
{
data.getUser().setTemp("prev_template",
- data.getTemplateInfo().getScreenTemplate()
- .replace('/', ','));
- data.getTemplateInfo().setScreenTemplate(conf.getString(TurbineConstants.TEMPLATE_INVALID_STATE));
+ data.getTemplateInfo().getScreenTemplate()
+ .replace('/', ','));
+ data.getTemplateInfo().setScreenTemplate(conf.getString(
+ TurbineConstants.TEMPLATE_INVALID_STATE));
}
else
{
data.getUser().setTemp("prev_screen",
data.getScreen().replace('/', ','));
- data.setScreen(conf.getString(TurbineConstants.SCREEN_INVALID_STATE));
+ data.setScreen(conf.getString(
+ TurbineConstants.SCREEN_INVALID_STATE));
}
data.getUser().setTemp("prev_parameters", data.getParameters());
data.setAction("");
1.11 +8 -6 jakarta-turbine-2/src/java/org/apache/turbine/modules/actions/sessionvalidator/DefaultSessionValidator.java
Index: DefaultSessionValidator.java
===================================================================
RCS file: /home/cvs/jakarta-turbine-2/src/java/org/apache/turbine/modules/actions/sessionvalidator/DefaultSessionValidator.java,v
retrieving revision 1.10
retrieving revision 1.11
diff -u -r1.10 -r1.11
--- DefaultSessionValidator.java 9 Mar 2003 02:35:32 -0000 1.10
+++ DefaultSessionValidator.java 20 Jun 2003 22:09:13 -0000 1.11
@@ -145,20 +145,22 @@
if (!data.hasScreen())
{
- data.setMessage(conf.getString(TurbineConstants.LOGIN_MESSAGE_NOSCREEN));
+ data.setMessage(conf.getString(
+ TurbineConstants.LOGIN_MESSAGE_NOSCREEN));
data.setScreen(conf.getString(TurbineConstants.SCREEN_HOMEPAGE));
}
if (data.getParameters().containsKey("_session_access_counter"))
{
// See comments in screens.error.InvalidState.
- if (data.getParameters().getInt("_session_access_counter") <
- (((Integer) data.getUser().getTemp("_session_access_counter"))
- .intValue() - 1))
+ if (data.getParameters().getInt("_session_access_counter")
+ < (((Integer) data.getUser().getTemp(
+ "_session_access_counter")).intValue() - 1))
{
data.getUser().setTemp("prev_screen", data.getScreen());
data.getUser().setTemp("prev_parameters", data.getParameters());
- data.setScreen(conf.getString(TurbineConstants.SCREEN_INVALID_STATE));
+ data.setScreen(conf.getString(
+ TurbineConstants.SCREEN_INVALID_STATE));
data.setAction("");
}
}
1.11 +20 -14 jakarta-turbine-2/src/java/org/apache/turbine/modules/actions/sessionvalidator/TemplateSecureSessionValidator.java
Index: TemplateSecureSessionValidator.java
===================================================================
RCS file: /home/cvs/jakarta-turbine-2/src/java/org/apache/turbine/modules/actions/sessionvalidator/TemplateSecureSessionValidator.java,v
retrieving revision 1.10
retrieving revision 1.11
diff -u -r1.10 -r1.11
--- TemplateSecureSessionValidator.java 9 Mar 2003 02:34:55 -0000 1.10
+++ TemplateSecureSessionValidator.java 20 Jun 2003 22:09:13 -0000 1.11
@@ -96,7 +96,8 @@
extends SessionValidator
{
/** Logging */
- private static Log log = LogFactory.getLog(TemplateSecureSessionValidator.class);
+ private static Log log = LogFactory.getLog(
+ TemplateSecureSessionValidator.class);
/**
* doPerform is virtually identical to DefaultSessionValidator
@@ -142,7 +143,8 @@
String loginTemplate =
conf.getString(TurbineConstants.TEMPLATE_LOGIN);
- log.debug("Sending User to the Login Screen (" + loginTemplate + ")");
+ log.debug("Sending User to the Login Screen ("
+ + loginTemplate + ")");
data.getTemplateInfo().setScreenTemplate(loginTemplate);
// We're not doing any actions buddy! (except action.login which
@@ -153,10 +155,11 @@
log.debug("Login Check finished!");
// Make sure we have some way to return a response.
- if (!data.hasScreen() &&
- StringUtils.isEmpty(data.getTemplateInfo().getScreenTemplate()))
+ if (!data.hasScreen() && StringUtils.isEmpty(
+ data.getTemplateInfo().getScreenTemplate()))
{
- String template = conf.getString(TurbineConstants.TEMPLATE_HOMEPAGE);
+ String template = conf.getString(
+ TurbineConstants.TEMPLATE_HOMEPAGE);
if (StringUtils.isNotEmpty(template))
{
@@ -164,7 +167,8 @@
}
else
{
- data.setScreen(conf.getString(TurbineConstants.SCREEN_HOMEPAGE));
+ data.setScreen(conf.getString(
+ TurbineConstants.SCREEN_HOMEPAGE));
}
}
@@ -176,22 +180,24 @@
if (data.getParameters().containsKey("_session_access_counter"))
{
// See comments in screens.error.InvalidState.
- if (data.getParameters().getInt("_session_access_counter") <
- (((Integer) data.getUser().getTemp("_session_access_counter"))
- .intValue() - 1))
+ if (data.getParameters().getInt("_session_access_counter")
+ < (((Integer) data.getUser().getTemp(
+ "_session_access_counter")).intValue() - 1))
{
if (data.getTemplateInfo().getScreenTemplate() != null)
{
data.getUser().setTemp("prev_template",
- data.getTemplateInfo().getScreenTemplate()
- .replace('/', ','));
- data.getTemplateInfo().setScreenTemplate(conf.getString(TurbineConstants.TEMPLATE_INVALID_STATE));
+ data.getTemplateInfo().getScreenTemplate()
+ .replace('/', ','));
+ data.getTemplateInfo().setScreenTemplate(conf.getString(
+ TurbineConstants.TEMPLATE_INVALID_STATE));
}
else
{
data.getUser().setTemp("prev_screen",
data.getScreen().replace('/', ','));
- data.setScreen(conf.getString(TurbineConstants.SCREEN_INVALID_STATE));
+ data.setScreen(conf.getString(
+ TurbineConstants.SCREEN_INVALID_STATE));
}
data.getUser().setTemp("prev_parameters", data.getParameters());
data.setAction("");
---------------------------------------------------------------------
To unsubscribe, e-mail: turbine-dev-unsubscribe@jakarta.apache.org
For additional commands, e-mail: turbine-dev-help@jakarta.apache.org