domingo, 4 de enero de 2015

Add a JAVA applet in a PeopleSoft Page


A JAVA applet is a set of related classes and compiled into a ".jar" file. This file is able to be run through an HTML object.

In PeopleSoft we cun add these programs in our pages through some easy steps.

Let's see an example:
For instance, we have a page where we can see a purchase order's lines. We want to show a calculator in case any user wants to make some calculations based on the numbers in the page.


1) Place the ".jar" applet file in a public folder of the Web Server. We need this folder to be public since users must have access to the file.
For instance, we can place the file in the folder were the "Signon.html" file is placed.
Generally the path is:
//server/PS_HOME/WEBSERVER/BASE/application/peoplesoft/PORTAL/portalName




2) Add a HTMLAREA field in the page where we want to show the Embedded Calculator.




3) Create an HTML object. It will be used to populate the area in the page.



We are interested on the following parameters of this file:
NAME:Applet's name.
CODE: Path and name of the applet's main class.
ARCHIVE: Name and extension of the JAR file we left in the WebServer.
WIDTH: of the applet (pixels)
HEIGHT: of the applet (pixels)
CODEBASE: Here we should detail the path where the file is placed. Since we left it in the same folder as the singon.html file we only need to set the dot character "." as a parameter. With this reference we tell the system the file is in the same path.

Then we use the "document.write()" method to write the applet in the HMTL.

Note: Line breaks were only added to be shown in the explanation of the parameters. In the HTML object the applet must be written in the same line, so the final quote is recognized and the string is closed.


4) Populate the HTMLAREA field in the Activate event of the Page.



5) Finally, the result is as follows:



I hope this blog could be so useful to you as it is to  me.
Regards.
Facundo Salerno.

No hay comentarios:

Publicar un comentario