001    /**
002     * Copyright (c) 2000-2012 Liferay, Inc. All rights reserved.
003     *
004     * The contents of this file are subject to the terms of the Liferay Enterprise
005     * Subscription License ("License"). You may not use this file except in
006     * compliance with the License. You can obtain a copy of the License by
007     * contacting Liferay, Inc. See the License for the specific language governing
008     * permissions and limitations under the License, including but not limited to
009     * distribution rights of the Software.
010     *
011     *
012     *
013     */
014    
015    package com.liferay.portlet.documentlibrary.util;
016    
017    import com.liferay.portal.kernel.lar.PortletDataContext;
018    import com.liferay.portal.kernel.repository.model.FileEntry;
019    import com.liferay.portal.kernel.repository.model.FileVersion;
020    import com.liferay.portal.kernel.xml.Element;
021    
022    /**
023     * Common interface for all the processors of the document library. All document
024     * library processors must implement this interface.
025     *
026     * @author Alexander Chow
027     * @author Mika Koivisto
028     * @see    AudioProcessor
029     * @see    DLPreviewableProcessor
030     * @see    ImageProcessor
031     * @see    PDFProcessor
032     * @see    RawMetadataProcessor
033     * @see    VideoProcessor
034     */
035    public interface DLProcessor {
036    
037            public void cleanUp(FileEntry fileEntry);
038    
039            public void cleanUp(FileVersion fileVersion);
040    
041            public void exportGeneratedFiles(
042                            PortletDataContext portletDataContext, FileEntry fileEntry,
043                            Element fileEntryElement)
044                    throws Exception;
045    
046            public void importGeneratedFiles(
047                            PortletDataContext portletDataContext, FileEntry fileEntry,
048                            FileEntry importedFileEntry, Element fileEntryElement)
049                    throws Exception;
050    
051            public boolean isSupported(FileVersion fileVersion);
052    
053            public boolean isSupported(String mimeType);
054    
055            /**
056             * Launches the processor's work with respect to the given file version.
057             *
058             * @param fileVersion the latest file version to process
059             */
060            public void trigger(FileVersion fileVersion);
061    
062    }