Version 3.3 GenericFileDataBinding

classic Classic list List threaded Threaded
4 messages Options
Reply | Threaded
Open this post in threaded view
|

Version 3.3 GenericFileDataBinding

sammeek
Hi board,

I have upgraded to 3.3 and can no longer return generic files using the java client.

Server code:

        File file = createXMLMetadata(metadataElements);
               
                try {
                       
                       
                        fd = new GenericFileData(file, "text/plain");
                        LOGGER.warn("mimeType " + fd.getMimeType());
                       
               
                        } catch (IOException e) {
                        // TODO Auto-generated catch block
                        LOGGER.warn("IOException " + e);
               
                        }
}


Client:

executeBuilder.setMimeTypeForOutput("text/plain", "metadata");

Object data3 = analyser.getComplexData("metadata",
                GenericFileDataBinding.class);
               
                result.put("metadata", data3);

The server side produces the correct file (evident from the temp directory) but the client output contains nothing. Has something changed?

Sam
Reply | Threaded
Open this post in threaded view
|

Re: Version 3.3 GenericFileDataBinding

BenjaminPross
I guess this was introduced by the last changes of the ExecuteResponseAnalyser.
You'll have to modify that again, I am afraid. Same line as last time (parseProcessOutput method):

Change:

complexDataContent = XMLUtil.nodeToString(processOutput.getData().getComplexData().getDomNode().getChildNodes().item(1));

To:

complexDataContent = XMLUtil
                .nodeToString(processOutput.getData()
                                .getComplexData().getDomNode()
                                .getChildNodes().item(1));
if(complexDataContent == null || complexDataContent.equals("")){
        complexDataContent = XMLUtil
                        .nodeToString(processOutput.getData()
                                        .getComplexData().getDomNode()
                                        .getChildNodes().item(0));
}

Now the method should be able to parse XML and non-XML outputs.

Hope this helps.

Cheers,

Benjamin
Reply | Threaded
Open this post in threaded view
|

Re: Version 3.3 GenericFileDataBinding

sammeek
Hi Benjamin,

Thanks for your help. Should I be reporting these things on github? I might make life easier.

Sam
Reply | Threaded
Open this post in threaded view
|

Re: Version 3.3 GenericFileDataBinding

BenjaminPross
Hi Sam,

It would be great, if you could do that. It's good to have the issues
documented. We should be able to fix them quickly.

Cheers,

Benjamin

Am 22.08.2014 11:31, schrieb sammeek:

> Hi Benjamin,
>
> Thanks for your help. Should I be reporting these things on github? I might
> make life easier.
>
> Sam
>
>
>
> --
> View this message in context: http://geoprocessing.forum.52north.org/Version-3-3-GenericFileDataBinding-tp4025779p4025786.html
> Sent from the 52° North - Geoprocessing Community Forum mailing list archive at Nabble.com.
> _______________________________________________
> Geoprocessingservices mailing list
> [hidden email]
> http://list.52north.org/mailman/listinfo/geoprocessingservices
> http://geoprocessing.forum.52north.org


--
Benjamin Proß
Software Engineer
52°North Geoprocessing Community

52°North Initiative for Geospatial Open Source Software GmbH
Martin-Luther-King-Weg 24
Fon: +49-(0)-251–396371-42
Fax: +49-(0)-251–396371-11
[hidden email]
http://52north.org/

General Managers: Dr. Albert Remke, Dr. Andreas Wytzisk
Local Court Muenster HRB 10849

_______________________________________________
Geoprocessingservices mailing list
[hidden email]
http://list.52north.org/mailman/listinfo/geoprocessingservices
http://geoprocessing.forum.52north.org