Package org.apache.jempbox.xmp

Examples of org.apache.jempbox.xmp.XMPMetadata


     * @throws ParserConfigurationException Signals an error with the XMP processing.
     */
    public void testRDFDescription() throws IOException, ParserConfigurationException
    {
        // Check constructor using an element
        XMPMetadata xmp = new XMPMetadata();
        XMPSchema basic = new XMPSchema(xmp, "test", "http://test.com/test");

        assertNotNull(basic.getElement());
        assertEquals("rdf:Description", basic.getElement().getTagName());

View Full Code Here


     *
     * @throws IOException Signals an error with the XMP processing.
     */
    public void testTextProperty() throws IOException
    {
        XMPMetadata xmp = new XMPMetadata();
        XMPSchema schema = new XMPSchema(xmp, "test", "http://test.com/test");

        schema.setTextProperty("test:title",
                "The advanced Flux-Compensation for Delawney-Separation");

View Full Code Here

     * @throws IOException Signals an error with the XMP processing.
     */
    public void testBags() throws IOException
    {

        XMPMetadata xmp = new XMPMetadata();
        XMPSchema schema = new XMPSchema(xmp, "test", "http://test.com/test");

        schema.addBagValue("author", "Tom DeMarco");
        schema.addBagValue("author", "Kent Beck");
        {
View Full Code Here

     *
     * @throws IOException Signals an error with the XMP processing.
     */
    public void testSeqList() throws IOException
    {
        XMPMetadata xmp = new XMPMetadata();
        XMPSchema schema = new XMPSchema(xmp, "test", "http://test.com/test");

        schema.addSequenceValue("author", "Tom DeMarco");
        schema.addSequenceValue("author", "Kent Beck");
        {
View Full Code Here

     *
     * @throws IOException Signals an error with the XMP processing.
     */
    public void testDateList() throws IOException
    {
        XMPMetadata xmp = new XMPMetadata();
        XMPSchema schema = new XMPSchema(xmp, "test", "http://test.com/test");

        Calendar c1 = Calendar.getInstance();
        c1.set(1999, 11, 31, 0, 0, 0);
        c1.set(Calendar.MILLISECOND, 0);
View Full Code Here

            PDDocumentCatalog cat = doc.getDocumentCatalog();
            PDMetadata metadata = new PDMetadata(doc);
            cat.setMetadata(metadata);

            // jempbox version
            XMPMetadata xmp = new XMPMetadata();
            XMPSchemaPDFAId pdfaid = new XMPSchemaPDFAId(xmp);
            xmp.addSchema(pdfaid);
            pdfaid.setConformance("B");
            pdfaid.setPart(1);
            pdfaid.setAbout("");
            metadata.importXMPMetadata(xmp);
   
View Full Code Here

        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) {
View Full Code Here

         PDDocumentCatalog catalog = pdDocument.getDocumentCatalog();
         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);
                     }
                  }
               }
               catch (Exception e)
               {
                  log.warn("getDate failed: " + e);
               }
            }

            XMPSchemaBasic basic = metadata.getBasicSchema();
            if (basic != null)
            {
               try
               {
                  if (basic.getCreateDate() != null)
View Full Code Here

                }
                PDDocumentCatalog catalog = document.getDocumentCatalog();
                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)
                    {
                        display("Keywords:", pdf.getKeywords());
                        display("PDF Version:", pdf.getPDFVersion());
                        display("PDF Producer:", pdf.getProducer());
                    }
   
                    XMPSchemaBasic basic = metadata.getBasicSchema();
                    if (basic != null)
                    {
                        display("Create Date:", basic.getCreateDate());
                        display("Modify Date:", basic.getModifyDate());
                        display("Creator Tool:", basic.getCreatorTool());
View Full Code Here

     * @throws ParserConfigurationException Signals an error with the XMP processing.
     */
    public void testRDFDescription() throws IOException, ParserConfigurationException
    {
        // Check constructor using an element
        XMPMetadata xmp = new XMPMetadata();
        XMPSchema basic = new XMPSchema(xmp, "test", "http://test.com/test");

        assertNotNull(basic.getElement());
        assertEquals("rdf:Description", basic.getElement().getTagName());

View Full Code Here

TOP

Related Classes of org.apache.jempbox.xmp.XMPMetadata

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.