001/* 002 * (C) Copyright 2002-20012 Nuxeo SA (http://nuxeo.com/) and contributors. 003 * 004 * All rights reserved. This program and the accompanying materials 005 * are made available under the terms of the GNU Lesser General Public License 006 * (LGPL) version 2.1 which accompanies this distribution, and is available at 007 * http://www.gnu.org/licenses/lgpl.html 008 * 009 * This library is distributed in the hope that it will be useful, 010 * but WITHOUT ANY WARRANTY; without even the implied warranty of 011 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU 012 * Lesser General Public License for more details. 013 * 014 * Contributors: 015 * Antoine Taillefer 016 */ 017package org.nuxeo.ecm.diff.content.converters; 018 019import java.io.Serializable; 020import java.util.Map; 021 022import org.nuxeo.ecm.core.api.blobholder.BlobHolder; 023import org.nuxeo.ecm.core.convert.api.ConversionException; 024import org.nuxeo.ecm.core.convert.api.ConversionService; 025import org.nuxeo.ecm.core.convert.extension.Converter; 026import org.nuxeo.ecm.core.convert.extension.ConverterDescriptor; 027import org.nuxeo.runtime.api.Framework; 028 029/** 030 * Abstract class for content diff converter implementations. 031 * 032 * @author Antoine Taillefer 033 */ 034public abstract class AbstractContentDiffConverter implements Converter { 035 036 public void init(ConverterDescriptor descriptor) { 037 // Nothing to do here 038 } 039 040 protected final BlobHolder convert(String converterName, BlobHolder blobHolder, Map<String, Serializable> parameters) 041 throws ConversionException { 042 043 ConversionService cs = Framework.getLocalService(ConversionService.class); 044 045 return cs.convert(converterName, blobHolder, parameters); 046 } 047 048}