001/*
002 * (C) Copyright 2013 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-2.1.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 *     dmetzler
016 */
017package org.nuxeo.ecm.automation.io.services.enricher;
018
019import java.io.IOException;
020import java.util.List;
021
022import org.codehaus.jackson.JsonGenerationException;
023import org.codehaus.jackson.JsonGenerator;
024
025/**
026 * Expose a way to get contributors to rest entities.
027 *
028 * @since 5.7.3
029 * @deprecated The JSON marshalling was migrated to nuxeo-core-io. An enricher system is also available. See
030 *             org.nuxeo.ecm.core.io.marshallers.json.enrichers.BreadcrumbJsonEnricher for an example. To migrate an
031 *             existing enricher, keep the marshalling code and use it in class implementing
032 *             AbstractJsonEnricher<DocumentModel> (the use of contextual parameters is a bit different but
033 *             compatible / you have to manage the enricher's parameters yourself). Don't forget to contribute to
034 *             service org.nuxeo.ecm.core.io.registry.MarshallerRegistry to register your enricher.
035 */
036@Deprecated
037public interface ContentEnricherService {
038
039    /**
040     * Gets contributors for a category
041     * <p>
042     * Only contributors available in the given context are returned
043     */
044    List<ContentEnricher> getEnrichers(String category, RestEvaluationContext context);
045
046    /**
047     * Write some JSon for a given evaluation context.
048     *
049     * @param jg
050     * @param ec
051     * @throws IOException
052     * @throws JsonGenerationException
053     */
054    void writeContext(JsonGenerator jg, RestEvaluationContext ec) throws JsonGenerationException, IOException;
055
056}