001/*
002 * (C) Copyright 2006-2007 Nuxeo SAS (http://nuxeo.com/) and contributors.
003 *
004 * All rights reserved. This program and the accompanying materials
005 * are made available under the terms of the GNU Lesser General Public License
006 * (LGPL) version 2.1 which accompanies this distribution, and is available at
007 * http://www.gnu.org/licenses/lgpl.html
008 *
009 * This library is distributed in the hope that it will be useful,
010 * but WITHOUT ANY WARRANTY; without even the implied warranty of
011 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
012 * Lesser General Public License for more details.
013 *
014 */
015package org.nuxeo.ecm.platform.preview.api;
016
017import java.util.List;
018
019import org.nuxeo.ecm.core.api.Blob;
020import org.nuxeo.ecm.core.api.DocumentModel;
021
022/**
023 * Interface for the Preview DocumentModel adapter.
024 *
025 * @author tiry
026 */
027public interface HtmlPreviewAdapter {
028
029    boolean cachable();
030
031    String getFilePreviewURL();
032
033    String getFilePreviewURL(String xpath);
034
035    List<Blob> getFilePreviewBlobs() throws PreviewException;
036
037    List<Blob> getFilePreviewBlobs(String xpath) throws PreviewException;
038
039    List<Blob> getFilePreviewBlobs(boolean postProcess) throws PreviewException;
040
041    List<Blob> getFilePreviewBlobs(String xpath, boolean postProcess) throws PreviewException;
042
043    void setAdaptedDocument(DocumentModel doc);
044
045    void cleanup();
046
047    /**
048     * Check if the document holds some blobs that are suitable for preview
049     *
050     * @return
051     * @throws PreviewException
052     * @since 5.7.3
053     */
054    boolean hasBlobToPreview() throws PreviewException;
055
056}