Examples of XMPSchemaDublinCore


Examples of org.apache.jempbox.xmp.XMPSchemaDublinCore

        Reader decoded = new InputStreamReader(
                new ByteArrayInputStream(xmpraw.toByteArray()),
                DEFAULT_XMP_CHARSET);
        try {
            XMPMetadata xmp = XMPMetadata.load(new InputSource(decoded));
            XMPSchemaDublinCore dc = xmp.getDublinCoreSchema();
            if (dc != null) {
                if (dc.getTitle() != null) {
                    metadata.set(TikaCoreProperties.TITLE, dc.getTitle());
                }
                if (dc.getDescription() != null) {
                    metadata.set(TikaCoreProperties.DESCRIPTION, dc.getDescription());
                }
                if (dc.getCreators() != null && dc.getCreators().size() > 0) {
                    metadata.set(TikaCoreProperties.CREATOR, joinCreators(dc.getCreators()));
                }
                if (dc.getSubjects() != null && dc.getSubjects().size() > 0) {
                    Iterator<String> keywords = dc.getSubjects().iterator();
                    while (keywords.hasNext()) {
                        metadata.add(TikaCoreProperties.KEYWORDS, keywords.next());
                    }
                    // TODO should we set KEYWORDS too?
                    // All tested photo managers set the same in Iptc.Application2.Keywords and Xmp.dc.subject
View Full Code Here

Examples of org.apache.jempbox.xmp.XMPSchemaDublinCore

         PDMetadata meta = catalog.getMetadata();
         if (meta != null)
         {
            XMPMetadata metadata = meta.exportXMPMetadata();

            XMPSchemaDublinCore dc = metadata.getDublinCoreSchema();
            if (dc != null)
            {
               try
               {
                  if (dc.getTitle() != null)
                     props.put(DCMetaData.TITLE, fixEncoding(dc.getTitle()));
               }
               catch (Exception e)
               {
                  log.warn("getTitle failed: " + e);
               }
               try
               {
                  if (dc.getDescription() != null)
                     props.put(DCMetaData.SUBJECT, fixEncoding(dc.getDescription()));
               }
               catch (Exception e)
               {
                  log.warn("getSubject failed: " + e);
               }

               try
               {
                  if (dc.getCreators() != null)
                  {
                     List<String> list = dc.getCreators();
                     for (String creator : list)
                     {
                        props.put(DCMetaData.CREATOR, fixEncoding(creator));
                     }
                  }
               }
               catch (Exception e)
               {
                  log.warn("getCreator failed: " + e);
               }

               try
               {
                  if (dc.getDates() != null)
                  {
                     List<Calendar> list = dc.getDates();

                     for (Calendar date : list)
                     {
                        props.put(DCMetaData.DATE, date);
                     }
View Full Code Here

Examples of org.apache.jempbox.xmp.XMPSchemaDublinCore

                PDMetadata meta = catalog.getMetadata();
                if ( meta != null)
                {
                    XMPMetadata metadata = meta.exportXMPMetadata();
   
                    XMPSchemaDublinCore dc = metadata.getDublinCoreSchema();
                    if (dc != null)
                    {
                        display("Title:", dc.getTitle());
                        display("Description:", dc.getDescription());
                        list("Creators: ", dc.getCreators());
                        list("Dates:", dc.getDates());
                    }
   
                    XMPSchemaPDF pdf = metadata.getPDFSchema();
                    if (pdf != null)
                    {
View Full Code Here

Examples of org.apache.jempbox.xmp.XMPSchemaDublinCore

                PDMetadata meta = catalog.getMetadata();
                if ( meta != null)
                {
                    XMPMetadata metadata = meta.exportXMPMetadata();
   
                    XMPSchemaDublinCore dc = metadata.getDublinCoreSchema();
                    if (dc != null)
                    {
                        display("Title:", dc.getTitle());
                        display("Description:", dc.getDescription());
                        list("Creators: ", dc.getCreators());
                        list("Dates:", dc.getDates());
                    }
   
                    XMPSchemaPDF pdf = metadata.getPDFSchema();
                    if (pdf != null)
                    {
View Full Code Here

Examples of org.apache.jempbox.xmp.XMPSchemaDublinCore

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

                XMPSchemaDublinCore dcSchema = metadata.addDublinCoreSchema();
                dcSchema.setTitle( info.getTitle() );
                dcSchema.addCreator( "PDFBox" );
                dcSchema.setDescription( info.getSubject() );

                PDMetadata metadataStream = new PDMetadata(document);
                metadataStream.importXMPMetadata( metadata );
                catalog.setMetadata( metadataStream );
View Full Code Here

Examples of org.apache.jempbox.xmp.XMPSchemaDublinCore

                  PDMetadata meta = catalog.getMetadata();
                  if (meta != null)
                  {
                     XMPMetadata metadata = meta.exportXMPMetadata();

                     XMPSchemaDublinCore dc = metadata.getDublinCoreSchema();
                     if (dc != null)
                     {
                        try
                        {
                           if (dc.getTitle() != null)
                              props.put(DCMetaData.TITLE, fixEncoding(dc.getTitle()));
                        }
                        catch (Exception e)
                        {
                           log.warn("getTitle failed: " + e);
                        }
                        try
                        {
                           if (dc.getDescription() != null)
                              props.put(DCMetaData.DESCRIPTION, fixEncoding(dc.getDescription()));
                        }
                        catch (Exception e)
                        {
                           log.warn("getSubject failed: " + e);
                        }

                        try
                        {
                           if (dc.getCreators() != null)
                           {
                              for (String creator : dc.getCreators())
                              {
                                 props.put(DCMetaData.CREATOR, fixEncoding(creator));
                              }
                           }
                        }
                        catch (Exception e)
                        {
                           log.warn("getCreator failed: " + e);
                        }

                        try
                        {
                           if (dc.getDates() != null)
                           {
                              for (Calendar date : dc.getDates())
                              {
                                 props.put(DCMetaData.DATE, date);
                              }
                           }
                        }
View Full Code Here

Examples of org.apache.jempbox.xmp.XMPSchemaDublinCore

                  PDMetadata meta = catalog.getMetadata();
                  if (meta != null)
                  {
                     XMPMetadata metadata = meta.exportXMPMetadata();

                     XMPSchemaDublinCore dc = metadata.getDublinCoreSchema();
                     if (dc != null)
                     {
                        try
                        {
                           if (dc.getTitle() != null)
                              props.put(DCMetaData.TITLE, dc.getTitle());
                        }
                        catch (Exception e)
                        {
                           log.warn("getTitle failed: " + e);
                        }
                        try
                        {
                           if (dc.getDescription() != null)
                              props.put(DCMetaData.DESCRIPTION, dc.getDescription());
                        }
                        catch (Exception e)
                        {
                           log.warn("getSubject failed: " + e);
                        }

                        try
                        {
                           if (dc.getCreators() != null)
                           {
                              for (String creator : dc.getCreators())
                              {
                                 props.put(DCMetaData.CREATOR, creator);
                              }
                           }
                        }
                        catch (Exception e)
                        {
                           log.warn("getCreator failed: " + e);
                        }

                        try
                        {
                           if (dc.getDates() != null)
                           {
                              for (Calendar date : dc.getDates())
                              {
                                 props.put(DCMetaData.DATE, date);
                              }
                           }
                        }
View Full Code Here

Examples of org.apache.jempbox.xmp.XMPSchemaDublinCore

    private void extractMetadata(PDDocument document, Metadata metadata)
            throws TikaException {

        org.apache.jempbox.xmp.XMPMetadata xmp = null;
        XMPSchemaDublinCore dcSchema = null;
        try{
            if (document.getDocumentCatalog().getMetadata() != null) {
                xmp = document.getDocumentCatalog().getMetadata().exportXMPMetadata();
            }
            if (xmp != null) {
View Full Code Here

Examples of org.apache.jempbox.xmp.XMPSchemaDublinCore

        Reader decoded = new InputStreamReader(
                new ByteArrayInputStream(xmpraw.toByteArray()),
                DEFAULT_XMP_CHARSET);
        try {
            XMPMetadata xmp = XMPMetadata.load(new InputSource(decoded));
            XMPSchemaDublinCore dc = xmp.getDublinCoreSchema();
            if (dc != null) {
                if (dc.getTitle() != null) {
                    metadata.set(DublinCore.TITLE, dc.getTitle());
                }
                if (dc.getDescription() != null) {
                    metadata.set(DublinCore.DESCRIPTION, dc.getDescription());
                }
                if (dc.getCreators() != null && dc.getCreators().size() > 0) {
                    metadata.set(DublinCore.CREATOR, joinCreators(dc.getCreators()));
                }
                if (dc.getSubjects() != null && dc.getSubjects().size() > 0) {
                    Iterator<String> keywords = dc.getSubjects().iterator();
                    while (keywords.hasNext()) {
                        metadata.add(DublinCore.SUBJECT, keywords.next());
                    }
                    // TODO should we set KEYWORDS too?
                    // All tested photo managers set the same in Iptc.Application2.Keywords and Xmp.dc.subject
View Full Code Here

Examples of org.apache.jempbox.xmp.XMPSchemaDublinCore

        }
       
        Reader decoded = new InputStreamReader(new ByteArrayInputStream(xmpraw.toByteArray()), DEFAULT_XMP_CHARSET);
        XMPMetadata xmp = XMPMetadata.load(new InputSource(decoded));
       
        XMPSchemaDublinCore dc = xmp.getDublinCoreSchema();
        if (dc != null) {
            if (dc.getTitle() != null) {
                metadata.set(DublinCore.TITLE, dc.getTitle());
            }
            if (dc.getDescription() != null) {
                metadata.set(DublinCore.DESCRIPTION, dc.getDescription());
            }
            if (dc.getCreators() != null && dc.getCreators().size() > 0) {
                metadata.set(DublinCore.CREATOR, joinCreators(dc.getCreators()));
            }
            if (dc.getSubjects() != null && dc.getSubjects().size() > 0) {
                Iterator<String> keywords = dc.getSubjects().iterator();
                while (keywords.hasNext()) {
                    metadata.add(DublinCore.SUBJECT, keywords.next());
                }
                // TODO should we set KEYWORDS too?
                // All tested photo managers set the same in Iptc.Application2.Keywords and Xmp.dc.subject
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.