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.taglib.util.IncludeTag;
019    
020    import java.util.Date;
021    import java.util.Map;
022    
023    import javax.servlet.http.HttpServletRequest;
024    
025    /**
026     * @author Sergio Gonz??lez
027     */
028    public class AppViewEntryTag extends IncludeTag {
029    
030            @Override
031            public int doStartTag() {
032                    return EVAL_BODY_INCLUDE;
033            }
034    
035            public void setActionJsp(String actionJsp) {
036                    _actionJsp = actionJsp;
037            }
038    
039            public void setAssetCategoryClassName(String assetCategoryClassName) {
040                    _assetCategoryClassName = assetCategoryClassName;
041            }
042    
043            public void setAssetCategoryClassPK(long assetCategoryClassPK) {
044                    _assetCategoryClassPK = assetCategoryClassPK;
045            }
046    
047            public void setAssetTagClassName(String assetTagClassName) {
048                    _assetTagClassName = assetTagClassName;
049            }
050    
051            public void setAssetTagClassPK(long assetTagClassPK) {
052                    _assetTagClassPK = assetTagClassPK;
053            }
054    
055            public void setAuthor(String author) {
056                    _author = author;
057            }
058    
059            public void setCreateDate(Date createDate) {
060                    _createDate = createDate;
061            }
062    
063            public void setCssClass(String cssClass) {
064                    _cssClass = cssClass;
065            }
066    
067            public void setData(Map<String, Object> data) {
068                    _data = data;
069            }
070    
071            public void setDescription(String description) {
072                    _description = HtmlUtil.unescape(description);
073            }
074    
075            public void setDisplayDate(Date displayDate) {
076                    _displayDate = displayDate;
077            }
078    
079            public void setDisplayStyle(String displayStyle) {
080                    _displayStyle = displayStyle;
081            }
082    
083            public void setExpirationDate(Date expirationDate) {
084                    _expirationDate = expirationDate;
085            }
086    
087            public void setFolder(boolean folder) {
088                    _folder = folder;
089            }
090    
091            public void setGroupId(long groupId) {
092                    _groupId = groupId;
093            }
094    
095            public void setLatestApprovedVersion(String latestApprovedVersion) {
096                    _latestApprovedVersion = latestApprovedVersion;
097            }
098    
099            public void setLatestApprovedVersionAuthor(
100                    String latestApprovedVersionAuthor) {
101    
102                    _latestApprovedVersionAuthor = latestApprovedVersionAuthor;
103            }
104    
105            public void setLocked(boolean locked) {
106                    _locked = locked;
107            }
108    
109            public void setModifiedDate(Date modifiedDate) {
110                    _modifiedDate = modifiedDate;
111            }
112    
113            public void setReviewDate(Date reviewDate) {
114                    _reviewDate = reviewDate;
115            }
116    
117            public void setRowCheckerId(String rowCheckerId) {
118                    _rowCheckerId = rowCheckerId;
119            }
120    
121            public void setRowCheckerName(String rowCheckerName) {
122                    _rowCheckerName = rowCheckerName;
123            }
124    
125            public void setShortcut(boolean shortcut) {
126                    _shortcut = shortcut;
127            }
128    
129            public void setShowCheckbox(boolean showCheckbox) {
130                    _showCheckbox = showCheckbox;
131            }
132    
133            public void setShowLinkTitle(boolean showLinkTitle) {
134                    _showLinkTitle = showLinkTitle;
135            }
136    
137            public void setStatus(int status) {
138                    _status = status;
139            }
140    
141            public void setThumbnailDivStyle(String thumbnailDivStyle) {
142                    _thumbnailDivStyle = thumbnailDivStyle;
143            }
144    
145            public void setThumbnailSrc(String thumbnailSrc) {
146                    _thumbnailSrc = thumbnailSrc;
147            }
148    
149            public void setThumbnailStyle(String thumbnailStyle) {
150                    _thumbnailStyle = thumbnailStyle;
151            }
152    
153            public void setTitle(String title) {
154                    _title = HtmlUtil.unescape(title);
155            }
156    
157            public void setUrl(String url) {
158                    _url = url;
159            }
160    
161            public void setVersion(String version) {
162                    _version = version;
163            }
164    
165            @Override
166            protected void cleanUp() {
167                    _actionJsp = null;
168                    _assetCategoryClassName = null;
169                    _assetCategoryClassPK = 0;
170                    _assetTagClassName = null;
171                    _assetTagClassPK = 0;
172                    _author = null;
173                    _createDate = null;
174                    _cssClass = null;
175                    _data = null;
176                    _description = null;
177                    _displayDate = null;
178                    _displayStyle = null;
179                    _expirationDate = null;
180                    _folder = false;
181                    _groupId = 0;
182                    _latestApprovedVersion = null;
183                    _latestApprovedVersionAuthor = null;
184                    _locked = false;
185                    _modifiedDate = null;
186                    _reviewDate = null;
187                    _rowCheckerId = null;
188                    _rowCheckerName = null;
189                    _shortcut = false;
190                    _showCheckbox = false;
191                    _showLinkTitle = true;
192                    _status = 0;
193                    _thumbnailDivStyle = null;
194                    _thumbnailSrc = null;
195                    _thumbnailStyle = null;
196                    _title = null;
197                    _url = null;
198                    _version = null;
199            }
200    
201            @Override
202            protected String getPage() {
203                    return _PAGE;
204            }
205    
206            @Override
207            protected boolean isCleanUpSetAttributes() {
208                    return _CLEAN_UP_SET_ATTRIBUTES;
209            }
210    
211            @Override
212            protected void setAttributes(HttpServletRequest request) {
213                    request.setAttribute("liferay-ui:app-view-entry:actionJsp", _actionJsp);
214                    request.setAttribute(
215                            "liferay-ui:app-view-entry:assetCategoryClassName",
216                            _assetCategoryClassName);
217                    request.setAttribute(
218                            "liferay-ui:app-view-entry:assetCategoryClassPK",
219                            _assetCategoryClassPK);
220                    request.setAttribute(
221                            "liferay-ui:app-view-entry:assetTagClassName", _assetTagClassName);
222                    request.setAttribute(
223                            "liferay-ui:app-view-entry:assetTagClassPK", _assetTagClassPK);
224                    request.setAttribute("liferay-ui:app-view-entry:author", _author);
225                    request.setAttribute(
226                            "liferay-ui:app-view-entry:createDate", _createDate);
227                    request.setAttribute("liferay-ui:app-view-entry:cssClass", _cssClass);
228                    request.setAttribute("liferay-ui:app-view-entry:data", _data);
229                    request.setAttribute(
230                            "liferay-ui:app-view-entry:description", _description);
231                    request.setAttribute(
232                            "liferay-ui:app-view-entry:displayDate", _displayDate);
233                    request.setAttribute(
234                            "liferay-ui:app-view-entry:displayStyle", _displayStyle);
235                    request.setAttribute(
236                            "liferay-ui:app-view-entry:expirationDate", _expirationDate);
237                    request.setAttribute("liferay-ui:app-view-entry:folder", _folder);
238                    request.setAttribute("liferay-ui:app-view-entry:groupId", _groupId);
239                    request.setAttribute(
240                            "liferay-ui:app-view-entry:latestApprovedVersion",
241                            _latestApprovedVersion);
242                    request.setAttribute(
243                            "liferay-ui:app-view-entry:latestApprovedVersionAuthor",
244                            _latestApprovedVersionAuthor);
245                    request.setAttribute("liferay-ui:app-view-entry:locked", _locked);
246                    request.setAttribute(
247                            "liferay-ui:app-view-entry:modifiedDate", _modifiedDate);
248                    request.setAttribute(
249                            "liferay-ui:app-view-entry:reviewDate", _reviewDate);
250                    request.setAttribute(
251                            "liferay-ui:app-view-entry:rowCheckerId", _rowCheckerId);
252                    request.setAttribute(
253                            "liferay-ui:app-view-entry:rowCheckerName", _rowCheckerName);
254                    request.setAttribute("liferay-ui:app-view-entry:shortcut", _shortcut);
255                    request.setAttribute(
256                            "liferay-ui:app-view-entry:showCheckbox", _showCheckbox);
257                    request.setAttribute(
258                            "liferay-ui:app-view-entry:showLinkTitle", _showLinkTitle);
259                    request.setAttribute("liferay-ui:app-view-entry:status", _status);
260                    request.setAttribute(
261                            "liferay-ui:app-view-entry:thumbnailDivStyle", _thumbnailDivStyle);
262                    request.setAttribute(
263                            "liferay-ui:app-view-entry:thumbnailSrc", _thumbnailSrc);
264                    request.setAttribute(
265                            "liferay-ui:app-view-entry:thumbnailStyle", _thumbnailStyle);
266                    request.setAttribute("liferay-ui:app-view-entry:title", _title);
267                    request.setAttribute("liferay-ui:app-view-entry:version", _version);
268                    request.setAttribute("liferay-ui:app-view-entry:url", _url);
269            }
270    
271            private static final boolean _CLEAN_UP_SET_ATTRIBUTES = true;
272    
273            private static final String _PAGE =
274                    "/html/taglib/ui/app_view_entry/page.jsp";
275    
276            private String _actionJsp;
277            private String _assetCategoryClassName;
278            private long _assetCategoryClassPK;
279            private String _assetTagClassName;
280            private long _assetTagClassPK;
281            private String _author;
282            private Date _createDate;
283            private String _cssClass;
284            private Map<String, Object> _data;
285            private String _description;
286            private Date _displayDate;
287            private String _displayStyle;
288            private Date _expirationDate;
289            private boolean _folder;
290            private long _groupId;
291            private String _latestApprovedVersion;
292            private String _latestApprovedVersionAuthor;
293            private boolean _locked;
294            private Date _modifiedDate;
295            private Date _reviewDate;
296            private String _rowCheckerId;
297            private String _rowCheckerName;
298            private boolean _shortcut;
299            private boolean _showCheckbox = false;
300            private boolean _showLinkTitle = true;
301            private int _status = 0;
302            private String _thumbnailDivStyle;
303            private String _thumbnailSrc;
304            private String _thumbnailStyle;
305            private String _title;
306            private String _url;
307            private String _version;
308    
309    }