Package org.apache.xmpbox.schema

Examples of org.apache.xmpbox.schema.DublinCoreSchema


        InputStream fis = DomXmpParser.class.getResourceAsStream("/validxmp/emptyli.xml");

        DomXmpParser xdb = new DomXmpParser();

        XMPMetadata meta = xdb.parse(fis);
        DublinCoreSchema dc = meta.getDublinCoreSchema();
        String s = dc.getTitle(null);
        Assert.assertEquals("title value", s);
    }
View Full Code Here


        XMPMetadata meta = xdb.parse(fis);

        AdobePDFSchema pdf = meta.getAdobePDFSchema();
        Assert.assertEquals("GPL Ghostscript 8.64", pdf.getProducer());

        DublinCoreSchema dc = meta.getDublinCoreSchema();
        Assert.assertEquals("application/pdf", dc.getFormat());

        XMPBasicSchema basic = meta.getXMPBasicSchema();
        Assert.assertNotNull(basic.getCreateDate());

    }
View Full Code Here

    @Test(expected = IllegalArgumentException.class)
    public void testNullArrayValue() throws Exception
    {
        // building temporary XMP metadata

        DublinCoreSchema dc = metadata.createAndAddDublinCoreSchema();

        // AUTHOR
        dico.setAuthor("dicoAuthor");
        dc.addCreator(null);

        // SUBJECT
        dico.setSubject("dicoSubj");
        dc.addSubject(null);

        // Launching synchronization test
        try
        {
            ve = sync.validateMetadataSynchronization(doc, metadata);
View Full Code Here

    @Test
    public void testBadSizeOfArrays() throws Exception
    {
        // building temporary XMP metadata

        DublinCoreSchema dc = metadata.createAndAddDublinCoreSchema();
        AdobePDFSchema pdf = metadata.createAndAddAdobePDFSchema();
        XMPBasicSchema xmp = metadata.createAndAddXMPBasicSchema();

        // Writing info in XMP and Document Information dictionary
        // TITLE
        dico.setTitle("dicoTitle");
        dc.setTitle("x-default", "XMPTitle");
        // AUTHOR
        dico.setAuthor("dicoAuthor");
        dc.addCreator("XMPAuthor");
        dc.addCreator("2ndCreator");
        // SUBJECT
        dico.setSubject("dicoSubj");
        dc.addSubject("XMPSubj");
        dc.addSubject("2ndSubj");
        // KEYWORDS
        dico.setKeywords("DicoKeywords");
        pdf.setKeywords("XMPkeywords");
        // CREATOR
        dico.setCreator("DicoCreator");
View Full Code Here

    @Test
    public void testAllInfoUnsynchronized() throws Exception
    {
        // building temporary XMP metadata

        DublinCoreSchema dc = metadata.createAndAddDublinCoreSchema();
        AdobePDFSchema pdf = metadata.createAndAddAdobePDFSchema();
        XMPBasicSchema xmp = metadata.createAndAddXMPBasicSchema();

        // Writing info in XMP and Document Information dictionary
        // TITLE
        dico.setTitle("dicoTitle");
        dc.setTitle("x-default", "XMPTitle");
        // AUTHOR
        dico.setAuthor("dicoAuthor");
        dc.addCreator("XMPAuthor");
        // SUBJECT
        dico.setSubject("dicoSubj");
        dc.addSubject("XMPSubj");
        // KEYWORDS
        dico.setKeywords("DicoKeywords");
        pdf.setKeywords("XMPkeywords");
        // CREATOR
        dico.setCreator("DicoCreator");
View Full Code Here

        producer = "PRODUCER";
        creationDate = Calendar.getInstance();
        modifyDate = Calendar.getInstance();

        // building temporary XMP metadata
        DublinCoreSchema dc = metadata.createAndAddDublinCoreSchema();
        XMPBasicSchema xmp = metadata.createAndAddXMPBasicSchema();
        AdobePDFSchema pdf = metadata.createAndAddAdobePDFSchema();
        // Writing info in XMP and Document Information dictionary
        // TITLE
        dico.setTitle(title);
        dc.setTitle("x-default", title);
        // AUTHOR
        dico.setAuthor(author);
        dc.addCreator(author);
        // SUBJECT
        dico.setSubject(subject);
        dc.addDescription("x-default", subject);
        // KEYWORDS
        dico.setKeywords(keywords);
        pdf.setKeywords(keywords);
        // CREATOR
        dico.setCreator(creator);
View Full Code Here

        producer = "PRODUCER";
        creationDate = Calendar.getInstance();
        modifyDate = Calendar.getInstance();

        // building temporary XMP metadata
        DublinCoreSchema dc = new DublinCoreSchema(metadata, "dctest");
        metadata.addSchema(dc);
        XMPBasicSchema xmp = new XMPBasicSchema(metadata, "xmptest");
        metadata.addSchema(xmp);
        AdobePDFSchema pdf = new AdobePDFSchema(metadata, "pdftest");
        metadata.addSchema(pdf);

        // Writing info in XMP and Document Information dictionary
        // TITLE
        dico.setTitle(title);
        dc.setTitle("x-default", title);
        // AUTHOR
        dico.setAuthor(author);
        dc.addCreator(author);
        // SUBJECT
        dico.setSubject(subject);
        dc.addDescription("x-default", subject);
        // KEYWORDS
        dico.setKeywords(keywords);
        pdf.setKeywords(keywords);
        // CREATOR
        dico.setCreator(creator);
View Full Code Here

        producer = "PRODUCER";
        creationDate = Calendar.getInstance();
        modifyDate = Calendar.getInstance();

        // building temporary XMP metadata
        DublinCoreSchema dc = metadata.createAndAddDublinCoreSchema();
        DublinCoreSchema dc2 = new DublinCoreSchema(metadata, "dctest");
        metadata.addSchema(dc2);
        XMPBasicSchema xmp = metadata.createAndAddXMPBasicSchema();
        XMPBasicSchema xmp2 = new XMPBasicSchema(metadata, "xmptest");
        metadata.addSchema(xmp2);
        AdobePDFSchema pdf = metadata.createAndAddAdobePDFSchema();
        AdobePDFSchema pdf2 = new AdobePDFSchema(metadata, "pdftest");
        metadata.addSchema(pdf2);

        // write some temp info in 'false' schemas
        dc2.setCoverage("tmpcover");
        xmp2.setCreatorTool("tmpcreator");
        pdf2.setKeywords("tmpkeys");

        // Writing info in XMP and Document Information dictionary
        // TITLE
View Full Code Here

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

        DublinCoreSchema dc = metadata.getDublinCoreSchema();
        if (dc != null)
        {
            if (dc.getTitleProperty() != null)
            {
                String defaultTitle = dc.getTitle("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(PreflightConstants.ERROR_METADATA_MISMATCH, sb.toString()));
                        return false;
                    }

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

     *            the list of validation error to update if the validation fails
     */
    public boolean analyseRights(XMPMetadata metadata, PDFontDescriptor fontDesc, List<ValidationError> ve)
    {

        DublinCoreSchema dc = metadata.getDublinCoreSchema();
        if (dc != null)
        {
            ArrayProperty copyrights = dc.getRightsProperty();
            if (copyrights == null || copyrights.getContainer() == null
                    || copyrights.getContainer().getAllProperties().isEmpty())
            {
                ve.add(new ValidationError(PreflightConstants.ERROR_METADATA_PROPERTY_MISSING,
                        "CopyRights is missing from the XMP information (dc:rights) of the Font File Stream."));
View Full Code Here

TOP

Related Classes of org.apache.xmpbox.schema.DublinCoreSchema

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.