1
14
15 package com.liferay.taglib.ui;
16
17 import com.liferay.portal.kernel.dao.search.ResultRow;
18 import com.liferay.portal.kernel.dao.search.SearchEntry;
19 import com.liferay.portal.kernel.util.StringPool;
20
21 import java.util.List;
22
23 import javax.servlet.jsp.JspException;
24 import javax.servlet.jsp.JspTagException;
25
26
31 public class SearchContainerColumnJSPTag extends SearchContainerColumnTag {
32
33 public int doEndTag() {
34 try {
35 SearchContainerRowTag parentTag =
36 (SearchContainerRowTag)findAncestorWithClass(
37 this, SearchContainerRowTag.class);
38
39 ResultRow row = parentTag.getRow();
40
41 if (index <= -1) {
42 index = row.getEntries().size();
43 }
44
45 row.addJSP(
46 index, getAlign(), getValign(), getColspan(), getPath(),
47 pageContext.getServletContext(), getServletRequest(),
48 getServletResponse());
49
50 return EVAL_PAGE;
51 }
52 finally {
53 align = SearchEntry.DEFAULT_ALIGN;
54 colspan = SearchEntry.DEFAULT_COLSPAN;
55 index = -1;
56 name = StringPool.BLANK;
57 _path = null;
58 valign = SearchEntry.DEFAULT_VALIGN;
59 }
60 }
61
62 public int doStartTag() throws JspException {
63 SearchContainerRowTag parentRowTag =
64 (SearchContainerRowTag)findAncestorWithClass(
65 this, SearchContainerRowTag.class);
66
67 if (parentRowTag == null) {
68 throw new JspTagException(
69 "Requires liferay-ui:search-container-row");
70 }
71
72 if (!parentRowTag.isHeaderNamesAssigned()) {
73 List<String> headerNames = parentRowTag.getHeaderNames();
74
75 headerNames.add(name);
76 }
77
78 return EVAL_BODY_INCLUDE;
79 }
80
81 public String getPath() {
82 return _path;
83 }
84
85 public void setPath(String path) {
86 _path = path;
87 }
88
89 private String _path;
90
91 }