001
014
015 package com.liferay.taglib.ui;
016
017 import com.liferay.portal.kernel.dao.search.ResultRow;
018 import com.liferay.portal.kernel.util.GetterUtil;
019
020 import javax.servlet.jsp.JspException;
021 import javax.servlet.jsp.JspTagException;
022 import javax.servlet.jsp.tagext.TagSupport;
023
024
027 public class SearchContainerRowParameterTag extends TagSupport {
028
029 public int doStartTag() throws JspException {
030 SearchContainerRowTag parentRowTag =
031 (SearchContainerRowTag)findAncestorWithClass(
032 this, SearchContainerRowTag.class);
033
034 if (parentRowTag == null) {
035 throw new JspTagException(
036 "Requires liferay-ui:search-container-row");
037 }
038
039 ResultRow row = parentRowTag.getRow();
040
041 if (_name.equals("className")) {
042 row.setClassName(_name);
043 }
044 else if (_name.equals("classHoverName")) {
045 row.setClassHoverName((String)_value);
046 }
047 else if (_name.equals("restricted")) {
048 row.setRestricted(GetterUtil.getBoolean((String)_value, false));
049 }
050 else {
051 row.setParameter(_name, _value);
052 }
053
054 return EVAL_BODY_INCLUDE;
055 }
056
057 public void setName(String name) {
058 _name = name;
059 }
060
061 public void setValue(Object value) {
062 _value = value;
063 }
064
065 private String _name;
066 private Object _value;
067
068 }