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