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<>(); 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<>(); 053 054 public SimpleDocumentationItem(String typeLabel) { 055 super(typeLabel); 056 } 057 058 public SimpleDocumentationItem(NuxeoArtifact nxItem) { 059 super(typeLabelOf(nxItem.getArtifactType())); 060 target = nxItem.getId(); 061 targetType = nxItem.getArtifactType(); 062 } 063 064 @Override 065 public List<String> getApplicableVersion() { 066 return applicableVersion; 067 } 068 069 @Override 070 public String getContent() { 071 return content; 072 } 073 074 @Override 075 public String getId() { 076 return id; 077 } 078 079 @Override 080 public String getRenderingType() { 081 return renderingType; 082 } 083 084 @Override 085 public String getTarget() { 086 return target; 087 } 088 089 @Override 090 public String getTargetType() { 091 return targetType; 092 } 093 094 @Override 095 public String getTitle() { 096 return title; 097 } 098 099 @Override 100 public String getType() { 101 return type; 102 } 103 104 @Override 105 public String getTypeLabel() { 106 return ""; 107 } 108 109 @Override 110 public String getUUID() { 111 return uuid; 112 } 113 114 @Override 115 public boolean isApproved() { 116 return approved; 117 } 118 119 @Override 120 public Map<String, String> getAttachments() { 121 return attachments; 122 } 123 124 @Override 125 public boolean isPlaceHolder() { 126 return false; 127 } 128 129 @Override 130 public String getEditId() { 131 return null; 132 } 133 134 @Override 135 public boolean isReadOnly() { 136 return false; 137 } 138 139}