KickJava   Java API By Example, From Geeks To Geeks.

Java > Open Source Codes > org > jahia > deprecated > taglibs > button > PagePropertiesButtonTag


1 package org.jahia.deprecated.taglibs.button;
2
3 import javax.servlet.jsp.JspException JavaDoc;
4
5 import org.jahia.data.JahiaData;
6 import org.jahia.exceptions.JahiaException;
7 import org.jahia.services.usermanager.JahiaUser;
8
9
10 /**
11  * Class PagePropertiesButtonTag : returns the full link ("<a href...>...</a>") allowing to
12  * open the page properties popup window if the user is authorized
13  *
14  * @author Jerome Tamiotti
15  */

16 public class PagePropertiesButtonTag extends AbstractButtonTag {
17
18     private String JavaDoc title = "Page&nbsp;Properties";
19     private String JavaDoc style = "";
20
21     public void setTitle(String JavaDoc title) {
22         this.title = title;
23     }
24
25     public void setStyle(String JavaDoc style) {
26         this.style = style;
27     }
28
29     public String JavaDoc getTitle() {
30         return this.title;
31     }
32
33     public String JavaDoc getStyle() {
34         return this.style;
35     }
36
37     public boolean testRights(JahiaData jData) {
38         JahiaUser user = jData.params().getUser();
39         return jData.page().checkWriteAccess(user)
40                 && jData.gui().isEditMode();
41     }
42
43     public String JavaDoc getLauncher(JahiaData jData) throws JahiaException {
44         return "javascript:" + jData.gui().html().drawPagePropertiesLauncher();
45     }
46
47     public int doEndTag() throws JspException JavaDoc {
48         // let's reinitialize the tag variables to allow tag object reuse in
49
// pooling.
50
title = "Page&nbsp;Properties";
51         style = "";
52         return EVAL_PAGE;
53     }
54
55 }
56
Popular Tags