Embed applet

I am trying to figure out how to embed the applet version into an existing webpage. I have tried viewing the source of your applet web page and copy it into a blank html file for testing.

[code]

Sales
<script>
var attributes = {
	"codebase":"http://ignitionmaster:80/main/system/launchbin/",
	"archive":"launchclient.jar",
	"code":"com.inductiveautomation.ignition.client.launch.BootstrapApplet",
	"width":"1660",
	"height":"1864"};
var parameters = {		"classloader_cache":"false",
	"javaws.sr.gateway.addr.0":"10.2.2.111:80:443/main",
	"javaws.sr.gateway.addr.1":"10.2.2.112:80:443/main",
	"javaws.sr.scope":"C",
	"javaws.sr.project":"Sales",
	"javaws.sr.launchts":"1333661477674",
	"javaws.sr.main":"com.inductiveautomation.factorypmi.application.runtime.ClientLaunchHook"};
deployJava.runApplet(attributes,parameters,'1.5');
[/code]

but nothing appears on the page. I then tried changing the script source to “http://www.java.com/js/deployJava.js” and i received an error exception: Permission denied ignitionmaster/main/system/launchbin/

thank you,

I would copy the deployJava.js into your website.

if I manually download the deployJava.js and launchclient.jar files from the ignition server, place them in the same directory as my html file, and edit the javascript to reference the local files I can get the applet to appear in my webpage.

in the following code i changed the script source to just “deployJava.js” and i commented out the codebase attribute “http://ignitionmaster:80/main/system/launchbin/

<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd">
<html xmlns="http://www.w3.org/1999/xhtml"
	xmlns:wicket="http://wicket.sourceforge.net/">
	<head>
		<title>Sales</title>
	<script src="deployJava.js"></script>
</head>
<body>
<div class="applet">

	<script>
	var attributes = {
		//"codebase":"http://ignitionmaster:80/main/system/launchbin/",
		"archive":"launchclient.jar",
		"code":"com.inductiveautomation.ignition.client.launch.BootstrapApplet",
		"width":"1660",
		"height":"1864"};
	var parameters = {		"classloader_cache":"false",
		"javaws.sr.gateway.addr.0":"10.2.2.111:80:443/main",
		"javaws.sr.gateway.addr.1":"10.2.2.112:80:443/main",
		"javaws.sr.scope":"C",
		"javaws.sr.project":"Sales",
		"javaws.sr.launchts":"1333659510556",
		"javaws.sr.main":"com.inductiveautomation.factorypmi.application.runtime.ClientLaunchHook"};
	deployJava.runApplet(attributes,parameters,'1.5');
</script>

</div>
</body>
</html>

is this the proper way of embedding an ignition applet. What if the deployJava.js file or the launchclient.jar file changes in an Ignition version. wouldn’t I have to manually download and update the files on the webserver? is there a way to give permission so i can just reference the files on the ignition server?

Thank you,

There are a few different ways to skin this cat, but this looks fine to me. You can get to launchclient.jar through:

yourserver/main/system/jar/m/launchclient.jar

I think it’s fine to deployJava.js - it’s not ours anyhow it’s part of the java deployment kit, so even if we change our version of it yours will work just fine.

i change my html as follows

<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd">
<html xmlns="http://www.w3.org/1999/xhtml"
	xmlns:wicket="http://wicket.sourceforge.net/">
	<head>
		<title>Sales</title>
	<script src="deployJava.js"></script>
</head>
<body>
<div class="applet">

	<script>
	var attributes = {
		"codebase":"http://ignitionmaster:80/main/system/jar/m/",
		"archive":"launchclient.jar",
		"code":"com.inductiveautomation.ignition.client.launch.BootstrapApplet",
		"width":"1660",
		"height":"1864"};
	var parameters = {		"classloader_cache":"false",
		"javaws.sr.gateway.addr.0":"10.2.2.111:80:443/main",
		"javaws.sr.gateway.addr.1":"10.2.2.112:80:443/main",
		"javaws.sr.scope":"C",
		"javaws.sr.project":"Sales",
		"javaws.sr.launchts":"1333659510556",
		"javaws.sr.main":"com.inductiveautomation.factorypmi.application.runtime.ClientLaunchHook"};
	deployJava.runApplet(attributes,parameters,'1.5');
</script>

</div>
</body>
</html>

and i still get this error in the java console

just to clarify I can manually browse to

http://ignitionmaster:80/main/system/jar/m/

with my web browser and download the launchclient.jar file. i only receive permission denied through the java console when opening the webpage.

I don’t think you are allowed to load jars from websites that aren’t the same as the one serving up the page loading the applet. You’ll need to copy that jar and host it on this other webserver.