001    /**
002     * Copyright (c) 2000-2011 Liferay, Inc. All rights reserved.
003     *
004     * This library is free software; you can redistribute it and/or modify it under
005     * the terms of the GNU Lesser General Public License as published by the Free
006     * Software Foundation; either version 2.1 of the License, or (at your option)
007     * any later version.
008     *
009     * This library is distributed in the hope that it will be useful, but WITHOUT
010     * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS
011     * FOR A PARTICULAR PURPOSE. See the GNU Lesser General Public License for more
012     * details.
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    }