Examples of DublinCoreSchema


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

    if (AbstractFontValidator.isSubSet(fontName)) {
      noSubSetName = fontName.split(AbstractFontValidator
          .getSubSetPatternDelimiter())[1];
    }

    DublinCoreSchema dc = metadata.getDublinCoreSchema();
    if (dc != null) {
      if (dc.getTitle() != null) {
        String defaultTitle = dc.getTitleValue("x-default");
        if (defaultTitle != null) {

          if (!defaultTitle.equals(fontName)
              && (noSubSetName != null && !defaultTitle.equals(noSubSetName))) {
            StringBuilder sb = new StringBuilder(80);
            sb
            .append("FontName")
            .append(
            " present in the FontDescriptor dictionary doesn't match with XMP information dc:title of the Font File Stream.");
            ve.add(new ValidationError(
                ValidationConstants.ERROR_METADATA_MISMATCH, sb.toString()));
            return false;
          }

          // --- default value is the right one
          return true;
        } else {
          Iterator<AbstractField> it = dc.getTitle().getContainer()
          .getAllProperties().iterator();
          boolean empty = true;
          while (it.hasNext()) {
            empty = false;
            AbstractField tmp = it.next();
View Full Code Here

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

   * @throws ValidationException
   */
  public boolean analyseRights(XMPMetadata metadata, PDFontDescriptor fontDesc, List<ValidationError> ve)
  throws ValidationException {

    DublinCoreSchema dc = metadata.getDublinCoreSchema();
    if (dc != null) {
      ComplexProperty copyrights = dc.getRights();
      if (copyrights == null || copyrights.getContainer() == null
          || copyrights.getContainer().getAllProperties().isEmpty()) {
        ve
        .add(new ValidationError(
            ValidationConstants.ERROR_METADATA_PROPERTY_MISSING,
View Full Code Here

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

    } else {
      PDDocumentInformation dico = document.getDocumentInformation();
      if (metadata == null) {
        throw new ValidationException("Metadata provided are null");
      } else {
        DublinCoreSchema dc = metadata.getDublinCoreSchema();

        // TITLE
        analyzeTitleProperty(dico, dc, ve);
        // AUTHOR
        analyzeAuthorProperty(dico, dc, ve);
View Full Code Here

Examples of org.apache.xmlgraphics.xmp.schemas.DublinCoreSchema

        }
        return instance;
    }

    private void init() {
        addSchema(new DublinCoreSchema());
        addSchema(new PDFAXMPSchema());
        addSchema(new XMPBasicSchema());
        addSchema(new AdobePDFSchema());
    }
View Full Code Here

Examples of org.apache.xmlgraphics.xmp.schemas.DublinCoreSchema

        }
        return instance;
    }
   
    private void init() {
        addSchema(new DublinCoreSchema());
        addSchema(new PDFAXMPSchema());
        addSchema(new PDFAOldXMPSchema());
        addSchema(new XMPBasicSchema());
        addSchema(new AdobePDFSchema());
    }
View Full Code Here

Examples of org.apache.xmlgraphics.xmp.schemas.DublinCoreSchema

        }
        return instance;
    }

    private void init() {
        addSchema(new DublinCoreSchema());
        addSchema(new PDFAXMPSchema());
        addSchema(new PDFAOldXMPSchema());
        addSchema(new XMPBasicSchema());
        addSchema(new AdobePDFSchema());
    }
View Full Code Here

Examples of org.apache.xmpbox.schema.DublinCoreSchema

                basicSchema.setModifyDate( info.getModificationDate() );
                basicSchema.setCreateDate( info.getCreationDate() );
                basicSchema.setCreatorTool( info.getCreator() );
                basicSchema.setMetadataDate( new GregorianCalendar() );

                DublinCoreSchema dcSchema = metadata.createAndAddDublinCoreSchema();
                dcSchema.setTitle( info.getTitle() );
                dcSchema.addCreator( "PDFBox" );
                dcSchema.setDescription( info.getSubject() );

                PDMetadata metadataStream = new PDMetadata(document);
                catalog.setMetadata( metadataStream );
               
                XmpSerializer serializer = new XmpSerializer();
View Full Code Here

Examples of org.apache.xmpbox.schema.DublinCoreSchema

                    DomXmpParser xmpParser = new DomXmpParser();
                    try
                    {
                        XMPMetadata metadata = xmpParser.parse(meta.createInputStream());

                        DublinCoreSchema dc = metadata.getDublinCoreSchema();
                        if (dc != null)
                        {
                            display("Title:", dc.getTitle());
                            display("Description:", dc.getDescription());
                            listString("Creators: ", dc.getCreators());
                            listCalendar("Dates:", dc.getDates());
                            listString("Subjects:", dc.getSubjects());
                        }

                        AdobePDFSchema pdf = metadata.getAdobePDFSchema();
                        if (pdf != null)
                        {
View Full Code Here

Examples of org.apache.xmpbox.schema.DublinCoreSchema

    }

    @Test
    public void testDoubleDublinCore() throws Exception
    {
        DublinCoreSchema dc1 = metadata.createAndAddDublinCoreSchema();
        String ownPrefix = "test";
        DublinCoreSchema dc2 = new DublinCoreSchema(metadata, ownPrefix);
        metadata.addSchema(dc2);

        List<String> creators = new ArrayList<String>();
        creators.add("creator1");
        creators.add("creator2");

        String format = "application/pdf";
        dc1.setFormat(format);
        dc1.addCreator(creators.get(0));
        dc1.addCreator(creators.get(1));

        String coverage = "Coverage";
        dc2.setCoverage(coverage);
        dc2.addCreator(creators.get(0));
        dc2.addCreator(creators.get(1));

        StructuredType stDub = DublinCoreSchema.class.getAnnotation(StructuredType.class);

        // We can't use metadata.getDublinCoreSchema() due to specification of
        // XMPBox (see Javadoc of XMPMetadata)
        Assert.assertEquals(format,
                ((DublinCoreSchema) metadata.getSchema(stDub.preferedPrefix(), stDub.namespace())).getFormat());
        Assert.assertEquals(coverage,
                ((DublinCoreSchema) metadata.getSchema(ownPrefix, stDub.namespace())).getCoverage());

        List<XMPSchema> schems = metadata.getAllSchemas();
        DublinCoreSchema dc;
        for (XMPSchema xmpSchema : schems)
        {
            dc = (DublinCoreSchema) xmpSchema;
            Assert.assertTrue(dc.getCreators().containsAll(creators));
        }

    }
View Full Code Here

Examples of org.apache.xmpbox.schema.DublinCoreSchema

     *
     * @return schema added in order to work on it
     */
    public DublinCoreSchema createAndAddDublinCoreSchema()
    {
        DublinCoreSchema dc = new DublinCoreSchema(this);
        dc.setAboutAsSimple("");
        addSchema(dc);
        return dc;
    }
View Full Code Here
TOP
Copyright © 2018 www.massapi.com. 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.