mirror of
https://github.com/Alfresco/alfresco-community-repo.git
synced 2025-10-22 15:12:38 +00:00
42862: Creating new branch from HEAD
43026: ALF-16403: Create the Basic Interfaces and Implementation for Metadata Embedders
- Added MetadataEmbedder interface which guarantees an embed method responsible for writing the given metadata into a given content writer
- Changed AbstractMappingMetadataExtracter to implement MetadataEmbedder
* Added supportedEmbedMimetypes and constructor which takes it and supportedMimetypes as arguments
* Added embedMapping
* Added inheritDefaultEmbedMapping
* Added isEmbeddingSupported
* Added setEmbedMappingProperties
* Added readEmbedMappingProperties for reading classname.embed.properties
* Added setting of embedMapping in init method
* Added checkIsEmbedSupported method
* Added embed method which checks support for the mimetype, and calls embedInteral which implementations should override
* Added mapSystemToRaw method, essentially a reverse of existing mapRawToSystem
* Added getDefaultEmbedMapping method which assumes a reverse mapping of extract mapping if no explicit embed overrides are present
* Added empty embedInternal method which does nothing rather than abstract method to minimize changes to existing code
- Added notion of MetadataEmbedders to MetadataExtracterRegistry
* Added embedderCache but use the existing extracterCache* locks
* Added findBestEmbedders method
* Added getEmbedder method
43164: ALF-16404: Create a Tika Powered Metadata Embedder
- Added constructors for setting of supported embed types to TikaPoweredMetadataExtracter
- Changed visibility of getInputStream to protected so subclasses can use it
- Logging level changes in AbstractMappingMetadataExtracter
43165: ALF-16481: Create a Content Metadata Embedder Action Executer
- Added ContentMetadataEmbedder action executer which gets an embedder for the noderef if available and sends the content reader and writer for the node ref to the embedder's embed method
- Added embed-metadata action executer bean
- Added embed-metadata action executer messages
43262: ALF-16404: Create a Tika Powered Metadata Embedder
- Updated Tika which now contains implementation of TIKA-775: Embed Capabilities
43265: ALF-16404: Create a Tika Powered Metadata Embedder
- Added MetadataEmbedder implementation to TikaPoweredMetadataExtracter which gets a Tika Embedder and calls its embed method
git-svn-id: https://svn.alfresco.com/repos/alfresco-enterprise/alfresco/HEAD/root@43268 c4b6b30b-aa2e-2d43-bbcb-ca4b014f7261
65 lines
2.3 KiB
Java
65 lines
2.3 KiB
Java
/*
|
|
* Copyright (C) 2005-2012 Alfresco Software Limited.
|
|
*
|
|
* This file is part of Alfresco
|
|
*
|
|
* Alfresco is free software: you can redistribute it and/or modify
|
|
* it under the terms of the GNU Lesser General Public License as published by
|
|
* the Free Software Foundation, either version 3 of the License, or
|
|
* (at your option) any later version.
|
|
*
|
|
* Alfresco is distributed in the hope that it will be useful,
|
|
* but WITHOUT ANY WARRANTY; without even the implied warranty of
|
|
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
|
* GNU Lesser General Public License for more details.
|
|
*
|
|
* You should have received a copy of the GNU Lesser General Public License
|
|
* along with Alfresco. If not, see <http://www.gnu.org/licenses/>.
|
|
*/
|
|
package org.alfresco.repo.content.metadata;
|
|
|
|
import java.io.Serializable;
|
|
import java.util.Map;
|
|
|
|
import org.alfresco.repo.content.ContentWorker;
|
|
import org.alfresco.service.cmr.repository.ContentIOException;
|
|
import org.alfresco.service.cmr.repository.ContentReader;
|
|
import org.alfresco.service.cmr.repository.ContentWriter;
|
|
import org.alfresco.service.namespace.QName;
|
|
|
|
/**
|
|
* Interface for writing metadata properties back into the content file.
|
|
*
|
|
* @author Ray Gauss II
|
|
*
|
|
*/
|
|
public interface MetadataEmbedder extends ContentWorker {
|
|
|
|
/**
|
|
* Determines if the extracter works against the given mimetype.
|
|
*
|
|
* @param mimetype the document mimetype
|
|
* @return Returns <tt>true</tt> if the mimetype is supported, otherwise <tt>false</tt>.
|
|
*/
|
|
public boolean isEmbeddingSupported(String mimetype);
|
|
|
|
/**
|
|
* Embeds the given properties into the file specified by the given content writer.
|
|
* * <p>
|
|
* The embedding viability can be determined by an up front call to
|
|
* {@link #isSupported(String)}.
|
|
* <p>
|
|
* The source mimetype <b>must</b> be available on the
|
|
* {@link org.alfresco.service.cmr.repository.ContentAccessor#getMimetype()} method
|
|
* of the writer.
|
|
*
|
|
* @param properties the model properties to embed
|
|
* @param reader the reader for the original source content file
|
|
* @param writer the writer for the content after metadata has been embedded
|
|
* @throws ContentIOException
|
|
*/
|
|
public void embed(Map<QName, Serializable> properties, ContentReader reader, ContentWriter writer) throws ContentIOException;
|
|
|
|
|
|
}
|