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