1
22
23 package com.liferay.taglib.ui;
24
25 import com.liferay.portal.kernel.dao.search.RowChecker;
26 import com.liferay.portal.kernel.servlet.PortalIncludeUtil;
27 import com.liferay.portal.kernel.util.Validator;
28
29 import java.util.LinkedHashMap;
30
31 import javax.portlet.PortletURL;
32
33 import javax.servlet.http.HttpServletRequest;
34 import javax.servlet.jsp.JspException;
35 import javax.servlet.jsp.tagext.TagSupport;
36
37
42 public class GroupSearchTag extends TagSupport {
43
44 public int doEndTag() throws JspException {
45 try {
46 PortalIncludeUtil.include(pageContext, getEndPage());
47
48 return EVAL_PAGE;
49 }
50 catch (Exception e) {
51 throw new JspException(e);
52 }
53 }
54
55 public int doStartTag() throws JspException {
56 try {
57 HttpServletRequest request =
58 (HttpServletRequest)pageContext.getRequest();
59
60 request.setAttribute(
61 "liferay-ui:group-search:groupParams", _groupParams);
62 request.setAttribute(
63 "liferay-ui:group-search:portletURL", _portletURL);
64 request.setAttribute(
65 "liferay-ui:group-search:rowChecker", _rowChecker);
66
67 PortalIncludeUtil.include(pageContext, getStartPage());
68
69 return EVAL_BODY_INCLUDE;
70 }
71 catch (Exception e) {
72 throw new JspException(e);
73 }
74 }
75
76 public String getEndPage() {
77 if (Validator.isNull(_endPage)) {
78 return _END_PAGE;
79 }
80 else {
81 return _endPage;
82 }
83 }
84
85 public String getStartPage() {
86 if (Validator.isNull(_startPage)) {
87 return _START_PAGE;
88 }
89 else {
90 return _startPage;
91 }
92 }
93
94 public void setEndPage(String endPage) {
95 _endPage = endPage;
96 }
97
98 public void setGroupParams(LinkedHashMap<String, Object> groupParams) {
99 _groupParams = groupParams;
100 }
101
102 public void setPortletURL(PortletURL portletURL) {
103 _portletURL = portletURL;
104 }
105
106 public void setRowChecker(RowChecker rowChecker) {
107 _rowChecker = rowChecker;
108 }
109
110 public void setStartPage(String startPage) {
111 _startPage = startPage;
112 }
113
114 private static final String _END_PAGE =
115 "/html/taglib/ui/group_search/end.jsp";
116
117 private static final String _START_PAGE =
118 "/html/taglib/ui/group_search/start.jsp";
119
120 private String _endPage;
121 private LinkedHashMap<String, Object> _groupParams;
122 private PortletURL _portletURL;
123 private RowChecker _rowChecker;
124 private String _startPage;
125
126 }