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.documentation;
018
019import java.io.InputStream;
020import java.io.OutputStream;
021import java.util.List;
022import java.util.Map;
023
024import org.nuxeo.apidoc.api.DocumentationItem;
025import org.nuxeo.apidoc.api.NuxeoArtifact;
026import org.nuxeo.ecm.core.api.CoreSession;
027
028public interface DocumentationService {
029
030    DocumentationItem createDocumentationItem(CoreSession session, NuxeoArtifact item, String title, String content,
031            String type, List<String> applicableVersions, boolean approved, String renderingType);
032
033    DocumentationItem updateDocumentationItem(CoreSession session, DocumentationItem docItem);
034
035    void deleteDocumentationItem(CoreSession session, String uuid);
036
037    List<DocumentationItem> findDocumentItems(CoreSession session, NuxeoArtifact nxItem);
038
039    List<DocumentationItem> findDocumentationItemVariants(CoreSession session, DocumentationItem item);
040
041    Map<String, String> getCategories();
042
043    List<String> getCategoryKeys();
044
045    void exportDocumentation(CoreSession session, OutputStream out);
046
047    void importDocumentation(CoreSession session, InputStream is);
048
049    String getDocumentationStats(CoreSession session);
050
051    Map<String, List<DocumentationItem>> listDocumentationItems(CoreSession session, String category, String targetType);
052
053    Map<String, DocumentationItem> getAvailableDescriptions(CoreSession session, String targetType);
054
055}