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.usermanager; 020 021import java.io.IOException; 022 023import javax.ws.rs.Produces; 024import javax.ws.rs.ext.Provider; 025 026import org.codehaus.jackson.JsonGenerator; 027import org.nuxeo.ecm.automation.jaxrs.io.EntityListWriter; 028import org.nuxeo.ecm.core.api.NuxeoGroup; 029import org.nuxeo.ecm.platform.usermanager.io.NuxeoGroupListJsonWriter; 030import org.nuxeo.ecm.webengine.jaxrs.coreiodelegate.JsonCoreIODelegate; 031 032/** 033 * @since 5.7.3 034 * @deprecated since 7.10 The Nuxeo JSON marshalling was migrated to nuxeo-core-io. This class is replaced by 035 * {@link NuxeoGroupListJsonWriter} which is registered by default and available to marshal 036 * {@link NuxeoGroup}'s list from the Nuxeo Rest API thanks to the JAX-RS marshaller 037 * {@link JsonCoreIODelegate} 038 */ 039@Deprecated 040@Provider 041@Produces({ "application/json+nxentity", "application/json" }) 042public class NuxeoGroupListWriter extends EntityListWriter<NuxeoGroup> { 043 044 /** 045 * 046 */ 047 public static final String ENTITY_TYPE = "groups"; 048 049 @Override 050 protected String getEntityType() { 051 return ENTITY_TYPE; 052 } 053 054 @Override 055 protected void writeItem(JsonGenerator jg, NuxeoGroup item) throws IOException { 056 NuxeoGroupWriter ngw = new NuxeoGroupWriter(); 057 ngw.writeEntity(jg, item); 058 } 059 060}