001/* 002 * (C) Copyright 2006-2010 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 * Thierry Delprat 016 */ 017package org.nuxeo.apidoc.browse; 018 019import javax.ws.rs.GET; 020import javax.ws.rs.Path; 021import javax.ws.rs.Produces; 022 023import org.nuxeo.apidoc.api.NuxeoArtifact; 024import org.nuxeo.apidoc.api.ServiceInfo; 025import org.nuxeo.ecm.webengine.model.WebObject; 026 027@WebObject(type = "service") 028public class ServiceWO extends NuxeoArtifactWebObject { 029 030 @Override 031 @GET 032 @Produces("text/html") 033 @Path("introspection") 034 public Object doGet() { 035 ServiceInfo si = getServiceInfo(); 036 return getView("view").arg("service", si); 037 } 038 039 public ServiceInfo getServiceInfo() { 040 return getSnapshotManager().getSnapshot(getDistributionId(), ctx.getCoreSession()).getService(nxArtifactId); 041 } 042 043 @Override 044 public NuxeoArtifact getNxArtifact() { 045 return getServiceInfo(); 046 } 047 048}