001    /**
002     * Copyright (c) 2000-2013 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.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    import java.io.InputStream;
023    
024    import java.util.Set;
025    
026    /**
027     * @author Sergio Gonz??lez
028     */
029    public interface AudioProcessor {
030    
031            public static final String PREVIEW_TYPE = "mp3";
032    
033            public void exportGeneratedFiles(
034                            PortletDataContext portletDataContext, FileEntry fileEntry,
035                            Element fileEntryElement)
036                    throws Exception;
037    
038            public void generateAudio(FileVersion fileVersion) throws Exception;
039    
040            public Set<String> getAudioMimeTypes();
041    
042            public InputStream getPreviewAsStream(FileVersion fileVersion, String type)
043                    throws Exception;
044    
045            public long getPreviewFileSize(FileVersion fileVersion, String type)
046                    throws Exception;
047    
048            public boolean hasAudio(FileVersion fileVersion);
049    
050            public void importGeneratedFiles(
051                            PortletDataContext portletDataContext, FileEntry fileEntry,
052                            FileEntry importedFileEntry, Element fileEntryElement)
053                    throws Exception;
054    
055            public boolean isAudioSupported(FileVersion fileVersion);
056    
057            public boolean isAudioSupported(String mimeType);
058    
059            public boolean isSupported(String mimeType);
060    
061            public void trigger(FileVersion fileVersion);
062    
063    }