001    /**
002     * Copyright (c) 2000-present 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.portal.kernel.metadata;
016    
017    import aQute.bnd.annotation.ProviderType;
018    
019    import com.liferay.portal.kernel.exception.PortalException;
020    import com.liferay.portal.kernel.repository.model.FileEntry;
021    import com.liferay.portal.kernel.xml.Element;
022    import com.liferay.portlet.dynamicdatamapping.DDMFormValues;
023    import com.liferay.portlet.exportimport.lar.PortletDataContext;
024    
025    import java.io.File;
026    import java.io.InputStream;
027    
028    import java.lang.reflect.Field;
029    
030    import java.util.Map;
031    
032    /**
033     * @author Miguel Pastor
034     */
035    @ProviderType
036    public interface RawMetadataProcessor {
037    
038            public static final String TIKA_RAW_METADATA = "TIKARAWMETADATA";
039    
040            public void exportGeneratedFiles(
041                            PortletDataContext portletDataContext, FileEntry fileEntry,
042                            Element fileEntryElement)
043                    throws Exception;
044    
045            public Map<String, Field[]> getFields();
046    
047            public Map<String, DDMFormValues> getRawMetadataMap(
048                            String extension, String mimeType, File file)
049                    throws PortalException;
050    
051            public Map<String, DDMFormValues> getRawMetadataMap(
052                            String extension, String mimeType, InputStream inputStream)
053                    throws PortalException;
054    
055            public void importGeneratedFiles(
056                            PortletDataContext portletDataContext, FileEntry fileEntry,
057                            FileEntry importedFileEntry, Element fileEntryElement)
058                    throws Exception;
059    
060    }