You are viewing a plain text version of this content. The canonical link for it is here.
Posted to dev@tika.apache.org by "Sergey Beryozkin (JIRA)" <ji...@apache.org> on 2014/06/04 15:31:03 UTC

[jira] [Comment Edited] (TIKA-1311) Centralize JSON handling of Metadata

    [ https://issues.apache.org/jira/browse/TIKA-1311?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=14017687#comment-14017687 ] 

Sergey Beryozkin edited comment on TIKA-1311 at 6/4/14 1:29 PM:
----------------------------------------------------------------

Hi, yes, adding MBR would lead to a simpler client code:


{code:java}
    Response response = WebClient.create(endPoint + META_PATH).type("application/msword")
        .accept(MediaType.APPLICATION_JSON).post(ClassLoader.getSystemResourceAsStream(TikaResourceTest.TEST_DOC));
    Metadata metadata = response.readEntity(Metadata.class);
{code}
or
{code:java}
    Metadata metadata = WebClient.create(endPoint + META_PATH).type("application/msword")
                                                       .accept(MediaType.APPLICATION_JSON)
                                                       .post(ClassLoader.getSystemResourceAsStream(TikaResourceTest.TEST_DOC),
                                                                Metadata.class);
{code}

JAX-RS 2.0 Client API can also be used...

Cheers, Sergey


 


was (Author: sergey_beryozkin):
Hi, yes, adding MBR would lead to a simple client code:


{code:java}
    Response response = WebClient.create(endPoint + META_PATH).type("application/msword")
        .accept(MediaType.APPLICATION_JSON).post(ClassLoader.getSystemResourceAsStream(TikaResourceTest.TEST_DOC));
    Metadata metadata = response.readEntity(Metadata.class);
{code}
or
{code:java}
    Metadata metadata = WebClient.create(endPoint + META_PATH).type("application/msword")
                                                       .accept(MediaType.APPLICATION_JSON)
                                                       .post(ClassLoader.getSystemResourceAsStream(TikaResourceTest.TEST_DOC),
                                                                Metadata.class);
{code}

JAX-RS 2.0 Client API can also be used...

Cheers, Sergey


 

> Centralize JSON handling of Metadata
> ------------------------------------
>
>                 Key: TIKA-1311
>                 URL: https://issues.apache.org/jira/browse/TIKA-1311
>             Project: Tika
>          Issue Type: Task
>            Reporter: Tim Allison
>            Priority: Minor
>         Attachments: TIKA-1311.patch
>
>
> When json was initially added to TIKA CLI (TIKA-213), there was a recommendation to centralize JSON handling of Metadata, potentially putting it in core.  On a recent bug fix (TIKA-1291), the same recommendation was repeated especially noting that we now handle JSON/Metadata differently in CLI and server.
> Let's centralize JSON handling in core and use GSON.  We should add a serializer and a deserializer so that users don't have to reinvent that wheel.



--
This message was sent by Atlassian JIRA
(v6.2#6252)