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 java.util.HashSet;
020import java.util.Set;
021
022import org.nuxeo.apidoc.doc.DocumentationItemReader;
023import org.nuxeo.apidoc.export.ArchiveFileWriter;
024import org.nuxeo.ecm.webengine.app.WebEngineModule;
025
026// before 5.4.1 you extended javax.ws.rs.core.Application
027// if the MANIFEST.MF contained
028// Nuxeo-WebModule: org.nuxeo.apidoc.browse.ApiDocApplication; explode:=true; compat:=true
029// and the module.xml had a proper path="/distribution"
030
031public class ApiDocApplication extends WebEngineModule {
032
033    @Override
034    public Set<Class<?>> getClasses() {
035        Set<Class<?>> classes = super.getClasses();
036        classes = classes == null ? new HashSet<Class<?>>() : new HashSet<Class<?>>(classes);
037        classes.add(DocumentationItemReader.class);
038        classes.add(ArchiveFileWriter.class);
039        return classes;
040    }
041
042}