001    /**
002     * Copyright (c) 2000-2010 Liferay, Inc. All rights reserved.
003     *
004     * The contents of this file are subject to the terms of the Liferay Enterprise
005     * Subscription License ("License"). You may not use this file except in
006     * compliance with the License. You can obtain a copy of the License by
007     * contacting Liferay, Inc. See the License for the specific language governing
008     * permissions and limitations under the License, including but not limited to
009     * distribution rights of the Software.
010     *
011     *
012     *
013     */
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    
021    import javax.servlet.jsp.JspException;
022    import javax.servlet.jsp.PageContext;
023    import javax.servlet.jsp.tagext.TagSupport;
024    
025    /**
026     * @author Brian Wing Shun Chan
027     * @author Jorge Ferrer
028     */
029    public class InputPermissionsParamsTag extends TagSupport {
030    
031            public static String doTag(
032                            String modelName, PageContext pageContext)
033                    throws Exception {
034    
035                    Object returnObj = PortalClassInvoker.invoke(
036                            false, _doEndTagMethodKey, modelName, pageContext);
037    
038                    if (returnObj != null) {
039                            return returnObj.toString();
040                    }
041                    else {
042                            return StringPool.BLANK;
043                    }
044            }
045    
046            public int doEndTag() throws JspException {
047                    try {
048                            doTag(_modelName, pageContext);
049    
050                            return EVAL_PAGE;
051                    }
052                    catch (Exception e) {
053                            throw new JspException(e);
054                    }
055            }
056    
057            public void setModelName(String modelName) {
058                    _modelName = modelName;
059            }
060    
061            private static final String _TAG_CLASS =
062                    "com.liferay.portal.servlet.taglib.ui.InputPermissionsParamsTagUtil";
063    
064            private static MethodKey _doEndTagMethodKey = new MethodKey(
065                    _TAG_CLASS, "doEndTag", String.class, PageContext.class);
066    
067            private String _modelName;
068    
069    }