1
14
15 package com.liferay.taglib.ui;
16
17 import com.liferay.portal.kernel.util.MethodKey;
18 import com.liferay.portal.kernel.util.PortalClassInvoker;
19 import com.liferay.portal.kernel.util.StringPool;
20 import com.liferay.taglib.util.IncludeTag;
21
22 import javax.servlet.jsp.JspException;
23 import javax.servlet.jsp.PageContext;
24
25
31 public class InputPermissionsTag extends IncludeTag {
32
33 public static String doTag(
34 String formName, String modelName, PageContext pageContext)
35 throws Exception {
36
37 return doTag(_PAGE, formName, modelName, pageContext);
38 }
39
40 public static String doTag(
41 String page, String formName, String modelName,
42 PageContext pageContext)
43 throws Exception {
44
45 Object returnObj = PortalClassInvoker.invoke(
46 false, _doEndTagMethodKey, page, formName, modelName, pageContext);
47
48 if (returnObj != null) {
49 return returnObj.toString();
50 }
51 else {
52 return StringPool.BLANK;
53 }
54 }
55
56 public int doEndTag() throws JspException {
57 try {
58 doTag(getPage(), _formName, _modelName, pageContext);
59
60 return EVAL_PAGE;
61 }
62 catch (Exception e) {
63 throw new JspException(e);
64 }
65 }
66
67 public void setFormName(String formName) {
68 _formName = formName;
69 }
70
71 public void setModelName(String modelName) {
72 _modelName = modelName;
73 }
74
75 protected String getDefaultPage() {
76 return _PAGE;
77 }
78
79 private static final String _TAG_CLASS =
80 "com.liferay.portal.servlet.taglib.ui.InputPermissionsTagUtil";
81
82 private static final String _PAGE =
83 "/html/taglib/ui/input_permissions/page.jsp";
84
85 private static MethodKey _doEndTagMethodKey = new MethodKey(
86 _TAG_CLASS, "doEndTag", String.class, String.class, String.class,
87 PageContext.class);
88
89 private String _formName = "fm";
90 private String _modelName = null;
91
92 }