1   /**
2    * Copyright (c) 2000-2010 Liferay, Inc. All rights reserved.
3    *
4    * The contents of this file are subject to the terms of the Liferay Enterprise
5    * Subscription License ("License"). You may not use this file except in
6    * compliance with the License. You can obtain a copy of the License by
7    * contacting Liferay, Inc. See the License for the specific language governing
8    * permissions and limitations under the License, including but not limited to
9    * distribution rights of the Software.
10   *
11   *
12   *
13   */
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  
21  import javax.servlet.jsp.JspException;
22  import javax.servlet.jsp.PageContext;
23  import javax.servlet.jsp.tagext.TagSupport;
24  
25  /**
26   * <a href="InputPermissionsParamsTag.java.html"><b><i>View Source</i></b></a>
27   *
28   * @author Brian Wing Shun Chan
29   * @author Jorge Ferrer
30   */
31  public class InputPermissionsParamsTag extends TagSupport {
32  
33      public static String doTag(
34              String modelName, PageContext pageContext)
35          throws Exception {
36  
37          Object returnObj = PortalClassInvoker.invoke(
38              false, _doEndTagMethodKey, modelName, pageContext);
39  
40          if (returnObj != null) {
41              return returnObj.toString();
42          }
43          else {
44              return StringPool.BLANK;
45          }
46      }
47  
48      public int doEndTag() throws JspException {
49          try {
50              doTag(_modelName, pageContext);
51  
52              return EVAL_PAGE;
53          }
54          catch (Exception e) {
55              throw new JspException(e);
56          }
57      }
58  
59      public void setModelName(String modelName) {
60          _modelName = modelName;
61      }
62  
63      private static final String _TAG_CLASS =
64          "com.liferay.portal.servlet.taglib.ui.InputPermissionsParamsTagUtil";
65  
66      private static MethodKey _doEndTagMethodKey = new MethodKey(
67          _TAG_CLASS, "doEndTag", String.class, PageContext.class);
68  
69      private String _modelName;
70  
71  }