001/*
002 * (C) Copyright 2006-20012 Nuxeo SA (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 * Contributors:
015 *     Antoine Taillefer
016 */
017package org.nuxeo.ecm.diff.content;
018
019import java.util.List;
020import java.util.Locale;
021
022import org.nuxeo.ecm.core.api.Blob;
023import org.nuxeo.ecm.core.api.DocumentModel;
024import org.nuxeo.ecm.core.convert.api.ConversionException;
025import org.nuxeo.ecm.diff.content.adapter.base.ContentDiffConversionType;
026
027/**
028 * Interface for the content diff DocumentModel adapter.
029 *
030 * @author Antoine Taillefer
031 * @since 5.6
032 */
033public interface ContentDiffAdapter {
034
035    boolean cachable();
036
037    String getFileContentDiffURL(DocumentModel otherDoc, ContentDiffConversionType conversionType, String locale);
038
039    String getFileContentDiffURL(DocumentModel otherDoc, String xpath, ContentDiffConversionType conversionType,
040            String locale);
041
042    List<Blob> getFileContentDiffBlobs(DocumentModel otherDoc, ContentDiffConversionType conversionType, Locale locale)
043            throws ContentDiffException, ConversionException;
044
045    List<Blob> getFileContentDiffBlobs(DocumentModel otherDoc, String xpath, ContentDiffConversionType conversionType,
046            Locale locale) throws ContentDiffException, ConversionException;
047
048    void setAdaptedDocument(DocumentModel doc);
049
050    void cleanup();
051
052}