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.document.library.kernel.display.context;
016    
017    import com.liferay.dynamic.data.mapping.kernel.DDMFormValues;
018    import com.liferay.dynamic.data.mapping.kernel.DDMStructure;
019    import com.liferay.portal.kernel.exception.PortalException;
020    import com.liferay.portal.kernel.repository.model.FileVersion;
021    import com.liferay.portal.kernel.servlet.taglib.ui.Menu;
022    import com.liferay.portal.kernel.servlet.taglib.ui.ToolbarItem;
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 int getDDMStructuresCount() throws PortalException {
069                    return parentDisplayContext.getDDMStructuresCount();
070            }
071    
072            @Override
073            public Menu getMenu() throws PortalException {
074                    return parentDisplayContext.getMenu();
075            }
076    
077            @Override
078            public List<ToolbarItem> getToolbarItems() throws PortalException {
079                    return parentDisplayContext.getToolbarItems();
080            }
081    
082            @Override
083            public boolean isDownloadLinkVisible() throws PortalException {
084                    return parentDisplayContext.isDownloadLinkVisible();
085            }
086    
087            @Override
088            public boolean isVersionInfoVisible() throws PortalException {
089                    return parentDisplayContext.isVersionInfoVisible();
090            }
091    
092            @Override
093            public void renderPreview(
094                            HttpServletRequest request, HttpServletResponse response)
095                    throws IOException, ServletException {
096    
097                    parentDisplayContext.renderPreview(request, response);
098            }
099    
100            protected FileVersion fileVersion;
101    
102    }