001: /*
002: * $Id: XmpBasicSchema.java 2655 2007-03-15 19:26:36Z xlv $
003: * $Name$
004: *
005: * Copyright 2005 by Bruno Lowagie.
006: *
007: * The contents of this file are subject to the Mozilla Public License Version 1.1
008: * (the "License"); you may not use this file except in compliance with the License.
009: * You may obtain a copy of the License at http://www.mozilla.org/MPL/
010: *
011: * Software distributed under the License is distributed on an "AS IS" basis,
012: * WITHOUT WARRANTY OF ANY KIND, either express or implied. See the License
013: * for the specific language governing rights and limitations under the License.
014: *
015: * The Original Code is 'iText, a free JAVA-PDF library'.
016: *
017: * The Initial Developer of the Original Code is Bruno Lowagie. Portions created by
018: * the Initial Developer are Copyright (C) 1999-2005 by Bruno Lowagie.
019: * All Rights Reserved.
020: * Co-Developer of the code is Paulo Soares. Portions created by the Co-Developer
021: * are Copyright (C) 2000-2005 by Paulo Soares. All Rights Reserved.
022: *
023: * Contributor(s): all the names of the contributors are added in the source code
024: * where applicable.
025: *
026: * Alternatively, the contents of this file may be used under the terms of the
027: * LGPL license (the "GNU LIBRARY GENERAL PUBLIC LICENSE"), in which case the
028: * provisions of LGPL are applicable instead of those above. If you wish to
029: * allow use of your version of this file only under the terms of the LGPL
030: * License and not to allow others to use your version of this file under
031: * the MPL, indicate your decision by deleting the provisions above and
032: * replace them with the notice and other provisions required by the LGPL.
033: * If you do not delete the provisions above, a recipient may use your version
034: * of this file under either the MPL or the GNU LIBRARY GENERAL PUBLIC LICENSE
035: *
036: * This library is free software; you can redistribute it and/or modify it
037: * under the terms of the MPL as stated above or under the terms of the GNU
038: * Library General Public License as published by the Free Software Foundation;
039: * either version 2 of the License, or any later version.
040: *
041: * This library is distributed in the hope that it will be useful, but WITHOUT
042: * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS
043: * FOR A PARTICULAR PURPOSE. See the GNU LIBRARY GENERAL PUBLIC LICENSE for more
044: * details.
045: *
046: * If you didn't download this code from the following link, you should check if
047: * you aren't using an obsolete version:
048: * http://www.lowagie.com/iText/
049: */
050:
051: package com.lowagie.text.xml.xmp;
052:
053: /**
054: * An implementation of an XmpSchema.
055: */
056: public class XmpBasicSchema extends XmpSchema {
057:
058: private static final long serialVersionUID = -2416613941622479298L;
059: /** default namespace identifier*/
060: public static final String DEFAULT_XPATH_ID = "xmp";
061: /** default namespace uri*/
062: public static final String DEFAULT_XPATH_URI = "http://ns.adobe.com/xap/1.0/";
063:
064: /** An unordered array specifying properties that were edited outside the authoring application. Each item should contain a single namespace and XPath separated by one ASCII space (U+0020). */
065: public static final String ADVISORY = "xmp:Advisory";
066: /** The base URL for relative URLs in the document content. If this document contains Internet links, and those links are relative, they are relative to this base URL. This property provides a standard way for embedded relative URLs to be interpreted by tools. Web authoring tools should set the value based on their notion of where URLs will be interpreted. */
067: public static final String BASEURL = "xmp:BaseURL";
068: /** The date and time the resource was originally created. */
069: public static final String CREATEDATE = "xmp:CreateDate";
070: /** The name of the first known tool used to create the resource. If history is present in the metadata, this value should be equivalent to that of xmpMM:History's softwareAgent property. */
071: public static final String CREATORTOOL = "xmp:CreatorTool";
072: /** An unordered array of text strings that unambiguously identify the resource within a given context. */
073: public static final String IDENTIFIER = "xmp:Identifier";
074: /** The date and time that any metadata for this resource was last changed. */
075: public static final String METADATADATE = "xmp:MetadataDate";
076: /** The date and time the resource was last modified. */
077: public static final String MODIFYDATE = "xmp:ModifyDate";
078: /** A short informal name for the resource. */
079: public static final String NICKNAME = "xmp:Nickname";
080: /** An alternative array of thumbnail images for a file, which can differ in characteristics such as size or image encoding. */
081: public static final String THUMBNAILS = "xmp:Thumbnails";
082:
083: public XmpBasicSchema() {
084: super ("xmlns:" + DEFAULT_XPATH_ID + "=\"" + DEFAULT_XPATH_URI
085: + "\"");
086: }
087:
088: /**
089: * Adds the creatortool.
090: * @param creator
091: */
092: public void addCreatorTool(String creator) {
093: setProperty(CREATORTOOL, creator);
094: }
095:
096: /**
097: * Adds the creation date.
098: * @param date
099: */
100: public void addCreateDate(String date) {
101: setProperty(CREATEDATE, date);
102: }
103:
104: /**
105: * Adds the modification date.
106: * @param date
107: */
108: public void addModDate(String date) {
109: setProperty(MODIFYDATE, date);
110: }
111:
112: /**
113: * Adds the meta data date.
114: * @param date
115: */
116: public void addMetaDataDate(String date) {
117: setProperty(METADATADATE, date);
118: }
119:
120: /** Adds the identifier.
121: * @param id
122: */
123: public void addIdentifiers(String[] id) {
124: XmpArray array = new XmpArray(XmpArray.UNORDERED);
125: for (int i = 0; i < id.length; i++) {
126: array.add(id[i]);
127: }
128: setProperty(IDENTIFIER, array);
129: }
130:
131: /** Adds the nickname.
132: * @param name
133: */
134: public void addNickname(String name) {
135: setProperty(NICKNAME, name);
136: }
137: }
|