001    /**
002     * Copyright (c) 2000-2013 Liferay, Inc. All rights reserved.
003     *
004     * This library is free software; you can redistribute it and/or modify it under
005     * the terms of the GNU Lesser General Public License as published by the Free
006     * Software Foundation; either version 2.1 of the License, or (at your option)
007     * any later version.
008     *
009     * This library is distributed in the hope that it will be useful, but WITHOUT
010     * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS
011     * FOR A PARTICULAR PURPOSE. See the GNU Lesser General Public License for more
012     * details.
013     */
014    
015    package com.liferay.taglib.ui;
016    
017    import com.liferay.portal.kernel.util.HtmlUtil;
018    import com.liferay.portal.kernel.util.Tuple;
019    import com.liferay.portlet.messageboards.model.MBMessage;
020    import com.liferay.taglib.util.IncludeTag;
021    
022    import java.util.List;
023    
024    import javax.servlet.http.HttpServletRequest;
025    
026    /**
027     * @author Eudaldo Alonso
028     */
029    public class AppViewSearchEntryTag extends IncludeTag {
030    
031            @Override
032            public int doStartTag() {
033                    return EVAL_BODY_INCLUDE;
034            }
035    
036            public void setActionJsp(String actionJsp) {
037                    _actionJsp = actionJsp;
038            }
039    
040            public void setContainerIcon(String containerIcon) {
041                    _containerIcon = containerIcon;
042            }
043    
044            public void setContainerName(String containerName) {
045                    _containerName = containerName;
046            }
047    
048            public void setContainerType(String containerType) {
049                    _containerType = containerType;
050            }
051    
052            public void setCssClass(String cssClass) {
053                    _cssClass = cssClass;
054            }
055    
056            public void setDescription(String description) {
057                    _description = HtmlUtil.unescape(description);
058            }
059    
060            public void setFileEntryTuples(List<Tuple> fileEntryTuples) {
061                    _fileEntryTuples = fileEntryTuples;
062            }
063    
064            public void setLocked(boolean locked) {
065                    _locked = locked;
066            }
067    
068            public void setMbMessages(List<MBMessage> mbMessages) {
069                    _mbMessages = mbMessages;
070            }
071    
072            public void setQueryTerms(String[] queryTerms) {
073                    _queryTerms = queryTerms;
074            }
075    
076            public void setRowCheckerId(String rowCheckerId) {
077                    _rowCheckerId = rowCheckerId;
078            }
079    
080            public void setRowCheckerName(String rowCheckerName) {
081                    _rowCheckerName = rowCheckerName;
082            }
083    
084            public void setShowCheckbox(boolean showCheckbox) {
085                    _showCheckbox = showCheckbox;
086            }
087    
088            public void setStatus(int status) {
089                    _status = status;
090            }
091    
092            public void setThumbnailSrc(String thumbnailSrc) {
093                    _thumbnailSrc = thumbnailSrc;
094            }
095    
096            public void setTitle(String title) {
097                    _title = HtmlUtil.unescape(title);
098            }
099    
100            public void setUrl(String url) {
101                    _url = url;
102            }
103    
104            public void setVersions(List<String> versions) {
105                    _versions = versions;
106            }
107    
108            @Override
109            protected void cleanUp() {
110                    _actionJsp = null;
111                    _containerIcon = null;
112                    _containerName = null;
113                    _containerType = null;
114                    _cssClass = null;
115                    _description = null;
116                    _fileEntryTuples = null;
117                    _locked = false;
118                    _mbMessages = null;
119                    _queryTerms = null;
120                    _rowCheckerId = null;
121                    _rowCheckerName = null;
122                    _showCheckbox = false;
123                    _status = 0;
124                    _thumbnailSrc = null;
125                    _title = null;
126                    _url = null;
127                    _versions = null;
128            }
129    
130            @Override
131            protected String getPage() {
132                    return _PAGE;
133            }
134    
135            @Override
136            protected boolean isCleanUpSetAttributes() {
137                    return _CLEAN_UP_SET_ATTRIBUTES;
138            }
139    
140            @Override
141            protected void setAttributes(HttpServletRequest request) {
142                    request.setAttribute(
143                            "liferay-ui:app-view-search-entry:actionJsp", _actionJsp);
144                    request.setAttribute(
145                            "liferay-ui:app-view-search-entry:containerIcon", _containerIcon);
146                    request.setAttribute(
147                            "liferay-ui:app-view-search-entry:containerName", _containerName);
148                    request.setAttribute(
149                            "liferay-ui:app-view-search-entry:containerType", _containerType);
150                    request.setAttribute(
151                            "liferay-ui:app-view-search-entry:cssClass", _cssClass);
152                    request.setAttribute(
153                            "liferay-ui:app-view-search-entry:description", _description);
154                    request.setAttribute(
155                            "liferay-ui:app-view-search-entry:fileEntryTuples",
156                            _fileEntryTuples);
157                    request.setAttribute(
158                            "liferay-ui:app-view-search-entry:locked", _locked);
159                    request.setAttribute(
160                            "liferay-ui:app-view-search-entry:mbMessages", _mbMessages);
161                    request.setAttribute(
162                            "liferay-ui:app-view-search-entry:queryTerms", _queryTerms);
163                    request.setAttribute(
164                            "liferay-ui:app-view-search-entry:rowCheckerId", _rowCheckerId);
165                    request.setAttribute(
166                            "liferay-ui:app-view-search-entry:rowCheckerName", _rowCheckerName);
167                    request.setAttribute(
168                            "liferay-ui:app-view-search-entry:showCheckbox", _showCheckbox);
169                    request.setAttribute(
170                            "liferay-ui:app-view-search-entry:status", _status);
171                    request.setAttribute(
172                            "liferay-ui:app-view-search-entry:thumbnailSrc", _thumbnailSrc);
173                    request.setAttribute("liferay-ui:app-view-search-entry:title", _title);
174                    request.setAttribute("liferay-ui:app-view-search-entry:url", _url);
175                    request.setAttribute(
176                            "liferay-ui:app-view-search-entry:versions", _versions);
177            }
178    
179            private static final boolean _CLEAN_UP_SET_ATTRIBUTES = true;
180    
181            private static final String _PAGE =
182                    "/html/taglib/ui/app_view_search_entry/page.jsp";
183    
184            private String _actionJsp;
185            private String _containerIcon;
186            private String _containerName;
187            private String _containerType;
188            private String _cssClass;
189            private String _description;
190            private List<Tuple> _fileEntryTuples;
191            private boolean _locked;
192            private List<MBMessage> _mbMessages;
193            private String[] _queryTerms;
194            private String _rowCheckerId;
195            private String _rowCheckerName;
196            private boolean _showCheckbox = false;
197            private int _status = 0;
198            private String _thumbnailSrc;
199            private String _title;
200            private String _url;
201            private List<String> _versions;
202    
203    }