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