001
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
029 public interface ImageProcessor {
030
031 public void cleanUp(FileEntry fileEntry);
032
033 public void cleanUp(FileVersion fileVersion);
034
035 public void exportGeneratedFiles(
036 PortletDataContext portletDataContext, FileEntry fileEntry,
037 Element fileEntryElement)
038 throws Exception;
039
040 public void generateImages(FileVersion fileVersion);
041
042 public Set<String> getImageMimeTypes();
043
044 public InputStream getPreviewAsStream(FileVersion fileVersion)
045 throws Exception;
046
047 public long getPreviewFileSize(FileVersion fileVersion)
048 throws Exception;
049
050 public String getPreviewType(FileVersion fileVersion);
051
052 public InputStream getThumbnailAsStream(FileVersion fileVersion, int index)
053 throws Exception;
054
055 public long getThumbnailFileSize(FileVersion fileVersion, int index)
056 throws Exception;
057
058 public String getThumbnailType(FileVersion fileVersion);
059
060 public boolean hasImages(FileVersion fileVersion);
061
062 public void importGeneratedFiles(
063 PortletDataContext portletDataContext, FileEntry fileEntry,
064 FileEntry importedFileEntry, Element fileEntryElement)
065 throws Exception;
066
067 public boolean isImageSupported(FileVersion fileVersion);
068
069 public boolean isImageSupported(String mimeType);
070
071 public boolean isSupported(String mimeType);
072
073 public void storeThumbnail(
074 long companyId, long groupId, long fileEntryId, long fileVersionId,
075 long custom1ImageId, long custom2ImageId, InputStream is,
076 String type)
077 throws Exception;
078
079 public void trigger(FileVersion fileVersion);
080
081 }