View Javadoc

1   /*
2    * Licensed to the Apache Software Foundation (ASF) under one or more
3    * contributor license agreements.  See the NOTICE file distributed with
4    * this work for additional information regarding copyright ownership.
5    * The ASF licenses this file to You under the Apache License, Version 2.0
6    * (the "License"); you may not use this file except in compliance with
7    * the License.  You may obtain a copy of the License at
8    * 
9    *      http://www.apache.org/licenses/LICENSE-2.0
10   * 
11   * Unless required by applicable law or agreed to in writing, software
12   * distributed under the License is distributed on an "AS IS" BASIS,
13   * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
14   * See the License for the specific language governing permissions and
15   * limitations under the License.
16   */
17  package org.apache.jetspeed.profiler.impl;
18  
19  import org.apache.commons.logging.Log;
20  import org.apache.commons.logging.LogFactory;
21  import org.apache.jetspeed.layout.PortletActionSecurityBehavior;
22  import org.apache.jetspeed.pipeline.PipelineException;
23  import org.apache.jetspeed.pipeline.valve.AbstractValve;
24  import org.apache.jetspeed.pipeline.valve.Valve;
25  import org.apache.jetspeed.pipeline.valve.ValveContext;
26  import org.apache.jetspeed.request.RequestContext;
27  
28  /***
29   * ProfilerValveImpl
30   * 
31   * @author <a href="mailto:taylor@apache.org">David Sean Taylor </a>
32   * @version $Id: ProfilerValveImpl.java 388733 2006-03-25 09:03:58Z rwatler $
33   */
34  public class CreatePageValveImpl extends AbstractValve implements Valve
35  {
36      protected Log log = LogFactory.getLog(CreatePageValveImpl.class);
37      
38      private PortletActionSecurityBehavior securityBehavior;
39  
40      /***
41       * CreatePageValveImpl - constructor
42       *
43       * @param securityBehavior the behavior to create new page for new user
44       */
45      public CreatePageValveImpl(PortletActionSecurityBehavior behavior)
46      {
47          this.securityBehavior = behavior;
48      }
49  
50      
51      /*
52       * (non-Javadoc)
53       * 
54       * @see org.apache.jetspeed.pipeline.valve.Valve#invoke(org.apache.jetspeed.request.RequestContext,
55       *      org.apache.jetspeed.pipeline.valve.ValveContext)
56       */
57      public void invoke( RequestContext request, ValveContext context ) throws PipelineException
58      {
59          securityBehavior.createNewPageOnEdit(request);
60          context.invokeNext(request);
61      }
62  
63  }