KickJava   Java API By Example, From Geeks To Geeks.

Java > Open Source Codes > org > roller > presentation > tags > menu > EditorNavigationBarTag


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 JavaDoc;
9 import javax.servlet.jsp.JspException JavaDoc;
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 JavaDoc view()
29     {
30         return emit();
31     }
32
33     //-------------------------------------------------------------
34
public int doEndTag(java.io.PrintWriter JavaDoc pw) throws JspException JavaDoc
35     {
36         try
37         {
38             HttpServletRequest JavaDoc request =
39                 (HttpServletRequest JavaDoc)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 JavaDoc e)
52         {
53             mLogger.error("EditorNavigationBarTag exception",e);
54             throw new JspException JavaDoc(e);
55         }
56     }
57 }
58
59
Popular Tags