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.taglib.util.IncludeTag;
018    
019    import java.util.Map;
020    
021    import javax.servlet.http.HttpServletRequest;
022    
023    /**
024     * @author Sergio González
025     */
026    public class AppViewNavigationEntryTag extends IncludeTag {
027    
028            @Override
029            public int doStartTag() {
030                    return EVAL_BODY_INCLUDE;
031            }
032    
033            public void setActionJsp(String actionJsp) {
034                    _actionJsp = actionJsp;
035            }
036    
037            public void setBrowseUp(boolean browseUp) {
038                    _browseUp = browseUp;
039            }
040    
041            public void setCssClassName(String cssClassName) {
042                    _cssClassName = cssClassName;
043            }
044    
045            public void setDataExpand(Map<String, Object> dataExpand) {
046                    _dataExpand = dataExpand;
047            }
048    
049            public void setDataView(Map<String, Object> dataView) {
050                    _dataView = dataView;
051            }
052    
053            public void setEntryTitle(String entryTitle) {
054                    _entryTitle = entryTitle;
055            }
056    
057            public void setExpandURL(String expandURL) {
058                    _expandURL = expandURL;
059            }
060    
061            public void setIconImage(String iconImage) {
062                    _iconImage = iconImage;
063            }
064    
065            public void setIconSrc(String iconSrc) {
066                    _iconSrc = iconSrc;
067            }
068    
069            public void setSelected(boolean selected) {
070                    _selected = selected;
071            }
072    
073            public void setShowExpand(boolean showExpand) {
074                    _showExpand = showExpand;
075            }
076    
077            public void setViewURL(String viewURL) {
078                    _viewURL = viewURL;
079            }
080    
081            @Override
082            protected void cleanUp() {
083                    _actionJsp = null;
084                    _browseUp = false;
085                    _cssClassName = "folder";
086                    _dataExpand = null;
087                    _dataView = null;
088                    _entryTitle = null;
089                    _expandURL = null;
090                    _iconImage = null;
091                    _iconSrc = null;
092                    _selected = false;
093                    _showExpand = false;
094                    _viewURL = null;
095            }
096    
097            @Override
098            protected String getPage() {
099                    return _PAGE;
100            }
101    
102            @Override
103            protected boolean isCleanUpSetAttributes() {
104                    return _CLEAN_UP_SET_ATTRIBUTES;
105            }
106    
107            @Override
108            protected void setAttributes(HttpServletRequest request) {
109                    request.setAttribute(
110                            "liferay-ui:app-view-navigation-entry:actionJsp", _actionJsp);
111                    request.setAttribute(
112                            "liferay-ui:app-view-navigation-entry:browseUp", _browseUp);
113                    request.setAttribute(
114                            "liferay-ui:app-view-navigation-entry:cssClassName", _cssClassName);
115                    request.setAttribute(
116                            "liferay-ui:app-view-navigation-entry:dataExpand", _dataExpand);
117                    request.setAttribute(
118                            "liferay-ui:app-view-navigation-entry:dataView", _dataView);
119                    request.setAttribute(
120                            "liferay-ui:app-view-navigation-entry:entryTitle", _entryTitle);
121                    request.setAttribute(
122                            "liferay-ui:app-view-navigation-entry:expandURL", _expandURL);
123                    request.setAttribute(
124                            "liferay-ui:app-view-navigation-entry:iconImage", _iconImage);
125                    request.setAttribute(
126                            "liferay-ui:app-view-navigation-entry:iconSrc", _iconSrc);
127                    request.setAttribute(
128                            "liferay-ui:app-view-navigation-entry:selected", _selected);
129                    request.setAttribute(
130                            "liferay-ui:app-view-navigation-entry:showExpand", _showExpand);
131                    request.setAttribute(
132                            "liferay-ui:app-view-navigation-entry:viewURL", _viewURL);
133            }
134    
135            private static final boolean _CLEAN_UP_SET_ATTRIBUTES = true;
136    
137            private static final String _PAGE =
138                    "/html/taglib/ui/app_view_navigation_entry/page.jsp";
139    
140            private String _actionJsp;
141    
142            private boolean _browseUp;
143            private String _cssClassName = "folder";
144            private Map<String, Object> _dataExpand;
145            private Map<String, Object> _dataView;
146            private String _entryTitle;
147            private String _expandURL;
148            private String _iconImage;
149            private String _iconSrc;
150            private boolean _selected;
151            private boolean _showExpand;
152            private String _viewURL;
153    
154    }