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