KickJava   Java API By Example, From Geeks To Geeks.

Java > Open Source Codes > org > jahia > taglibs > button > WorkflowButtonTag


1 //
2
// ____.
3
// __/\ ______| |__/\. _______
4
// __ .____| | \ | +----+ \
5
// _______| /--| | | - \ _ | : - \_________
6
// \\______: :---| : : | : | \________>
7
// |__\---\_____________:______: :____|____:_____\
8
// /_____|
9
//
10
// . . . i n j a h i a w e t r u s t . . .
11
//
12
//
13

14 package org.jahia.taglibs.button;
15
16 import javax.servlet.jsp.JspException JavaDoc;
17
18 import org.jahia.data.JahiaData;
19 import org.jahia.exceptions.JahiaException;
20 import org.jahia.services.usermanager.JahiaUser;
21
22 /**
23  *
24  * <p>Title: Jahia</p>
25  * <p>Description: CMS Enterprise Portal</p>
26  * <p>Copyright: Copyright (c) 2002</p>
27  * <p>Company: Jahia SA</p>
28  * @author unascribed
29  * @version 1.0
30  */

31 public class WorkflowButtonTag extends AbstractButtonTag {
32
33     private String JavaDoc title = "Workflow";
34     private String JavaDoc style = "";
35
36     public void setTitle(String JavaDoc title) {
37         this.title = title;
38     }
39
40     public void setStyle(String JavaDoc style) {
41         this.style = style;
42     }
43
44     public String JavaDoc getTitle() {
45         return this.title;
46     }
47
48     public String JavaDoc getStyle() {
49         return this.style;
50     }
51
52     public boolean testRights(JahiaData jData) {
53         JahiaUser user = jData.params().getUser();
54         return jData.page().checkWriteAccess(user) || jData.page().checkAdminAccess(user);
55     }
56
57     public String JavaDoc getLauncher(JahiaData jData) throws JahiaException {
58         return "javascript:" + jData.gui().html().drawWorkflowLauncher();
59     }
60
61     public int doEndTag() throws JspException JavaDoc {
62         // let's reinitialize the tag variables to allow tag object reuse in
63
// pooling.
64
title = "Workflow";
65         style = "";
66         return EVAL_PAGE;
67     }
68
69
70 }
71
Popular Tags