001/*
002 * (C) Copyright 2013 Nuxeo SA (http://nuxeo.com/) and others.
003 *
004 * Licensed under the Apache License, Version 2.0 (the "License");
005 * you may not use this file except in compliance with the License.
006 * You may obtain a copy of the License at
007 *
008 *     http://www.apache.org/licenses/LICENSE-2.0
009 *
010 * Unless required by applicable law or agreed to in writing, software
011 * distributed under the License is distributed on an "AS IS" BASIS,
012 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
013 * See the License for the specific language governing permissions and
014 * limitations under the License.
015 *
016 * Contributors:
017 *     dmetzler
018 */
019package org.nuxeo.ecm.restapi.jaxrs.io.directory;
020
021import java.io.IOException;
022
023import org.codehaus.jackson.JsonGenerator;
024import org.nuxeo.ecm.automation.jaxrs.io.EntityListWriter;
025import org.nuxeo.ecm.directory.api.DirectoryEntry;
026import org.nuxeo.ecm.webengine.jaxrs.coreiodelegate.JsonCoreIODelegate;
027
028/**
029 * @since 5.7.3
030 * @deprecated since 7.10 The Nuxeo JSON marshalling was migrated to nuxeo-core-io. This class is replaced by
031 *             org.nuxeo.ecm.directory.io.DirectoryEntryListJsonWriter which is registered by default and available to
032 *             marshal {@link DirectoryEntry}'s list from the Nuxeo Rest API thanks to the JAX-RS marshaller
033 *             {@link JsonCoreIODelegate}.
034 */
035@Deprecated
036public class DirectoryEntriesWriter extends EntityListWriter<DirectoryEntry> {
037
038    public static final String ENTITY_TYPE = "directoryEntries";
039
040    @Override
041    protected String getEntityType() {
042        return ENTITY_TYPE;
043    }
044
045    @Override
046    protected void writeItem(JsonGenerator jg, DirectoryEntry item) throws IOException {
047        DirectoryEntryWriter dew = new DirectoryEntryWriter();
048        dew.writeEntity(jg, item);
049
050    }
051
052}