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.portlet.documentlibrary.display.context;
016    
017    import com.liferay.portal.kernel.exception.PortalException;
018    import com.liferay.portal.kernel.repository.model.FileVersion;
019    import com.liferay.portal.kernel.servlet.taglib.ui.Menu;
020    import com.liferay.portal.kernel.servlet.taglib.ui.ToolbarItem;
021    import com.liferay.portlet.dynamicdatamapping.DDMFormValues;
022    import com.liferay.portlet.dynamicdatamapping.DDMStructure;
023    
024    import java.io.IOException;
025    
026    import java.util.List;
027    import java.util.UUID;
028    
029    import javax.servlet.ServletException;
030    import javax.servlet.http.HttpServletRequest;
031    import javax.servlet.http.HttpServletResponse;
032    
033    /**
034     * @author Iv??n Zaera
035     */
036    public class BaseDLViewFileVersionDisplayContext
037            extends BaseDLDisplayContext<DLViewFileVersionDisplayContext>
038            implements DLViewFileVersionDisplayContext {
039    
040            public BaseDLViewFileVersionDisplayContext(
041                    UUID uuid, DLViewFileVersionDisplayContext parentDLDisplayContext,
042                    HttpServletRequest request, HttpServletResponse response,
043                    FileVersion fileVersion) {
044    
045                    super(uuid, parentDLDisplayContext, request, response);
046    
047                    this.fileVersion = fileVersion;
048            }
049    
050            @Override
051            public String getCssClassFileMimeType() {
052                    return parentDisplayContext.getCssClassFileMimeType();
053            }
054    
055            @Override
056            public DDMFormValues getDDMFormValues(DDMStructure ddmStructure)
057                    throws PortalException {
058    
059                    return parentDisplayContext.getDDMFormValues(ddmStructure);
060            }
061    
062            @Override
063            public List<DDMStructure> getDDMStructures() throws PortalException {
064                    return parentDisplayContext.getDDMStructures();
065            }
066    
067            @Override
068            public Menu getMenu() throws PortalException {
069                    return parentDisplayContext.getMenu();
070            }
071    
072            @Override
073            public List<ToolbarItem> getToolbarItems() throws PortalException {
074                    return parentDisplayContext.getToolbarItems();
075            }
076    
077            @Override
078            public boolean isDownloadLinkVisible() throws PortalException {
079                    return parentDisplayContext.isDownloadLinkVisible();
080            }
081    
082            @Override
083            public boolean isVersionInfoVisible() throws PortalException {
084                    return parentDisplayContext.isVersionInfoVisible();
085            }
086    
087            @Override
088            public void renderPreview(
089                            HttpServletRequest request, HttpServletResponse response)
090                    throws IOException, ServletException {
091    
092                    parentDisplayContext.renderPreview(request, response);
093            }
094    
095            protected FileVersion fileVersion;
096    
097    }