/** * Create and add a default PDFA Extension schema to this metadata. * * This method return the created schema to enter information. * This PDFAExtension is created with all default namespaces used in PDFAExtensionSchema. * * @return PDFAExtension schema added in order to work on it */ public PDFAExtensionSchema createAndAddPDFAExtensionSchemaWithDefaultNS() { PDFAExtensionSchema pdfAExt = new PDFAExtensionSchema(this); pdfAExt.setAboutAsSimple(""); addSchema(pdfAExt); return pdfAExt; }
/** * * @return the list of subject values */ public ArrayProperty getSchemasProperty() { return (ArrayProperty) getProperty(SCHEMAS); }
public static void populateSchemaMapping(XMPMetadata meta) throws XmpParsingException { List<XMPSchema> schems = meta.getAllSchemas(); TypeMapping tm = meta.getTypeMapping(); StructuredType stPdfaExt = PDFAExtensionSchema.class.getAnnotation(StructuredType.class); for (XMPSchema xmpSchema : schems) { if (xmpSchema.getNamespace().equals(stPdfaExt.namespace())) { // ensure the prefix is the preferred one (cannot use other definition) if (!xmpSchema.getPrefix().equals(stPdfaExt.preferedPrefix())) { throw new XmpParsingException(ErrorType.InvalidPrefix, "Found invalid prefix for PDF/A extension, found '" + xmpSchema.getPrefix() + "', should be '" + stPdfaExt.preferedPrefix() + "'"); } // create schema and types PDFAExtensionSchema pes = (PDFAExtensionSchema) xmpSchema; ArrayProperty sp = pes.getSchemasProperty(); for (AbstractField af : sp.getAllProperties()) { if (af instanceof PDFASchemaType) { populatePDFASchemaType(meta, (PDFASchemaType) af, tm); } // TODO unmanaged ? } } } }
public static void populateSchemaMapping(XMPMetadata meta) throws XmpParsingException { List<XMPSchema> schems = meta.getAllSchemas(); TypeMapping tm = meta.getTypeMapping(); StructuredType stPdfaExt = PDFAExtensionSchema.class.getAnnotation(StructuredType.class); for (XMPSchema xmpSchema : schems) { if (xmpSchema.getNamespace().equals(stPdfaExt.namespace())) { // ensure the prefix is the preferred one (cannot use other definition) if (!xmpSchema.getPrefix().equals(stPdfaExt.preferedPrefix())) { throw new XmpParsingException(ErrorType.InvalidPrefix, "Found invalid prefix for PDF/A extension, found '" + xmpSchema.getPrefix() + "', should be '" + stPdfaExt.preferedPrefix() + "'"); } // create schema and types PDFAExtensionSchema pes = (PDFAExtensionSchema) xmpSchema; ArrayProperty sp = pes.getSchemasProperty(); for (AbstractField af : sp.getAllProperties()) { if (af instanceof PDFASchemaType) { populatePDFASchemaType(meta, (PDFASchemaType) af, tm); } // TODO unmanaged ? } } } }
/** * Create and add a default PDFA Extension schema to this metadata. * * This method return the created schema to enter information. * This PDFAExtension is created with specified list of namespaces. * * @param namespaces Special namespaces list to use * @return schema added in order to work on it * @throws XmpSchemaException If namespaces list not contains PDF/A Extension namespace URI */ public PDFAExtensionSchema createAndAddPDFAExtensionSchemaWithNS(Map<String, String> namespaces) throws XmpSchemaException { PDFAExtensionSchema pdfAExt = new PDFAExtensionSchema(this); pdfAExt.setAboutAsSimple(""); addSchema(pdfAExt); return pdfAExt; }
/** * * @return the list of subject values */ public ArrayProperty getSchemasProperty() { return (ArrayProperty) getProperty(SCHEMAS); }
public static void populateSchemaMapping(XMPMetadata meta) throws XmpParsingException { List<XMPSchema> schems = meta.getAllSchemas(); TypeMapping tm = meta.getTypeMapping(); StructuredType stPdfaExt = PDFAExtensionSchema.class.getAnnotation(StructuredType.class); for (XMPSchema xmpSchema : schems) { if (xmpSchema.getNamespace().equals(stPdfaExt.namespace())) { // ensure the prefix is the preferred one (cannot use other definition) if (!xmpSchema.getPrefix().equals(stPdfaExt.preferedPrefix())) { throw new XmpParsingException(ErrorType.InvalidPrefix, "Found invalid prefix for PDF/A extension, found '" + xmpSchema.getPrefix() + "', should be '" + stPdfaExt.preferedPrefix() + "'"); } // create schema and types PDFAExtensionSchema pes = (PDFAExtensionSchema) xmpSchema; ArrayProperty sp = pes.getSchemasProperty(); for (AbstractField af : sp.getAllProperties()) { if (af instanceof PDFASchemaType) { populatePDFASchemaType(meta, (PDFASchemaType) af, tm); } // TODO unmanaged ? } } } }
/** * Create and add a default PDFA Extension schema to this metadata. * * This method return the created schema to enter information. * This PDFAExtension is created with all default namespaces used in PDFAExtensionSchema. * * @return PDFAExtension schema added in order to work on it */ public PDFAExtensionSchema createAndAddPDFAExtensionSchemaWithDefaultNS() { PDFAExtensionSchema pdfAExt = new PDFAExtensionSchema(this); pdfAExt.setAboutAsSimple(""); addSchema(pdfAExt); return pdfAExt; }
/** * * @return the list of subject values */ public ArrayProperty getSchemasProperty() { return (ArrayProperty) getProperty(SCHEMAS); }
/** * Create and add a default PDFA Extension schema to this metadata. * * This method return the created schema to enter information. * This PDFAExtension is created with all default namespaces used in PDFAExtensionSchema. * * @return PDFAExtension schema added in order to work on it */ public PDFAExtensionSchema createAndAddPDFAExtensionSchemaWithDefaultNS() { PDFAExtensionSchema pdfAExt = new PDFAExtensionSchema(this); pdfAExt.setAboutAsSimple(""); addSchema(pdfAExt); return pdfAExt; }
/** * Create and add a default PDFA Extension schema to this metadata. * * This method return the created schema to enter information. * This PDFAExtension is created with specified list of namespaces. * * @param namespaces Special namespaces list to use * @return schema added in order to work on it * @throws XmpSchemaException If namespaces list not contains PDF/A Extension namespace URI */ public PDFAExtensionSchema createAndAddPDFAExtensionSchemaWithNS(Map<String, String> namespaces) throws XmpSchemaException { PDFAExtensionSchema pdfAExt = new PDFAExtensionSchema(this); pdfAExt.setAboutAsSimple(""); addSchema(pdfAExt); return pdfAExt; }
/** * Create and add a default PDFA Extension schema to this metadata. * * This method return the created schema to enter information. * This PDFAExtension is created with specified list of namespaces. * * @param namespaces Special namespaces list to use * @return schema added in order to work on it * @throws XmpSchemaException If namespaces list not contains PDF/A Extension namespace URI */ public PDFAExtensionSchema createAndAddPDFAExtensionSchemaWithNS(Map<String, String> namespaces) throws XmpSchemaException { PDFAExtensionSchema pdfAExt = new PDFAExtensionSchema(this); pdfAExt.setAboutAsSimple(""); addSchema(pdfAExt); return pdfAExt; }