Cannot generate JNLP dynamically from ADF (JSF) application - oracle-adf

I have an application developed with Oracle ADF ( JSF ) that uses an applet to send PDFs directly to the printer without showing them to the user.
Since modern browsers (such as the latest versions of Google Chrome) apparently no longer support applets I have developed a swing application java replacing the mentioned applet, this should be distributed using web start.
The printing application is already developed , compiled into a JAR and signed , a first test with a static JNLP was apparently successful .
My problem is that the JAR must receive parameters sent from the website where it is invoked and I do not know how get this. I have seen some examples that extend the JnlpDownloadServlet servlet that is part of the examples of Java, but I could not make anyone of these examples work properly.
I use JDeveloper as IDE.
I hope someone of you can help me.
Thanks in advance.

I was having the same problem.
Following this link from oracle forum I was able to put it to work.
I only add to revise the jnlp tags and attributes when creating the file, like
String jnlpRoot = "<jnlp spec=\"1.0+\" codebase=\"" + codeBaseUrl + "\" version=\"0.1\">\n"; //href="PrintApplet.jnlp"
The href attribute was the one that was breaking the download functionality, it was expecting a file inside the application.
Hope this helps

Related

Ktor + React project configuration

I'm trying to start my first web project. My experience is with .NET desktop development and I'm very new to the Java/Kotlin world. Client side I want to use React and write the code in Kotlin, then transpile to JavaScript. Server side I would like to use Ktor both to serve the static content (React app + various assets) and REST endpoints for the SPA. I would like to use the Multiplatform feature to be able to share as much code as possible. My IDE is IntelliJ IDEA.
I would like to have auto-reload and be able to debug both React and server code for development and I would like to be able to create a single fat jar with the complete application (frontend+backend).
I started with the template that IntelliJ provides for multiplatform JS+JVM. I have been working on it for more than one day with little success and also haven't been able to find any sample online with all the features, and also haven't been able to combine various samples due to insufficient knowledge. Only thing I got is either running the application without autoreload or creating the jar file by adding "manifest" to the build.gradle file which breaks my run configuration.
I would very much appreciate if someone could provide or point me to an example with these features which I can use as an starting point for my application.
Here is a link to an example to get you started.
https://play.kotlinlang.org/hands-on/Full%20Stack%20Web%20App%20with%20Kotlin%20Multiplatform/01_Introduction

Where do I find CodenameOne's version of iKVM?

I need to do some research if/how to use backend code from some already available Java web service in some newly created Windows 10 UWP app. The Java code deals with parsing special binary data, depends on things like configuration files and some additional 3rd party libs like Apache Commons*. The current ideas are either providing some native DLL to be bundled with the UWP-app or providing a stand-alone one publishing some high level web services which the UWP-app consumes.
I came across iKVM and CodenameOne and read that iKVM itself is not maintained anymore, but CodenameOne forked a version for their own purposes. At various places authors say that that version of iKVM is managed in the official GitHub repo of CodenameOne, but I'm unable to find it there. The only thing I find are some helper implementations and formerly committed DLLs in the repo-history and such, but nothing which looks like the complete forked project.
Any idea where I can find this? Obviously I'm missing something...
I would simply like to have a look at what CodenameOne needed to change, how much effort they put into keeping up with Java 8, what of those efforts went back to the original project etc.
Thanks!
Sorry about that. I was under the wrong impression that the code resided in the Ports/UWP directory but apparently it isn't there. I'm probably the person who wrote that in those places...
We added a link to the actual repo there for reference. It's here: https://github.com/shannah/cn1-ikvm-uwp

How to publish AIML embedded with javascript?

I've written an AIML file for a chat bot and I'd like to build an interactive web application which allows me to chat with the bot in the web browser.
Is it possible to achieve this with HTML & Javascript?
There is no short answer on how to write a web application which allows a user to interact with your AIML. Writing such an application from scratch will be much more work then compiling the AIML was.
The easiest option would be to use a pre-built service like PandoraBots which allows you to upload AIML files and interact with them in the web browser. It's free to use the explorer part of website. They also have paid developer options which generates an API to bridge your AIML script and any applications you might want to build. It can be easily connected to work with common chat apps like Google talk ect.
If you decide to build everything from scratch you might want to check out the AIML Interpreter library for nodejs.
UPDATE: Here is a node.js based interpreter that you might find useful https://github.com/mrchimp/surly2
I was looking at AIML too and had similar questions. I just found RiveScript RiveScript and it looks like it fits your need to run javascript based on a match. It is not AIML, but very close. There is also at least one tool to convert from AIML to RiveScript, so I would say this fits your needs within those constraints.

Chrome and file system objects

I have been doing a lot of research and trying to find a work around for a problem I have.
I am working with old code. Classic ASP with VBscript.
The tool we have working is file system objects. A user uploads a file into the input and it then gets added to the companies fileshare file. The problem is that google chrome has decided to not support VBscript. I easily converted the VBscript to Javascript using activeX but that is basically IE. We got it working in chrome using the plugin IE tabs. But we do not want to use the plug in.
My question is, since javascript is read only and we are running classic asp as our server side language is there any way that we can implement a cross browser file upload?
Converting ActiveX vbscript to javascript to run in crhome will not work. The reason for this is browsers have a security sandbox which prevents access to the filesystem. If the file share is on the same server as the web server, you would have to process the file uploads server side through a backend language like asp, asp.net, php.

Security of external jar file in GWT

I have created a GWT project which is successfully using an external jar file (see GWT - Using external jars / Java Projects by Lars Vogel‎ and Adding external jar in GWT).
When I use a library file like this, what happens when I compile the project and upload it to AppEngine? Does the jar file get uploaded as it is, or does it get compiled into something else first? And if the former, is it at any security risk of being downloaded without my control?
Let's drop the "google-app-engine" part, it doesn't matter here. You use the library in GWT, on client side. App Engine is server side, with no direct connection to GWT (but due to the volume restrictions it is quite useful to utilize some client side execution like GWT).
Everything you use in GWT will be compiled to JavaScript, transferred to the client and executed there. Obviously you have no control over the result and what the client does with it.
But it will be next to unreadable. Plus the client does not get the JAR per se and he does not get everything that is inside the JAR.
So what really matters is if the library's license allows this and if there are secrets in the library code that are only intended to be used on server side.
Actually, his's answer is not quite correct. The "google-app-engine"-part matters a lot here. Technically, GWT compiles and obfuscates all of the Java code it needs. And it strips out everything that it doesn't need. So, from the JavaScript generated by GWT, it should indeed be quite impossible to reconstruct or maybe even recognize the library. But it turns out that if you use the Eclipse plugin to deploy your app, appcfg uploads all sorts of random stuff to the AppEngine servers, sometimes including the entire Java source of the project (client side code included).
To see what exactly it uploads when you do a deploy, check in your system's temp-directory while the upload is running. You will find an AppEngine staging directory there that contains everything to be sent.
For suggestions for ways around this, you can refer to the answers to a question that I asked earlier: Removing unwanted uploads from AppEngine deployment
What I haven't checked is whether all the unwanted uploaded files end up in directories that are actually directly accessible from the internet.

Resources