Package org.apache.padaf.xmpbox.schema

Examples of org.apache.padaf.xmpbox.schema.PDFAFieldDescription


              "Unexpected property definition in one of ValueType Field Descriptions of PDF/A Extension schemas description");
        }
        elmtType = reader.get().nextTag();
      }
      if ((name != null) && (type != null) && (description != null)) {
        PDFAFieldDescription tmp = new PDFAFieldDescription(metadata);
        tmp.setNameValue(name);
        tmp.setValueTypeValue(type);
        tmp.setDescriptionValue(description);
        fields.add(tmp);
      } else {
        throw new XmpRequiredPropertyException(
            "One valuetype field declaration in PDF/A Extension is not complete");
      }
View Full Code Here


    Assert.assertEquals(description, pdfvalueType.getDescriptionValue());

    pdfvalueType.addField(fieldName1, fieldValueType1, fieldDescription1);
    pdfvalueType.addField(fieldName2, fieldValueType2, fieldDescription2);

    PDFAFieldDescription field1, field2;
    Assert.assertEquals(2, pdfvalueType.getFields().size());
    field1 = pdfvalueType.getFields().get(0);
    field2 = pdfvalueType.getFields().get(1);

    Assert.assertEquals("pdfaField:name", field1.getName()
        .getQualifiedName());
    Assert.assertEquals(fieldName1, field1.getNameValue());
    Assert.assertEquals("pdfaField:valueType", field1.getValueType()
        .getQualifiedName());
    Assert.assertEquals(fieldValueType1, field1.getValueTypeValue());
    Assert.assertEquals("pdfaField:description", field1.getDescription()
        .getQualifiedName());
    Assert.assertEquals(fieldDescription1, field1.getDescriptionValue());

    Assert.assertEquals("pdfaField:name", field2.getName()
        .getQualifiedName());
    Assert.assertEquals(fieldName2, field2.getNameValue());
    Assert.assertEquals("pdfaField:valueType", field2.getValueType()
View Full Code Here

   * @param metadata
   *            The metadata to attach the future property
   * @return The PDF/A Field Description generated
   */
  public PDFAFieldDescription createPDFAFieldDescription(XMPMetadata metadata) {
    PDFAFieldDescription fieldDesc = new PDFAFieldDescription(metadata);
    fieldDesc.setNameValue(name);
    fieldDesc.setValueTypeValue(valueType);
    fieldDesc.setDescriptionValue(description);
    return fieldDesc;
  }
View Full Code Here

        .getDescriptionValue());

    // Check fields associated to this value type
    Assert.assertTrue(tmpValType.getFields().size() == 2);

    PDFAFieldDescription tmpField = tmpValType.getFields().get(0);
    Assert.assertEquals("name", tmpField.getNameValue());
    Assert.assertEquals("Text", tmpField.getValueTypeValue());
    Assert.assertEquals("plaintext name", tmpField.getDescriptionValue());

    tmpField = tmpValType.getFields().get(1);
    Assert.assertEquals("mailto", tmpField.getNameValue());
    Assert.assertEquals("Text", tmpField.getValueTypeValue());
    Assert.assertEquals("email address", tmpField.getDescriptionValue());

    // Check PDFA Conformance schema
    Assert.assertEquals("1", metadata.getPDFIdentificationSchema()
        .getPart().getStringValue());
    Assert.assertEquals("B", metadata.getPDFIdentificationSchema()
View Full Code Here

        .getDescriptionValue());

    // Check fields associated to this value type
    Assert.assertTrue(tmpValType.getFields().size() == 2);

    PDFAFieldDescription tmpField = tmpValType.getFields().get(0);
    Assert.assertEquals("name", tmpField.getNameValue());
    Assert.assertEquals("Text", tmpField.getValueTypeValue());
    Assert.assertEquals("plaintext name", tmpField.getDescriptionValue());

    tmpField = tmpValType.getFields().get(1);
    Assert.assertEquals("mailto", tmpField.getNameValue());
    Assert.assertEquals("Text", tmpField.getValueTypeValue());
    Assert.assertEquals("email address", tmpField.getDescriptionValue());

    // Check PDFA Conformance schema
    Assert.assertEquals("1", metadata.getPDFIdentificationSchema()
        .getPart().getStringValue());
    Assert.assertEquals("B", metadata.getPDFIdentificationSchema()
View Full Code Here

TOP

Related Classes of org.apache.padaf.xmpbox.schema.PDFAFieldDescription

Copyright © 2018 www.massapicom. All rights reserved.
All source code are property of their respective owners. Java is a trademark of Sun Microsystems, Inc and owned by ORACLE Inc. Contact coftware#gmail.com.