Examples of XMPProperty


Examples of com.adobe.xmp.properties.XMPProperty

        String[] keyParts = splitKey( name );

        String ns = registry.getNamespaceURI( keyParts[0] );
        if (ns != null) {
            try {
                XMPProperty prop = xmpData.getProperty( ns, keyParts[1] );

                return prop.getOptions().isArray();
            }
            catch (XMPException e) {
                // Ignore
            }
        }
View Full Code Here

Examples of com.adobe.xmp.properties.XMPProperty

        String[] keyParts = splitKey( name );

        String ns = registry.getNamespaceURI( keyParts[0] );
        if (ns != null) {
            try {
                XMPProperty prop = xmpData.getProperty( ns, keyParts[1] );

                if (prop != null && prop.getOptions().isSimple()) {
                    value = prop.getValue();
                }
                else if (prop != null && prop.getOptions().isArray()) {
                    prop = xmpData.getArrayItem( ns, keyParts[1], 1 );
                    value = prop.getValue();
                }
                // in all other cases, null is returned
            }
            catch (XMPException e) {
                // Ignore
View Full Code Here

Examples of com.adobe.xmp.properties.XMPProperty

        String[] keyParts = splitKey( name );

        String ns = registry.getNamespaceURI( keyParts[0] );
        if (ns != null) {
            try {
                XMPProperty prop = xmpData.getProperty( ns, keyParts[1] );

                if (prop != null && prop.getOptions().isSimple()) {
                    value = new String[1];
                    value[0] = prop.getValue();
                }
                else if (prop != null && prop.getOptions().isArray()) {
                    int size = xmpData.countArrayItems( ns, keyParts[1] );
                    value = new String[size];
                    boolean onlySimpleChildren = true;

                    for (int i = 0; i < size && onlySimpleChildren; i++) {
                        prop = xmpData.getArrayItem( ns, keyParts[1], i + 1 );
                        if (prop.getOptions().isSimple()) {
                            value[i] = prop.getValue();
                        }
                        else {
                            onlySimpleChildren = false;
                        }
                    }
View Full Code Here

Examples of com.adobe.xmp.properties.XMPProperty

        metadata.set( TikaCoreProperties.MODIFIER, "lastModifiedBy" );
    }

    private void checkOOXMLMetadata(XMPMeta xmp) throws XMPException {
        // check simple property
        XMPProperty prop = xmp.getProperty( XMPConst.NS_DC, "language" );
        assertNotNull( prop );
        assertEquals( "language", prop.getValue() );

        // check lang alt
        prop = xmp.getLocalizedText( XMPConst.NS_DC, "title", null, XMPConst.X_DEFAULT );
        assertNotNull( prop );
        assertEquals( "title", prop.getValue() );

        // check array
        prop = xmp.getArrayItem( XMPConst.NS_DC, "subject", 1 );
        assertNotNull( prop );
        assertEquals( "keyword1", prop.getValue() );
        prop = xmp.getArrayItem( XMPConst.NS_DC, "subject", 2 );
        assertNotNull( prop );
        assertEquals( "keyword2", prop.getValue() );

        // check OOXML specific simple property
        prop = xmp.getProperty( OfficeOpenXMLCore.NAMESPACE_URI, "lastModifiedBy" );
        assertNotNull( prop );
        assertEquals( "lastModifiedBy", prop.getValue() );
    }
View Full Code Here

Examples of com.adobe.xmp.properties.XMPProperty

        XMPMeta xmp = TikaToXMP.convert( tikaMetadata, null );

        // general metadata is converted
        // check simple property
        XMPProperty prop = xmp.getProperty( XMPConst.NS_DC, "language" );
        assertNotNull( prop );
        assertEquals( "language", prop.getValue() );

        // check lang alt
        prop = xmp.getLocalizedText( XMPConst.NS_DC, "title", null, XMPConst.X_DEFAULT );
        assertNotNull( prop );
        assertEquals( "title", prop.getValue() );

        // OOXML one is not, the namespace has also not been registiered as the converter has not
        // been used
        XMPMetaFactory.getSchemaRegistry().registerNamespace( OfficeOpenXMLCore.NAMESPACE_URI,
                OfficeOpenXMLCore.PREFIX );
View Full Code Here

Examples of com.adobe.xmp.properties.XMPProperty

        tikaMetadata.set( TikaCoreProperties.KEYWORDS, new String[] { "keyword1", "keyword2" } );

        XMPMeta xmp = TikaToXMP.convert( tikaMetadata, null );

        // check simple property
        XMPProperty prop = xmp.getProperty( XMPConst.NS_DC, "format" );
        assertNotNull( prop );
        assertEquals( GENERIC_MIMETYPE, prop.getValue() );

        // check lang alt
        prop = xmp.getLocalizedText( XMPConst.NS_DC, "title", null, XMPConst.X_DEFAULT );
        assertNotNull( prop );
        assertEquals( "title", prop.getValue() );

        // check array
        prop = xmp.getArrayItem( XMPConst.NS_DC, "subject", 1 );
        assertNotNull( prop );
        assertEquals( "keyword1", prop.getValue() );
        prop = xmp.getArrayItem( XMPConst.NS_DC, "subject", 2 );
        assertNotNull( prop );
        assertEquals( "keyword2", prop.getValue() );
    }
View Full Code Here

Examples of com.adobe.xmp.properties.XMPProperty

        xmpMeta.process( tikaMetadata, GENERIC_MIMETYPE );

        XMPMeta xmp = xmpMeta.getXMPData();

        // check simple property
        XMPProperty prop = xmp.getProperty( XMPConst.NS_DC, "format" );
        assertNotNull( prop );
        assertEquals( GENERIC_MIMETYPE, prop.getValue() );

        // check lang alt
        prop = xmp.getLocalizedText( XMPConst.NS_DC, "title", null, XMPConst.X_DEFAULT );
        assertNotNull( prop );
        assertEquals( "title", prop.getValue() );

        // check array
        prop = xmp.getArrayItem( XMPConst.NS_DC, "subject", 1 );
        assertNotNull( prop );
        assertEquals( "keyword1", prop.getValue() );
        prop = xmp.getArrayItem( XMPConst.NS_DC, "subject", 2 );
        assertNotNull( prop );
        assertEquals( "keyword2", prop.getValue() );
    }
View Full Code Here

Examples of com.adobe.xmp.properties.XMPProperty

        String[] keyParts = splitKey( name );

        String ns = registry.getNamespaceURI( keyParts[0] );
        if (ns != null) {
            try {
                XMPProperty prop = xmpData.getProperty( ns, keyParts[1] );

                return prop.getOptions().isArray();
            }
            catch (XMPException e) {
                // Ignore
            }
        }
View Full Code Here

Examples of com.adobe.xmp.properties.XMPProperty

        String[] keyParts = splitKey( name );

        String ns = registry.getNamespaceURI( keyParts[0] );
        if (ns != null) {
            try {
                XMPProperty prop = xmpData.getProperty( ns, keyParts[1] );

                if (prop != null && prop.getOptions().isSimple()) {
                    value = prop.getValue();
                }
                else if (prop != null && prop.getOptions().isArray()) {
                    prop = xmpData.getArrayItem( ns, keyParts[1], 1 );
                    value = prop.getValue();
                }
                // in all other cases, null is returned
            }
            catch (XMPException e) {
                // Ignore
View Full Code Here

Examples of com.adobe.xmp.properties.XMPProperty

        String[] keyParts = splitKey( name );

        String ns = registry.getNamespaceURI( keyParts[0] );
        if (ns != null) {
            try {
                XMPProperty prop = xmpData.getProperty( ns, keyParts[1] );

                if (prop != null && prop.getOptions().isSimple()) {
                    value = new String[1];
                    value[0] = prop.getValue();
                }
                else if (prop != null && prop.getOptions().isArray()) {
                    int size = xmpData.countArrayItems( ns, keyParts[1] );
                    value = new String[size];
                    boolean onlySimpleChildren = true;

                    for (int i = 0; i < size && onlySimpleChildren; i++) {
                        prop = xmpData.getArrayItem( ns, keyParts[1], i + 1 );
                        if (prop.getOptions().isSimple()) {
                            value[i] = prop.getValue();
                        }
                        else {
                            onlySimpleChildren = false;
                        }
                    }
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.