001    /**
002     * Copyright (c) 2000-2012 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.Map;
021    
022    import javax.servlet.http.HttpServletRequest;
023    
024    /**
025     * @author Sergio González
026     */
027    public class AppViewEntryTag extends IncludeTag {
028    
029            @Override
030            public int doStartTag() {
031                    return EVAL_BODY_INCLUDE;
032            }
033    
034            public void setActionJsp(String actionJsp) {
035                    _actionJsp = actionJsp;
036            }
037    
038            public void setAssetCategoryClassName(String assetCategoryClassName) {
039                    _assetCategoryClassName = assetCategoryClassName;
040            }
041    
042            public void setAssetCategoryClassPK(long assetCategoryClassPK) {
043                    _assetCategoryClassPK = assetCategoryClassPK;
044            }
045    
046            public void setAssetTagClassName(String assetTagClassName) {
047                    _assetTagClassName = assetTagClassName;
048            }
049    
050            public void setAssetTagClassPK(long assetTagClassPK) {
051                    _assetTagClassPK = assetTagClassPK;
052            }
053    
054            public void setData(Map<String, Object> data) {
055                    _data = data;
056            }
057    
058            public void setDescription(String description) {
059                    _description = HtmlUtil.unescape(description);
060            }
061    
062            public void setDisplayStyle(String displayStyle) {
063                    _displayStyle = displayStyle;
064            }
065    
066            public void setFolder(boolean folder) {
067                    _folder = folder;
068            }
069    
070            public void setLocked(boolean locked) {
071                    _locked = locked;
072            }
073    
074            public void setRowCheckerId(String rowCheckerId) {
075                    _rowCheckerId = rowCheckerId;
076            }
077    
078            public void setRowCheckerName(String rowCheckerName) {
079                    _rowCheckerName = rowCheckerName;
080            }
081    
082            public void setShortcut(boolean shortcut) {
083                    _shortcut = shortcut;
084            }
085    
086            public void setShowCheckbox(boolean showCheckbox) {
087                    _showCheckbox = showCheckbox;
088            }
089    
090            public void setStatus(int status) {
091                    _status = status;
092            }
093    
094            public void setThumbnailDivStyle(String thumbnailDivStyle) {
095                    _thumbnailDivStyle = thumbnailDivStyle;
096            }
097    
098            public void setThumbnailSrc(String thumbnailSrc) {
099                    _thumbnailSrc = thumbnailSrc;
100            }
101    
102            public void setThumbnailStyle(String thumbnailStyle) {
103                    _thumbnailStyle = thumbnailStyle;
104            }
105    
106            public void setTitle(String title) {
107                    _title = HtmlUtil.unescape(title);
108            }
109    
110            public void setUrl(String url) {
111                    _url = url;
112            }
113    
114            @Override
115            protected void cleanUp() {
116                    super.cleanUp();
117    
118                    _actionJsp = null;
119                    _assetCategoryClassName = null;
120                    _assetCategoryClassPK = 0;
121                    _assetTagClassName = null;
122                    _assetTagClassPK = 0;
123                    _data = null;
124                    _description = null;
125                    _displayStyle = null;
126                    _folder = false;
127                    _locked = false;
128                    _rowCheckerId = null;
129                    _rowCheckerName = null;
130                    _shortcut = false;
131                    _showCheckbox = false;
132                    _status = 0;
133                    _thumbnailDivStyle = null;
134                    _thumbnailSrc = null;
135                    _thumbnailStyle = null;
136                    _title = null;
137                    _url = null;
138            }
139    
140            @Override
141            protected String getPage() {
142                    return _PAGE;
143            }
144    
145            @Override
146            protected boolean isCleanUpSetAttributes() {
147                    return _CLEAN_UP_SET_ATTRIBUTES;
148            }
149    
150            @Override
151            protected void setAttributes(HttpServletRequest request) {
152                    request.setAttribute("liferay-ui:app-view-entry:actionJsp", _actionJsp);
153                    request.setAttribute(
154                            "liferay-ui:app-view-entry:assetCategoryClassName",
155                            _assetCategoryClassName);
156                    request.setAttribute(
157                            "liferay-ui:app-view-entry:assetCategoryClassPK",
158                            _assetCategoryClassPK);
159                    request.setAttribute(
160                            "liferay-ui:app-view-entry:assetTagClassName", _assetTagClassName);
161                    request.setAttribute(
162                            "liferay-ui:app-view-entry:assetTagClassPK", _assetTagClassPK);
163                    request.setAttribute("liferay-ui:app-view-entry:data", _data);
164                    request.setAttribute(
165                            "liferay-ui:app-view-entry:description", _description);
166                    request.setAttribute(
167                            "liferay-ui:app-view-entry:displayStyle", _displayStyle);
168                    request.setAttribute("liferay-ui:app-view-entry:folder", _folder);
169                    request.setAttribute("liferay-ui:app-view-entry:locked", _locked);
170                    request.setAttribute(
171                            "liferay-ui:app-view-entry:rowCheckerId", _rowCheckerId);
172                    request.setAttribute(
173                            "liferay-ui:app-view-entry:rowCheckerName", _rowCheckerName);
174                    request.setAttribute("liferay-ui:app-view-entry:shortcut", _shortcut);
175                    request.setAttribute(
176                            "liferay-ui:app-view-entry:showCheckbox", _showCheckbox);
177                    request.setAttribute("liferay-ui:app-view-entry:status", _status);
178                    request.setAttribute(
179                            "liferay-ui:app-view-entry:thumbnailDivStyle", _thumbnailDivStyle);
180                    request.setAttribute(
181                            "liferay-ui:app-view-entry:thumbnailSrc", _thumbnailSrc);
182                    request.setAttribute(
183                            "liferay-ui:app-view-entry:thumbnailStyle", _thumbnailStyle);
184                    request.setAttribute("liferay-ui:app-view-entry:title", _title);
185                    request.setAttribute("liferay-ui:app-view-entry:url", _url);
186            }
187    
188            private static final boolean _CLEAN_UP_SET_ATTRIBUTES = true;
189    
190            private static final String _PAGE =
191                    "/html/taglib/ui/app_view_entry/page.jsp";
192    
193            private String _actionJsp;
194            private String _assetCategoryClassName;
195            private long _assetCategoryClassPK;
196            private String _assetTagClassName;
197            private long _assetTagClassPK;
198            private Map<String, Object> _data;
199            private String _description;
200            private String _displayStyle;
201            private boolean _folder;
202            private boolean _locked;
203            private String _rowCheckerId;
204            private String _rowCheckerName;
205            private boolean _shortcut;
206            private boolean _showCheckbox = false;
207            private int _status = 0;
208            private String _thumbnailDivStyle;
209            private String _thumbnailSrc;
210            private String _thumbnailStyle;
211            private String _title;
212            private String _url;
213    
214    }