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.restapi.jaxrs.io.directory;
018
019import java.io.IOException;
020
021import org.codehaus.jackson.JsonGenerator;
022import org.nuxeo.ecm.automation.jaxrs.io.EntityListWriter;
023import org.nuxeo.ecm.directory.api.DirectoryEntry;
024import org.nuxeo.ecm.webengine.jaxrs.coreiodelegate.JsonCoreIODelegate;
025
026/**
027 * @since 5.7.3
028 * @deprecated since 7.10 The Nuxeo JSON marshalling was migrated to nuxeo-core-io. This class is replaced by
029 *             org.nuxeo.ecm.directory.io.DirectoryEntryListJsonWriter which is registered by default and available to
030 *             marshal {@link DirectoryEntry}'s list from the Nuxeo Rest API thanks to the JAX-RS marshaller
031 *             {@link JsonCoreIODelegate}.
032 */
033@Deprecated
034public class DirectoryEntriesWriter extends EntityListWriter<DirectoryEntry> {
035
036    public static final String ENTITY_TYPE = "directoryEntries";
037
038    @Override
039    protected String getEntityType() {
040        return ENTITY_TYPE;
041    }
042
043    @Override
044    protected void writeItem(JsonGenerator jg, DirectoryEntry item) throws IOException {
045        DirectoryEntryWriter dew = new DirectoryEntryWriter();
046        dew.writeEntity(jg, item);
047
048    }
049
050}