You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@xmlgraphics.apache.org by ss...@apache.org on 2015/06/16 13:46:06 UTC
svn commit: r1685768 - in
/xmlgraphics/commons/trunk/src/java/org/apache/xmlgraphics/xmp:
XMPConstants.java XMPSchemaRegistry.java schemas/pdf/PDFUAAdapter.java
schemas/pdf/PDFUAXMPSchema.java
Author: ssteiner
Date: Tue Jun 16 11:46:06 2015
New Revision: 1685768
URL: http://svn.apache.org/r1685768
Log:
FOP-2488: Support PDF/UA
Added:
xmlgraphics/commons/trunk/src/java/org/apache/xmlgraphics/xmp/schemas/pdf/PDFUAAdapter.java (with props)
xmlgraphics/commons/trunk/src/java/org/apache/xmlgraphics/xmp/schemas/pdf/PDFUAXMPSchema.java (with props)
Modified:
xmlgraphics/commons/trunk/src/java/org/apache/xmlgraphics/xmp/XMPConstants.java
xmlgraphics/commons/trunk/src/java/org/apache/xmlgraphics/xmp/XMPSchemaRegistry.java
Modified: xmlgraphics/commons/trunk/src/java/org/apache/xmlgraphics/xmp/XMPConstants.java
URL: http://svn.apache.org/viewvc/xmlgraphics/commons/trunk/src/java/org/apache/xmlgraphics/xmp/XMPConstants.java?rev=1685768&r1=1685767&r2=1685768&view=diff
==============================================================================
--- xmlgraphics/commons/trunk/src/java/org/apache/xmlgraphics/xmp/XMPConstants.java (original)
+++ xmlgraphics/commons/trunk/src/java/org/apache/xmlgraphics/xmp/XMPConstants.java Tue Jun 16 11:46:06 2015
@@ -53,6 +53,8 @@ public interface XMPConstants {
/** Namespace URI for PDF VT */
String PDF_VT_IDENTIFICATION = "http://www.npes.org/pdfvt/ns/id/";
+ String PDF_UA_IDENTIFICATION = "http://www.aiim.org/pdfua/ns/id/";
+
/** Namespace URI for XMP Media Management */
String XAP_MM_NAMESPACE = "http://ns.adobe.com/xap/1.0/mm/";
Modified: xmlgraphics/commons/trunk/src/java/org/apache/xmlgraphics/xmp/XMPSchemaRegistry.java
URL: http://svn.apache.org/viewvc/xmlgraphics/commons/trunk/src/java/org/apache/xmlgraphics/xmp/XMPSchemaRegistry.java?rev=1685768&r1=1685767&r2=1685768&view=diff
==============================================================================
--- xmlgraphics/commons/trunk/src/java/org/apache/xmlgraphics/xmp/XMPSchemaRegistry.java (original)
+++ xmlgraphics/commons/trunk/src/java/org/apache/xmlgraphics/xmp/XMPSchemaRegistry.java Tue Jun 16 11:46:06 2015
@@ -25,6 +25,7 @@ import org.apache.xmlgraphics.xmp.schema
import org.apache.xmlgraphics.xmp.schemas.XMPBasicSchema;
import org.apache.xmlgraphics.xmp.schemas.pdf.AdobePDFSchema;
import org.apache.xmlgraphics.xmp.schemas.pdf.PDFAXMPSchema;
+import org.apache.xmlgraphics.xmp.schemas.pdf.PDFUAXMPSchema;
import org.apache.xmlgraphics.xmp.schemas.pdf.PDFVTXMPSchema;
import org.apache.xmlgraphics.xmp.schemas.pdf.PDFXXMPSchema;
import org.apache.xmlgraphics.xmp.schemas.pdf.XAPMMXMPSchema;
@@ -55,6 +56,7 @@ public final class XMPSchemaRegistry {
addSchema(new PDFXXMPSchema());
addSchema(new PDFVTXMPSchema());
addSchema(new XAPMMXMPSchema());
+ addSchema(new PDFUAXMPSchema());
}
/**
Added: xmlgraphics/commons/trunk/src/java/org/apache/xmlgraphics/xmp/schemas/pdf/PDFUAAdapter.java
URL: http://svn.apache.org/viewvc/xmlgraphics/commons/trunk/src/java/org/apache/xmlgraphics/xmp/schemas/pdf/PDFUAAdapter.java?rev=1685768&view=auto
==============================================================================
--- xmlgraphics/commons/trunk/src/java/org/apache/xmlgraphics/xmp/schemas/pdf/PDFUAAdapter.java (added)
+++ xmlgraphics/commons/trunk/src/java/org/apache/xmlgraphics/xmp/schemas/pdf/PDFUAAdapter.java Tue Jun 16 11:46:06 2015
@@ -0,0 +1,52 @@
+/*
+ * Licensed to the Apache Software Foundation (ASF) under one or more
+ * contributor license agreements. See the NOTICE file distributed with
+ * this work for additional information regarding copyright ownership.
+ * The ASF licenses this file to You under the Apache License, Version 2.0
+ * (the "License"); you may not use this file except in compliance with
+ * the License. You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+
+/* $Id$ */
+
+package org.apache.xmlgraphics.xmp.schemas.pdf;
+
+import org.apache.xmlgraphics.xmp.Metadata;
+import org.apache.xmlgraphics.xmp.XMPSchemaAdapter;
+import org.apache.xmlgraphics.xmp.XMPSchemaRegistry;
+
+/**
+ * Schema adapter implementation for both the old (deprecated) and the current PDF/UA schema.
+ * The old namespace is still needed to make Adobe Acrobat happy.
+ */
+public class PDFUAAdapter extends XMPSchemaAdapter {
+
+ private static final String PART = "part";
+
+ /**
+ * Constructs a new adapter for PDF/UA around the given metadata object.
+ * @param meta the underlying metadata
+ * @param namespace the namespace to access the schema (must be one of the PDF/UA schema
+ * namespaces)
+ */
+ public PDFUAAdapter(Metadata meta, String namespace) {
+ super(meta, XMPSchemaRegistry.getInstance().getSchema(namespace));
+ }
+
+ public void setPart(int value) {
+ setValue(PART, Integer.toString(value));
+ }
+
+ public int getPart() {
+ return Integer.parseInt(getValue(PART));
+ }
+
+}
Propchange: xmlgraphics/commons/trunk/src/java/org/apache/xmlgraphics/xmp/schemas/pdf/PDFUAAdapter.java
------------------------------------------------------------------------------
svn:eol-style = native
Added: xmlgraphics/commons/trunk/src/java/org/apache/xmlgraphics/xmp/schemas/pdf/PDFUAXMPSchema.java
URL: http://svn.apache.org/viewvc/xmlgraphics/commons/trunk/src/java/org/apache/xmlgraphics/xmp/schemas/pdf/PDFUAXMPSchema.java?rev=1685768&view=auto
==============================================================================
--- xmlgraphics/commons/trunk/src/java/org/apache/xmlgraphics/xmp/schemas/pdf/PDFUAXMPSchema.java (added)
+++ xmlgraphics/commons/trunk/src/java/org/apache/xmlgraphics/xmp/schemas/pdf/PDFUAXMPSchema.java Tue Jun 16 11:46:06 2015
@@ -0,0 +1,56 @@
+/*
+ * Licensed to the Apache Software Foundation (ASF) under one or more
+ * contributor license agreements. See the NOTICE file distributed with
+ * this work for additional information regarding copyright ownership.
+ * The ASF licenses this file to You under the Apache License, Version 2.0
+ * (the "License"); you may not use this file except in compliance with
+ * the License. You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+
+/* $Id$ */
+
+package org.apache.xmlgraphics.xmp.schemas.pdf;
+
+import org.apache.xmlgraphics.xmp.Metadata;
+import org.apache.xmlgraphics.xmp.XMPConstants;
+import org.apache.xmlgraphics.xmp.XMPSchema;
+import org.apache.xmlgraphics.xmp.merge.MergeRuleSet;
+
+/**
+ * XMP Schema for PDF/UA
+ */
+public class PDFUAXMPSchema extends XMPSchema {
+
+ /** Namespace URI for Dublin Core */
+ public static final String NAMESPACE = XMPConstants.PDF_UA_IDENTIFICATION;
+
+ private static MergeRuleSet mergeRuleSet = new MergeRuleSet();
+
+ /** Creates a new schema instance for Dublin Core. */
+ public PDFUAXMPSchema() {
+ super(NAMESPACE, "pdfuaid");
+ }
+
+ /**
+ * Creates and returns an adapter for this schema around the given metadata object.
+ * @param meta the metadata object
+ * @return the newly instantiated adapter
+ */
+ public static PDFUAAdapter getAdapter(Metadata meta) {
+ return new PDFUAAdapter(meta, NAMESPACE);
+ }
+
+ /** @see org.apache.xmlgraphics.xmp.XMPSchema#getDefaultMergeRuleSet() */
+ public MergeRuleSet getDefaultMergeRuleSet() {
+ return mergeRuleSet;
+ }
+
+}
Propchange: xmlgraphics/commons/trunk/src/java/org/apache/xmlgraphics/xmp/schemas/pdf/PDFUAXMPSchema.java
------------------------------------------------------------------------------
svn:eol-style = native
---------------------------------------------------------------------
To unsubscribe, e-mail: commits-unsubscribe@xmlgraphics.apache.org
For additional commands, e-mail: commits-help@xmlgraphics.apache.org