Android XML based UI in Java - java

I would just like to have an Android XML UI file in Java. I have the XML file and I believe I need a parser that would actually generate the Java UI class file. Any ideas how to go about approaching this ?
EDIT: Well, let me explain this a little better. I am trying to track Google finance data for which I use gdata client library. However its authentication does not work in the Android environment, and so I am switching to Java SE. However, is there any library or something by which I can have the Android UI, without having to write my own parser. Need not necessarily be XML based.

You need to write your own parser and instantiate the Swing classes that are synonymous with the controls described in the XML.

Related

Spark Model to use in Java Application

For analysis.
I know we can use the Save function and load the Model in Spark application. But it works only in Spark application (Java, Scala, Python).
We can also use the PMML and export the model to other type of application.
Is there any way to use a Spark model in a Java application?
I am one of the creators of MLeap. Check us out, it is meant for exactly your use case. If there is a transformer you need that is not currently supported, get in touch with me and we will get it in there.
Our serialization format is solely JSON/Protobuf right now, so it is very portable and supports large models like RandomForest. You can serialize your model to a zip file then load it up wherever.
Take a look at our demo to get a use case:
https://github.com/TrueCar/mleap-demo
Currently no, your options are to use PMML for those models that support it, or write your own framework for using models outside of Spark.
There is movement towards enabling this (see this issue). You could also check out Mleap.

Podio API, attaching files to items

I have a problem with attaching a file to a specific item using Java API. I know it should be possible as this functionality described here in the Podio documentation https://developers.podio.com/doc/files/attach-file-22518 and examples for PHP and Ruby are given. However I cannot find such method in the podio java library. I could find in FileAPI just methods that provide uploading files, but not attaching them to specific objects as described in documentation.
I use Podio APi version 0.7.1
Any ideas how it should be done in Java?
Podio uses a REST-Style API. You send standard http-request, and you get back json-formatted data. So you can do it all without a special library for your programming language.
If there is no predefined java class for you, you can just do the call yourself. In the end it is just a HTTP-call.
From the ruby implemention, I see that you attach the file as multipart/form-data,
so it is the same a browser would do it. There should be http-handling java classes to help you.
You also need to add the information from the API-Page, like the POST-Parameters and of course the url. The most difficult part is probably the authentication headers, but you need to solve this problem only once.

Getting data using OAI-PMH from an insitutional repository

I'm developing an application where I've requested data from an external institution's website. They have informed me that the data will be provided by OAI-PMH.
Could someone show me some sample code in Java how data is extracted from a OAI-PMH ?
I wonder how different it is from reading and parsing XML data.
Thank you.
Warmest wishes,
Shoubhik
For a Java implementation, for example, you could use some already existent library, like XOAI with an easy to use API. There are some provided samples.
To extract metadata from each Record you could use a XML Parser or a XML bind approach (JAXB). For other languages, like PHP and Perl there are also other alternatives.

CRUD Operation in OWL

I have created an ontology. Now I want to create an application but how can I perform CRUD operations in owl file. I came across different apis like Dotnetrdf, jena etc all support RDF/RDFS but there is not support for owl file
http://www.semanticoverflow.com/questions/2704/using-jena-to-query-owl-files
Problem of reading OWL/XML
Also, most of apis are available in Java and I dont know how to write simple hello world program in java. I am confused with servlet, jsp and .java and lots of configuration is required. So I prefer php.
So is there any api or any alternative way to query owl file in php ?
Regards,
anas anjaria
The only libraries I know that support SW standards in PHP are rdfapi [1] and redland php binding [2], but the level is RDF (i.e. the building block of RDFS and OWL) you will need to add CRUD operations at the triple level (i.e. simple axioms like foaf:knows )
[1] http://www4.wiwiss.fu-berlin.de/bizer/rdfapi/
[2] http://librdf.org/docs/php.html
So, it looks like you're talking about the Web Ontology Language, an XML/RDF dialect.
A few moments in Google shows pretty much zero interest in this in the world of PHP.
But, being XML, you can use one of the PHP XML extensions so read and work with the XML directly without a problem. How well this will actually work for you, I can't say. OWL looks freakishly complex, and working with it at the DOM node level will very likely stretch your sanity far worse than working with mature, established libraries in Java.
i made my final project at the university by using Jena. The Research Group where i work develop ontology generator tool which is capable of all crud operations. They also developed the Eclipse plug-in of this project.
You just create your OWL Data Model in the editor and right click the data model create everything, i creates owl files, Crud class and it's test codes for you.
Let's check it out
Download
Name of Plug-in is "SEAGENT Ontology Generator Plugin (Beta)"
I hope it will be beneficial for you like me

parser the xml and build a ui for user

Now I have to handle some xml in my java swing application.
I have to build a swing ui according to the special schema ,then user can fill some values.After user completed,I will collect the information,validate the value and then build a xml file.
For building xml file I can use the xmlbeans,however how to parse the schema and build a swing ui? Since the schema is rather complex.
A schema can be found here:
example schema
I have to parser this schema,for the LiteralInputType ,a JTextArea should be built.
However there are other types "complexType" and etc..
These types may not occur at the sametime. Some times only the LiteralInputType is needed,somethimes the ComplexType is needed,also maybe all of them are needed.
So, how to implement it? Anyone can help me?
Interesting to see someone else busy with WPS. :)
I believe WPS is quite special so that no existing tool would be able to build user interfaces for WPS processes. When we were solving this task, we just took a JAXB-based parser for WPS and simply built the UI programmaticaly using factories. We've implemented Swing-based as well as Javascript/OpenLayers based generic WPS clients this way.

Categories