1 50 51 package com.lowagie.text.xml.xmp; 52 53 54 57 public class DublinCoreSchema extends XmpSchema { 58 59 private static final long serialVersionUID = -4551741356374797330L; 60 61 public static final String DEFAULT_XPATH_ID = "dc"; 62 63 public static final String DEFAULT_XPATH_URI = "http://purl.org/dc/elements/1.1/"; 64 65 66 public static final String CONTRIBUTOR = "dc:contributor"; 67 68 public static final String COVERAGE = "dc:coverage"; 69 70 public static final String CREATOR = "dc:creator"; 71 72 public static final String DATE = "dc:date"; 73 74 public static final String DESCRIPTION = "dc:description"; 75 76 public static final String FORMAT = "dc:format"; 77 78 public static final String IDENTIFIER = "dc:identifier"; 79 80 public static final String LANGUAGE = "dc:language"; 81 82 public static final String PUBLISHER = "dc:publisher"; 83 84 public static final String RELATION = "dc:relation"; 85 86 public static final String RIGHTS = "dc:rights"; 87 88 public static final String SOURCE = "dc:source"; 89 90 public static final String SUBJECT = "dc:subject"; 91 92 public static final String TITLE = "dc:title"; 93 94 public static final String TYPE = "dc:type"; 95 96 97 public DublinCoreSchema() { 98 super("xmlns:" + DEFAULT_XPATH_ID + "=\"" + DEFAULT_XPATH_URI + "\""); 99 setProperty(FORMAT, "application/pdf"); 100 } 101 102 106 public void addTitle(String title) { 107 setProperty(TITLE, title); 108 } 109 110 114 public void addDescription(String desc) { 115 setProperty(DESCRIPTION, desc); 116 } 117 118 122 public void addSubject(String subject) { 123 XmpArray array = new XmpArray(XmpArray.UNORDERED); 124 array.add(subject); 125 setProperty(SUBJECT, array); 126 } 127 128 129 133 public void addSubject(String [] subject) { 134 XmpArray array = new XmpArray(XmpArray.UNORDERED); 135 for (int i = 0; i < subject.length; i++) { 136 array.add(subject[i]); 137 } 138 setProperty(SUBJECT, array); 139 } 140 141 145 public void addAuthor(String author) { 146 XmpArray array = new XmpArray(XmpArray.ORDERED); 147 array.add(author); 148 setProperty(CREATOR, array); 149 } 150 151 155 public void addAuthor(String [] author) { 156 XmpArray array = new XmpArray(XmpArray.ORDERED); 157 for (int i = 0; i < author.length; i++) { 158 array.add(author[i]); 159 } 160 setProperty(CREATOR, array); 161 } 162 163 167 public void addPublisher(String publisher) { 168 XmpArray array = new XmpArray(XmpArray.ORDERED); 169 array.add(publisher); 170 setProperty(PUBLISHER, array); 171 } 172 173 177 public void addPublisher(String [] publisher) { 178 XmpArray array = new XmpArray(XmpArray.ORDERED); 179 for (int i = 0; i < publisher.length; i++) { 180 array.add(publisher[i]); 181 } 182 setProperty(PUBLISHER, array); 183 } 184 } 185 | Popular Tags |