001
014
015 package com.liferay.taglib.ui;
016
017 import com.liferay.portal.kernel.util.MethodKey;
018 import com.liferay.portal.kernel.util.PortalClassInvoker;
019 import com.liferay.portal.kernel.util.StringPool;
020 import com.liferay.taglib.util.IncludeTag;
021
022 import javax.servlet.jsp.JspException;
023 import javax.servlet.jsp.PageContext;
024
025
029 public class InputPermissionsTag extends IncludeTag {
030
031 public static String doTag(
032 String formName, String modelName, PageContext pageContext)
033 throws Exception {
034
035 return doTag(_PAGE, formName, modelName, pageContext);
036 }
037
038 public static String doTag(
039 String page, String formName, String modelName,
040 PageContext pageContext)
041 throws Exception {
042
043 Object returnObj = PortalClassInvoker.invoke(
044 false, _doEndTagMethodKey, page, formName, modelName, pageContext);
045
046 if (returnObj != null) {
047 return returnObj.toString();
048 }
049 else {
050 return StringPool.BLANK;
051 }
052 }
053
054 public int doEndTag() throws JspException {
055 try {
056 doTag(getPage(), _formName, _modelName, pageContext);
057
058 return EVAL_PAGE;
059 }
060 catch (Exception e) {
061 throw new JspException(e);
062 }
063 }
064
065 public void setFormName(String formName) {
066 _formName = formName;
067 }
068
069 public void setModelName(String modelName) {
070 _modelName = modelName;
071 }
072
073 protected String getPage() {
074 return _PAGE;
075 }
076
077 private static final String _TAG_CLASS =
078 "com.liferay.portal.servlet.taglib.ui.InputPermissionsTagUtil";
079
080 private static final String _PAGE =
081 "/html/taglib/ui/input_permissions/page.jsp";
082
083 private static MethodKey _doEndTagMethodKey = new MethodKey(
084 _TAG_CLASS, "doEndTag", String.class, String.class, String.class,
085 PageContext.class);
086
087 private String _formName = "fm";
088 private String _modelName = null;
089
090 }