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.doc;
020
021import java.util.ArrayList;
022import java.util.LinkedHashMap;
023import java.util.List;
024import java.util.Map;
025
026import org.nuxeo.apidoc.api.AbstractDocumentationItem;
027import org.nuxeo.apidoc.api.DocumentationItem;
028import org.nuxeo.apidoc.api.NuxeoArtifact;
029
030public class SimpleDocumentationItem extends AbstractDocumentationItem implements DocumentationItem {
031
032    protected final List<String> applicableVersion = new ArrayList<String>();
033
034    protected String content = "";
035
036    protected String id;
037
038    protected String renderingType = "";
039
040    protected String target = "";
041
042    protected String targetType = "";
043
044    protected String title = "";
045
046    protected String type = "";
047
048    protected String uuid = "";
049
050    protected boolean approved = false;
051
052    protected Map<String, String> attachments = new LinkedHashMap<String, String>();
053
054    public SimpleDocumentationItem() {
055    }
056
057    public SimpleDocumentationItem(NuxeoArtifact nxItem) {
058        target = nxItem.getId();
059        targetType = nxItem.getArtifactType();
060    }
061
062    @Override
063    public List<String> getApplicableVersion() {
064        return applicableVersion;
065    }
066
067    @Override
068    public String getContent() {
069        return content;
070    }
071
072    @Override
073    public String getId() {
074        return id;
075    }
076
077    @Override
078    public String getRenderingType() {
079        return renderingType;
080    }
081
082    @Override
083    public String getTarget() {
084        return target;
085    }
086
087    @Override
088    public String getTargetType() {
089        return targetType;
090    }
091
092    @Override
093    public String getTitle() {
094        return title;
095    }
096
097    @Override
098    public String getType() {
099        return type;
100    }
101
102    @Override
103    public String getTypeLabel() {
104        return "";
105    }
106
107    @Override
108    public String getUUID() {
109        return uuid;
110    }
111
112    @Override
113    public boolean isApproved() {
114        return approved;
115    }
116
117    @Override
118    public Map<String, String> getAttachments() {
119        return attachments;
120    }
121
122    @Override
123    public boolean isPlaceHolder() {
124        return false;
125    }
126
127    @Override
128    public String getEditId() {
129        return null;
130    }
131
132    @Override
133    public boolean isReadOnly() {
134        return false;
135    }
136
137}