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