OpenTok API for android - java

I am using OpenTokSamples project for OpenTok API and in that I want to create session id and token id through java code and I implemented the code by calling createSession() method but its throwing error----> Could not find class 'com.fasterxml.jackson.databind.ObjectMapper', referenced from method com.opentok.OpenTok.. I searched a lot and found need to add Jackson-databind jar & Jackson-annotations jar but still the issue is not getting resolved. Please help me on this.

There is another Jackson jar which implements the json<->object mappers.
This jar is jackson-mapper-XXX.jar [1]
If you check the repo [2], it comes with gradle support pointing to the dependencies it needs to build.
[1] http://repository.codehaus.org/org/codehaus/jackson/jackson-mapper-asl/
[2] https://github.com/opentok/Opentok-Java-SDK

You are meant to create sessions and tokens using the OpenTok Server SDKs, not on clients (such as Android).
It sounds like you are most familiar with Java as a language, so I suggest using the OpenTok Java SDK and running it on a server. There is a very easy to understand HelloWorld tutorial in the samples directory, with instructions on how to use it in the README.md file. It will guide you to get the server running locally on your development machine.
An even more useful example might the Learning OpenTok tutorial for Android. It shows how to send a request to a server that returns the session ID and token. The server used in this tutorial is written in PHP, but for your convenience there is a one-click button for starting your own server on Heroku (instead of locally on your development machine).
I hope this provides you all the information you need to start generating sessions and tokens dynamically! Let me know how that turns out, and feel free to give feedback on the tutorials as GitHub Issues in those repositories.

Related

How to create java web form with spring, bootsrap, javascript that calls java method?

this is my first question on stackoverflow and I'm really confused..
I'm new with java and very confused at this moment. I'm planning to create a java web service with spring that handles a webform and a portable scanner device. I get this project for my first in new workplace but I can't move on. I don't know what are the neccesery steps to succeed.
What I want from the Application running step-by-step:
Open in an executable file that
Open a new browser window on localhost and shows a form
Filling out form with input fields, checkbox items, dropdown list,
commentbox,
AND Option for file upload from local and/or call startScan() java method.
startScan() = take photo from device and saves it to project's root folder and rename it as formatted date: "yymmdd_hhmmss"
submitButton()
onSubmitButton() the form data should be saved in database that
later i can download as xml
I have read lot of blogs and watch tutorials but that causes me confused. JPA? Hibernate? REST? REACT? I would like to create a very simple app that can display the form on window browser that is easy to access with bootsrap.
What is the neccesery toolset for doing this as simple as possible?
mysql? postgresql? which of these I can implement, what should i install locally?
If I could came out from back end to front that would be awesome..
Goal: Create a localhost database system that handles the form and scanner device method in a fancy css view.
Now, I'm using eclipse with spring. What are the neccesery dependencies? what are the local requirements for this kind of project? Please, help me with any advices..
I am very grateful for everything
Thank you in advance
I designed something similar, a simple two-page web application with login functionality and application main page that supports database operations and scanning functionality.
I would recommend you to go step-by-step since documentation is also as important, to be able to clearly visualize the project objectives, to know the constraints before-hand, make modifications on-the-fly and as a reference for your peers.
As a newbie with Java development, these are some basic steps and links which I feel would be helpful:
Project Scope Document (Web based tool: Draw.io)
Project Plan Document
Site Map (Web based tool: Draw.io)
Front-end Wireframing (Web-based tool: Balsamiq)
Back-end Wireframing (Microsoft Excel)
Back-end Flow chart (Web-based tool: Draw.io)
Front-end development (Technologies: HTML5, CSS3, Bootstrap 3, JavaScript; Tool: Brackets)
Back-end development (Technologies: PL/SQL or MySQL, Java, JDBC, Servlet, JSP, JSTL; Tools: SQL Developer, JBoss Studio)
Integrating Scanner (Third-party Java APIs)
Technology Stack: This is a simple and very generalized stack preference. You could customize it according to your needs.
Helpful Links on getting started: Java Web Terminology, JBoss Hello-world tutorial, Simple Java web application
Tools: Draw.io and Balsamiq are easy to use web based tools. You could use Bootstrap to make a quick fancy front-end. Brackets is a nice front-end code-editor supporting live-previews. SQL Developer is a wonderful tool if you're using Oracle SQL. JBoss Eclipse IDE has in-built application server which you can use for testing on localhost.
Note: All tools and technologies listed here are either free or include a trial version.
Hope that helps!

How to set up a system that reads PMML files which I create using R?

For the past few days I'm stuck at trying to pass a PMML file with .xml extension that I created using R and pmml package. After creating a iris.xml PMML file I have no where to go, actually I don't know what to look for. And then I saw Alex Guazzelli's video here, where he tells us to use ADAPA from Zementis to run the PMML files that are created from R.
What I took away from the video is,
I want to do something similar as shown, like uploading my PMML file at some place and input my test files frequently to get the corresponding predicted values.
ADAPA looks great, but looks like it also costs some money. So I would like to look for an alternative, which might not be as user friendly as ADAPA.
Then I found this page where the author says,
So the first step was to get the engine running. I experienced some small problems but Scott fixed them very fast and offered a new war file ready for deployment inside tomcat. It can be obtained under http://code.google.com/p/openscoring/. If you still encounter some problems you could also try my war file. It was built with java version “1.6.0_26” and tested under tomcat 7. After installing the war file using the management console, you could test it by sending a POST request in XML like the following to ‘http://localhost:8080/OpenScoring/Scoring’
Then I found jpmml. The problem here is the package names are very confusing, I don't know which one to install. In fact I don't know how to install each of them. I have basic knowledge of Java, apparently it isn't helpful in the current scenario.
Desperately looking forward for any kind of help.
How do the data flows in your application look like? Zementis' ADAPA is a standalone web service, which lets you do scoring in a request/response fashion. This works for web applications, but is clearly sub-optimal if you're looking to score larger amounts of data.
The JPMML project provides "PMML runtimes" for most popular big data frameworks. For example, if your application is tied to Apache Spark, then you would go for the JPMML-Spark project, if tied to Apache Hive/Pig, then for the JPMML-Pig project, etc. For a simple REST web service you should check out the Openscoring project, which is functionally identical to Zementis' ADAPA.
All JPMML projects can be built from their source checkout using Apache Maven by issuing the following command:
mvn clean install
Some JPMML projects also have their binaries distributed via the Maven Central repository. If you're looking for the Openscoring WAR file, then you need to search for "openscoring-webapp" and on the results page click the "download WAR" link (at the time of writing this, you would get openscoring-webapp-1.2.12.war). This is a standard WAR file that can be dropped to the auto deploy folder of your favourite Java web server (Tomcat?) as it is. The REST API of the web service is fully documented in the README file of the Openscoring project.

Java - retrieve sources from changeset (Team Foundation Server 2010)

Does exists any JAR which allow my JSF application:
Connect with TFS url (like tfs.company.com.br\server);
Pass destination directory and changeset as parameters;
"Download" all sources from changeset in my destination directory;
Important: we don't have any workItem, we just use TFS as repository.
I've searched for it in Google, but I just have found jars for Jenkins which allows me to make a job for it. That's not exactly what I want.
Once you've downloaded the TFS Java SDK, have a look at a an introductory post to see how you make calls to TFS using the TFS Object Model.
That sample is about work items, but once you understand the object model you should be able to work out how to make calls related to version control. Also, as the object model is consistent between Java and .NET, you should be able to look at a C# example that does something similar to what you want and adapt those as needed.

Dart: How to setup a project

Since my attempt to set up a Dart project myself I think I miss something fundamental since I didn't succeeded. So I still need the help of the community.
Coming from GWT I am used to a single application forming a single JS file which is ran and will augment a HTML element once it is recognized by the application.
There will be usually two JS files, one for the user-frontend and the web applications backend application.
I want a solution with an incremental build during development time (which I guess Dart offers when used in Dartium)
I have an inhouse web framework that I want to be started and used to send the Dart files for the Dartium session. How this will integrate and interfere with the debug sessions?
Update regarding web framework:
The web framework is a component based rendering engine, including database and uses its own resource management including everything http related like setting the cache flags etc. Its about 1.5 MB with 1200+ tests. Its simply everything you need starting with a simple servlet. Its also using an embedded jetty.
The relevance here is that I need to know how the debugger connects to Dartium and how it finds the files once an instance is running and delivered a html file containing dartium sources, so how can I start my own web server at a given port and still have dartium debug capabilities?
Update regarding the former answers:
I tried it but after two days gave up to learn more and do some other stuff. I just don't know why it is just not possible to add a simple file to the root package of my Dart module like the good old package.html (javadoc) fil. I then just add the Dart libaries to my project and the Dart plugin adds the required Dart nature to the project and creates a builder entry, done. Why do I have to do all the fuzz. Or even better why cant I just annotate my Module's main class to form a module and so I can replace the extra file completely?
I guess the Dart plugin has a model of the Dart code already so discovery is done on the fly in Eclipse.
I also do not know why I cant put my dart code in a dart source folder like src/dart/main and src/dart/test.
Or is this possible? I am still trying to get this done. I will use a fresh Eclipse 3.8 install and check if I can get Dartium to work. Just installing the plugin seams not to do the trick.
Update regarding the JS generation:
I cannot understand why Dart is not offering an incremental build of JS files. Even if it is a single file. It should not be that hard to debundle the given compile steps. I guess it will be something like compile each source file independently and link those together, do some tree shaking and done. Would be awesome if this can be made possible. Remember one can hold a model of the output file in memory (or on disk) and know what part of the js relates to what source file. Then just look up the link symbol tables and write back the part that has changed.
For me the killer feature for Dart would be the ease of configuration as I outlined and the incremental build of JS files making co-developing in JS a no-brainer. I guess in the end both JS files will be just about 750kb combined. So all the stuff with additional compression would not force me to upgrade my 8GB memory or will stress my SSD at all (350MB/sec for writes in burst mode).
Is there any work planed on this? Would be great to have Dart as the final solution for JS creation but to be honest I do not understand why GWT is the way to create JS this way. An incremental build and easy setup for GWT would be also welcome.
Seems not to be a question ...
In Dart you have usually one JS file because Dart on the server runs native (without transpiling)
With Dartium you don't have a build at all because it also runs Dart natively.
You build to JavaScript only for deployment (and of course to test the build output before deployment).
The debugging is done by Dartium itself (you can use the Chrome DevTools debugger without DartEditor if you want). DartEditor access the debugger API of Dartium and acts as a remote display/control.
Debugging web clients loaded from other webservers is supported.
What might cause some work is setting up your custom web server so that it forwards requests to source files to pub serve the web server used by DartEditor (or standalone).
pub serve runs transformers (on the fly code transformations/generation). Some framework depend on transformers being run on the code to make it functional.
I have no idea what this means but I don't use Eclipse/Dart plugin.
[Update regarding the former answers] I tried it but after two
days gave up to learn more and do some other stuff. I just dont
know why it is just not possible to add a simple file to the
root package of my module like the good old package.html file
for the java docs and then all i do is add the Dart libaries
to my project and the Dart plugin adds the nature to it and
creates a builder entry, done. Why do I have to do all the fuzz.
Or even better why cant I just annotate my Module's main class
to form a module and so I can replace the extra files?
To integrate Dart with your Java project create the Dart project independent from your project and move the Dart build output to a directory where you have your other static files.
While development configure your web server to forward to pub serve as explained above.
As already stated in my first answer, this
[Update regarding the JS generation] I can not understand why
dartium is not offering an incremental build of JS files. Even
if it is a single file. It should not be that hard to debundle
the given compile steps. I guess it will be something like
compile a single file and link those then the magical tree
shake and done
is irrelevant. You don't do anything with JavaScript while developing.
If you load the page with a non-Dartium browser pub serve will serve
built JavaScript instead of Dart. Incremental build is in the works
to improve responsiveness. But incremental build is not available
for file generation (would make sense anyway IMHO).

How to create client application to access uddi using java?

I've successfully set up an Apache Juddi v3 on my computer ans know I want to create a client that can publish and discover webservices using java. I have searched in google but i could not find a clear explanation of how to do that as am new in webservice and uddi.
any help please!!!
You want to start with the jUDDI examples. There's a bunch of them.
http://svn.apache.org/repos/asf/juddi/trunk/juddi-examples/
http://svn.apache.org/repos/asf/juddi/trunk/juddi-examples/more-uddi-samples/src/main/java/org/apache/juddi/samples/
Note: you didn't specify what version you're using, so some of that code may not compile against what you're using. Most solutions should be obvious. If not, try getting checking out the full source (the readme has directions)

Categories