Docjar: A Java Source and Docuemnt Enginecom.*    java.*    javax.*    org.*    all    new    plug-in

Quick Search    Search Deep

Source code: org/roller/presentation/tags/menu/EditorNavigationBarTag.java


1   
2   package org.roller.presentation.tags.menu;
3   
4   import org.apache.commons.logging.Log;
5   import org.apache.commons.logging.LogFactory;
6   import org.roller.presentation.RollerRequest;
7   
8   import javax.servlet.http.HttpServletRequest;
9   import javax.servlet.jsp.JspException;
10  
11  
12  /**
13   * Draws the most complete possible Roller navigation bar based on request
14   * parameters userName, folderId and authenticated user (if there is one).
15   * @jsp.tag name="EditorNavigationBar"
16   */
17  public class EditorNavigationBarTag extends MenuTag 
18  {
19      private static Log mLogger = 
20          LogFactory.getFactory().getInstance(EditorNavigationBarTag.class);
21  
22       //------------------------------------------------------------- 
23    public EditorNavigationBarTag()
24    {
25    }
26  
27       //------------------------------------------------------------- 
28    public String view()
29    {
30      return emit();
31    }
32  
33       //------------------------------------------------------------- 
34      public int doEndTag(java.io.PrintWriter pw) throws JspException
35      {
36      try 
37      {
38        HttpServletRequest request = 
39          (HttpServletRequest)pageContext.getRequest(); 
40        RollerRequest rreq = RollerRequest.getRollerRequest(request);
41  
42        if ( rreq.isUserAuthorizedToEdit() )
43        {
44          return super.doEndTag(pw);
45        }
46        else
47        {
48          return EVAL_PAGE;
49        }
50      }
51      catch (Exception e)
52      {
53        mLogger.error("EditorNavigationBarTag exception",e);
54        throw new JspException(e);
55      }
56      }
57  }
58