Beruflich Dokumente
Kultur Dokumente
By
Krishna Kishor K
Venkateshwara Rao
Objectives:
Let us take the example of a component W_K_JAV_CI, which contains three pages.
1.Personal information of the employee,
2.Official information of the employee and
3.Passport information of the employee.
As soon as you select new CI, a window appears asking for the component, which you
want to expose. Mention your component name there. In this case it is W_K_JAV_CI.
When you select the component and press OK, one more window opens, asking whether
you want all the properties of the component to be exposed or not.
As exposing all the properties is not required here, better to select NO.
Mainly it has two windows. One shows the CI, other shows the underlying component.
Component window shows the all records on which component is based, and also shows
the search records separately.
CI window shows Get keys, Find keys, create Keys, Properties and default methods.
Note: If you want to see “Create keys” and “Create” method, then you have to give ADD
permissions to the component, in the “component properties”.
Now the records in Component window can be opened, and the fields to be exposed can
be just dragged in to the CI window from the Component window.
Select the suitable Permission List, and then add your CI to the CI list. Then press, “Edit”
and give full access permission to your CI.
Note: You may not be having permissions to do this, in this case “Edit” button will not be active.
Contact your PSAdmin for this.
Now you have to build JAVA APIs, this is an interface for the JAVA program you are
going to write.
APIs contain the Interface classes required for Java program to run.
For example,
IWKJVCI.java contains the Interface IWKJVCI. This interface contains all the function
declarations.
WKJVCI.java contains WKJVCI class. WKJVCI class extends IWKJVCI class and
implements all function definitions.
Both IWKJVCI.java and WKJVCI.java are created during building APIs.
To build APIs
Go to Build PeopleSoft APIs from Application designer.
A window “Build PS API bindings” appears, select “JAVA classes” check box.
Under “Select APIs to build”, select the following.
CompIntfc. <CI name>
CompIntfc. <CI name>Collection
PeopleSoft.CompintfcCollection
PeopleSoft.Property
PeopleSoft.PropertyList
PeopleSoft.PSMessage
PeopleSoft.PSMessageCollection
PeopleSoft.RegionalSettings
PeopleSoft.Session
PeopleSoft.TraceSettings and press OK.
By default these APIs will be built in the directory
<PSHOME>\web\psjoa
Now we have to write the Java program for accessing the component through CI.
Instead of writing the program from scratch, you can use the JAVA template provided by
PS.
This can help you to run Java programs from any directory. This gives the path of Java
compiler.
If any of the properties of CI (fields of the component) is an integer, then include “import
java.math.BigDecimal”at the starting of your program.
For ex: if W_EMPID is an integer field, then the function “setWempid ();” expects a
BigDecimal.
Therefore a statement “oWKJvCi.setWempid (str WEmpid);” in the generated Java
template, should be changed in to “oWKJvCi.setWempid (new java.math.BigDecimal
(str WEmpid));”
Setting CI modes.
1. cd <PSHOME>\web\psjoa\PeopleSoft\Generated\CompIntfc
2. <PSHOME>\web\psjoa\PeopleSoft\Generated\CompIntfc:\>javac *.java
<PSHOME>\web\psjoa\PeopleSoft\Generated\CompIntfc:\>java <filename>
When the program executes, it asks for Application server machine name, Application
server port number, user id and password.
Application server machine name, Application server port number can be got from the
file,
The automatically generated Java template gets data from the database, using “Get”
function. Similarly we can use, “Set” and “Create” functions to update existing rows and
create new rows respectively.
Now you can enhance your Java program by including GUIs, using Java Swings.
Here is how sample execution of the program in Command prompt.
With a little modification to the generated Java template, following functionality is
achieved.
Here is the output using Java Swings (GUIs)
(program name has been changed as SwingDemo.java)