001    /**
002     * Copyright (c) 2000-2013 Liferay, Inc. All rights reserved.
003     *
004     * The contents of this file are subject to the terms of the Liferay Enterprise
005     * Subscription License ("License"). You may not use this file except in
006     * compliance with the License. You can obtain a copy of the License by
007     * contacting Liferay, Inc. See the License for the specific language governing
008     * permissions and limitations under the License, including but not limited to
009     * distribution rights of the Software.
010     *
011     *
012     *
013     */
014    
015    package com.liferay.taglib.ui;
016    
017    import com.liferay.portal.kernel.util.GetterUtil;
018    import com.liferay.portal.kernel.util.PropsKeys;
019    import com.liferay.portal.kernel.util.PropsUtil;
020    import com.liferay.portal.kernel.util.Tuple;
021    import com.liferay.portlet.messageboards.model.MBMessage;
022    import com.liferay.taglib.util.IncludeTag;
023    
024    import java.util.List;
025    
026    import javax.servlet.http.HttpServletRequest;
027    
028    /**
029     * @author Eudaldo Alonso
030     * @author Tibor Lipusz
031     */
032    public class AppViewSearchEntryTag extends IncludeTag {
033    
034            @Override
035            public int doStartTag() {
036                    return EVAL_BODY_INCLUDE;
037            }
038    
039            public void setActionJsp(String actionJsp) {
040                    _actionJsp = actionJsp;
041            }
042    
043            public void setContainerIcon(String containerIcon) {
044                    _containerIcon = containerIcon;
045            }
046    
047            public void setContainerName(String containerName) {
048                    _containerName = containerName;
049            }
050    
051            public void setContainerSrc(String containerSrc) {
052                    _containerSrc = containerSrc;
053            }
054    
055            public void setContainerType(String containerType) {
056                    _containerType = containerType;
057            }
058    
059            public void setCssClass(String cssClass) {
060                    _cssClass = cssClass;
061            }
062    
063            public void setDescription(String description) {
064                    _description = description;
065            }
066    
067            public void setFileEntryTuples(List<Tuple> fileEntryTuples) {
068                    _fileEntryTuples = fileEntryTuples;
069            }
070    
071            public void setHighlightEnabled(boolean highlightEnabled) {
072                    _highlightEnabled = highlightEnabled;
073            }
074    
075            public void setLocked(boolean locked) {
076                    _locked = locked;
077            }
078    
079            public void setMbMessages(List<MBMessage> mbMessages) {
080                    _mbMessages = mbMessages;
081            }
082    
083            public void setQueryTerms(String[] queryTerms) {
084                    _queryTerms = queryTerms;
085            }
086    
087            public void setRowCheckerId(String rowCheckerId) {
088                    _rowCheckerId = rowCheckerId;
089            }
090    
091            public void setRowCheckerName(String rowCheckerName) {
092                    _rowCheckerName = rowCheckerName;
093            }
094    
095            public void setShowCheckbox(boolean showCheckbox) {
096                    _showCheckbox = showCheckbox;
097            }
098    
099            public void setStatus(int status) {
100                    _status = status;
101            }
102    
103            public void setThumbnailSrc(String thumbnailSrc) {
104                    _thumbnailSrc = thumbnailSrc;
105            }
106    
107            public void setTitle(String title) {
108                    _title = title;
109            }
110    
111            public void setUrl(String url) {
112                    _url = url;
113            }
114    
115            public void setVersions(List<String> versions) {
116                    _versions = versions;
117            }
118    
119            @Override
120            protected void cleanUp() {
121                    _actionJsp = null;
122                    _containerIcon = null;
123                    _containerName = null;
124                    _containerSrc = null;
125                    _containerType = null;
126                    _cssClass = null;
127                    _description = null;
128                    _fileEntryTuples = null;
129                    _highlightEnabled = _HIGHLIGHT_ENABLED;
130                    _locked = false;
131                    _mbMessages = null;
132                    _queryTerms = null;
133                    _rowCheckerId = null;
134                    _rowCheckerName = null;
135                    _showCheckbox = false;
136                    _status = 0;
137                    _thumbnailSrc = null;
138                    _title = null;
139                    _url = null;
140                    _versions = null;
141            }
142    
143            @Override
144            protected String getPage() {
145                    return _PAGE;
146            }
147    
148            @Override
149            protected boolean isCleanUpSetAttributes() {
150                    return _CLEAN_UP_SET_ATTRIBUTES;
151            }
152    
153            @Override
154            protected void setAttributes(HttpServletRequest request) {
155                    request.setAttribute(
156                            "liferay-ui:app-view-search-entry:actionJsp", _actionJsp);
157                    request.setAttribute(
158                            "liferay-ui:app-view-search-entry:containerIcon", _containerIcon);
159                    request.setAttribute(
160                            "liferay-ui:app-view-search-entry:containerName", _containerName);
161                    request.setAttribute(
162                            "liferay-ui:app-view-search-entry:containerSrc", _containerSrc);
163                    request.setAttribute(
164                            "liferay-ui:app-view-search-entry:containerType", _containerType);
165                    request.setAttribute(
166                            "liferay-ui:app-view-search-entry:cssClass", _cssClass);
167                    request.setAttribute(
168                            "liferay-ui:app-view-search-entry:description", _description);
169                    request.setAttribute(
170                            "liferay-ui:app-view-search-entry:fileEntryTuples",
171                            _fileEntryTuples);
172                    request.setAttribute(
173                            "liferay-ui:app-view-search-entry:highlightEnabled",
174                            _highlightEnabled);
175                    request.setAttribute(
176                            "liferay-ui:app-view-search-entry:locked", _locked);
177                    request.setAttribute(
178                            "liferay-ui:app-view-search-entry:mbMessages", _mbMessages);
179                    request.setAttribute(
180                            "liferay-ui:app-view-search-entry:queryTerms", _queryTerms);
181                    request.setAttribute(
182                            "liferay-ui:app-view-search-entry:rowCheckerId", _rowCheckerId);
183                    request.setAttribute(
184                            "liferay-ui:app-view-search-entry:rowCheckerName", _rowCheckerName);
185                    request.setAttribute(
186                            "liferay-ui:app-view-search-entry:showCheckbox", _showCheckbox);
187                    request.setAttribute(
188                            "liferay-ui:app-view-search-entry:status", _status);
189                    request.setAttribute(
190                            "liferay-ui:app-view-search-entry:thumbnailSrc", _thumbnailSrc);
191                    request.setAttribute("liferay-ui:app-view-search-entry:title", _title);
192                    request.setAttribute("liferay-ui:app-view-search-entry:url", _url);
193                    request.setAttribute(
194                            "liferay-ui:app-view-search-entry:versions", _versions);
195            }
196    
197            private static final boolean _CLEAN_UP_SET_ATTRIBUTES = true;
198    
199            private static final boolean _HIGHLIGHT_ENABLED =
200                    GetterUtil.getBoolean(
201                            PropsUtil.get(PropsKeys.INDEX_SEARCH_HIGHLIGHT_ENABLED));
202    
203            private static final String _PAGE =
204                    "/html/taglib/ui/app_view_search_entry/page.jsp";
205    
206            private String _actionJsp;
207            private String _containerIcon;
208            private String _containerName;
209            private String _containerSrc;
210            private String _containerType;
211            private String _cssClass;
212            private String _description;
213            private List<Tuple> _fileEntryTuples;
214            private boolean _highlightEnabled = _HIGHLIGHT_ENABLED;
215            private boolean _locked;
216            private List<MBMessage> _mbMessages;
217            private String[] _queryTerms;
218            private String _rowCheckerId;
219            private String _rowCheckerName;
220            private boolean _showCheckbox = false;
221            private int _status = 0;
222            private String _thumbnailSrc;
223            private String _title;
224            private String _url;
225            private List<String> _versions;
226    
227    }