You are viewing a plain text version of this content. The canonical link for it is here.
Posted to dev@turbine.apache.org by jv...@apache.org on 2002/02/05 16:37:42 UTC
cvs commit: jakarta-turbine-3/src/java/org/apache/turbine/pipeline DefaultTargetValve.java DefaultACLCreationValve.java DefaultLoginValve.java
jvanzyl 02/02/05 07:37:42
Modified: src/java/org/apache/turbine/pipeline Tag:
rundata_security_changes DefaultTargetValve.java
Removed: src/java/org/apache/turbine/pipeline Tag:
rundata_security_changes
DefaultACLCreationValve.java DefaultLoginValve.java
Log:
- adjustments to allow for the more flexible security model.
Revision Changes Path
No revision
No revision
1.8.2.1 +14 -46 jakarta-turbine-3/src/java/org/apache/turbine/pipeline/DefaultTargetValve.java
Index: DefaultTargetValve.java
===================================================================
RCS file: /home/cvs/jakarta-turbine-3/src/java/org/apache/turbine/pipeline/DefaultTargetValve.java,v
retrieving revision 1.8
retrieving revision 1.8.2.1
diff -u -r1.8 -r1.8.2.1
--- DefaultTargetValve.java 24 Jan 2002 03:55:26 -0000 1.8
+++ DefaultTargetValve.java 5 Feb 2002 15:37:42 -0000 1.8.2.1
@@ -58,7 +58,6 @@
import java.util.Enumeration;
import org.apache.commons.collections.ExtendedProperties;
-import org.apache.fulcrum.security.util.AccessControlList;
import org.apache.turbine.DynamicURI;
import org.apache.turbine.Turbine;
import org.apache.turbine.TurbineConstants;
@@ -69,7 +68,6 @@
import org.apache.turbine.Valve;
import org.apache.turbine.ValveContext;
import org.apache.turbine.modules.Module;
-import org.apache.turbine.modules.actions.AccessController;
import org.apache.log4j.Category;
/**
@@ -81,12 +79,12 @@
* @author <a href="mailto:dlr@finemaltcoding.com">Daniel Rall</a>
* @author <a href="mailto:mikeh@apache.org">Mike Haberman</a>
* @author <a href="mailto:james@jamestaylor.org">James Taylor</a>
- * @version $Id: DefaultTargetValve.java,v 1.8 2002/01/24 03:55:26 jvanzyl Exp $
+ * @version $Id: DefaultTargetValve.java,v 1.8.2.1 2002/02/05 15:37:42 jvanzyl Exp $
*/
public class DefaultTargetValve
extends AbstractValve
{
- private static final Category log =
+ private static final Category log =
Category.getInstance(DefaultTargetValve.class);
protected static final String DEFAULT_MODULE_TYPE = "screens";
@@ -105,7 +103,7 @@
if (cfg != null)
{
// Get the module type
- targetModuleType =
+ targetModuleType =
cfg.getString("pipeline.default.targetModuleType",
DEFAULT_MODULE_TYPE);
}
@@ -118,9 +116,8 @@
throws IOException, TurbineException
{
try
- {
+ {
execute(data);
- finished(data);
}
catch (Exception e)
{
@@ -143,21 +140,21 @@
data.getResponse().setContentType(data.getContentType());
// Get the target that will determine the template / layout
-
+
String target = data.getTarget();
// Get the template context, already populated by any context
// builders that were found for this target
-
+
TemplateContext context = Module.getTemplateContext( data );
- context.put( "template", target );
+ context.put( "template", target );
+
+ // Resolve the layout template for this target
- // Resolve the layout template for this target
-
String layout = Turbine.getResolver().getTemplate("layouts", target);
- // Use the renderer to render the layout,
+ // Use the renderer to render the layout,
render( data, context, layout );
}
@@ -171,46 +168,17 @@
}
Renderer r = new Renderer( data );
-
+
// FIXME: Can we remove hardcoding here?
-
+
context.put( "renderer", r );
// Render the target
-
+
String out = r.render( target );
// Write the composed string to the response
-
- data.getOut().print( out );
- }
-
- /**
- * Perform clean up.
- *
- * @param data The run-time data.
- */
- protected void finished(RunData data)
- throws Exception
- {
- TemplateContext context = Module.getTemplateContext(data);
- Module.requestFinished(context);
- // If a module has set data.acl = null, remove acl from
- // the session.
- if (data.getACL() == null)
- {
- try
- {
- data.getSession().removeValue
- (AccessControlList.SESSION_KEY);
- }
- catch (IllegalStateException invalidatedSession)
- {
- // Web was used to shut us down. Trying to clean up
- // our stuff, but it's already been done for us.
- }
- }
+ data.getOut().print( out );
}
}
-
--
To unsubscribe, e-mail: <ma...@jakarta.apache.org>
For additional commands, e-mail: <ma...@jakarta.apache.org>