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.servlet.taglib.ui.QuickAccessEntry;
018    import com.liferay.portal.kernel.util.WebKeys;
019    import com.liferay.taglib.util.IncludeTag;
020    
021    import java.util.List;
022    
023    import javax.servlet.http.HttpServletRequest;
024    
025    /**
026     * @author Eudaldo Alonso
027     */
028    public class QuickAccessTag extends IncludeTag {
029    
030            public void setContentId(String contentId) {
031                    _contentId = contentId;
032            }
033    
034            @Override
035            protected String getPage() {
036                    return _PAGE;
037            }
038    
039            @Override
040            protected void setAttributes(HttpServletRequest request) {
041                    List<QuickAccessEntry> quickAccessEntries =
042                            (List<QuickAccessEntry>)request.getAttribute(
043                                    WebKeys.PORTLET_QUICK_ACCESS_ENTRIES);
044    
045                    request.setAttribute("liferay-ui:quick-access:contentId", _contentId);
046                    request.setAttribute(
047                            "liferay-ui:quick-access:quickAccessEntries", quickAccessEntries);
048            }
049    
050            private static final String _PAGE = "/html/taglib/ui/quick_access/page.jsp";
051    
052            private String _contentId;
053    
054    }