40
PeopleTools 8.x - Component Interface _____________________________________________________________________________________________________ PeopleTools 8.x Component Interface Revision No……: 1.0 Date of Release : 30/MAR/2003 Prepared By : viswanath N

Component Interface Cook Book

Embed Size (px)

Citation preview

Page 1: Component Interface Cook Book

PeopleTools 8.x - Component Interface

_____________________________________________________________________________________________________

PeopleTools 8.x Component Interface

Revision No……: 1.0

Date of Release : 30/MAR/2003

Prepared By : viswanath N

Page 2: Component Interface Cook Book

PeopleTools 8.x - Component Interface

Table of Contents________________________________________________________________________

1. Introduction................................................................................................................22. Steps............................................................................................................................23. Steps for creating Component Interface..................................................................34. Setting Component Interface Security....................................................................95. Testing a Component Interface..............................................................................146. Build PeopleSoft API...............................................................................................187. Develop ASP page...................................................................................................21

_____________________________________________________________________________________________________

Page 3: Component Interface Cook Book

PeopleTools 8.x - Component Interface

1. Introduction

Component Interfaces are API-based, real-time interfaces directly into an underlying People Tools component. They allow external programs to feed data into People Soft as if it were being entered through the user interface, ensuring that all necessary edits and triggered processing occurs. When you create a Component Interface in Application Designer, you give it the name of the underlying component and it makes that component's data structures available to you. You can prune the generated object if you want to limit the scrolls, fields, or methods being revealed for that component. You can also add user-defined methods. For COM (VB), C++, or Java, you must generate APIs from Application Designer. No APIs are required to access the Component Interface in People Code. The code required to use a Component Interface must create a session, navigate the necessary scrolls to interrogate or populate the desired fields, save or cancel the transaction, then end the session. Template code can be generated directly from Application Designer.

This document explains,

1. How to create a component interface?2. How to design ASP Page?3. How to Integrate ASP Page with PeopleSoft thru Component Interface?

2. Steps

Step Description Objects1 Design Requirement specification document2 Define the component Each component interface can be associated

with one and only one component. While defining CI, you need to choose PeopleSoft Component.

3 Authorized security access Component Interfaces need to be authorized in Maintain Security.

4 Test Test the component interface in the Application Designer

5 Build PeopleSoft APIs You need to create an API which will build the dynamic link libraries, classes and registry settings necessary to allow a third party application to communicate with PeopleSoft.

6 Install Ext API Install External API application in IIS Server.7 Develop ASP page Build web application (third party) page using

ASP.8 Deploy ASP Page Deploy ASP program, .tlb and .reg files in IIS

server.9 Test the interface Test the complete interface between third party

and PeopleSoft.

_____________________________________________________________________________________________________

Page 4: Component Interface Cook Book

PeopleTools 8.x - Component Interface

3. Steps for creating Component Interface

Navigation

File-> New->Component Interface

Create a new Component Interface definition.

_____________________________________________________________________________________________________

Page 5: Component Interface Cook Book

PeopleTools 8.x - Component Interface

Each component interface can be associated with one and only one component. You need to provide the name of the component.

In this example we are using ‘USERMAINT’ component.

_____________________________________________________________________________________________________

Page 6: Component Interface Cook Book

PeopleTools 8.x - Component Interface

When you select the component, the system will prompt to accept the default properties.

Select ‘Yes’

_____________________________________________________________________________________________________

Page 7: Component Interface Cook Book

PeopleTools 8.x - Component Interface

Select ‘Yes’ will provide all of the properties for the component. The component view shows exactly the same hierarchical record structure that you would see if you had the component open in Application Designer.

Note: In case if you have chosen ‘No’ then manually you need to drag objects from the component view into component interface view.

_____________________________________________________________________________________________________

Page 8: Component Interface Cook Book

PeopleTools 8.x - Component Interface

Save your component interface. By selecting File -> Save option.

_____________________________________________________________________________________________________

Page 9: Component Interface Cook Book

PeopleTools 8.x - Component Interface

In this example the Component Interface name is ‘IN_CI_USER_PROFILE’.

_____________________________________________________________________________________________________

Page 10: Component Interface Cook Book

PeopleTools 8.x - Component Interface

4. Setting Component Interface Security

After you have created a component interface, you will have to set up security for it before the component interface can be tested or accessed. As with other People Tools objects, access must specifically be granted before a component interface is available for use at runtime by any user. Additionally, before a component interface can be tested, security access must be given to the appropriate permission list, so that the desired user can access the component interface.

There are essentially two ways to secure component interface:

1. Use Maintain Security to set security. Maintain Security addresses component interfaces security in the same manner that it addresses security for other People Tools objects. You can use it to control access to individual methods or entire component interfaces.

2. Use Application Designer to mark individual properties “read only.” Any property can be marked “read only” in the component interface design.

Navigation:Home -> People Tools -> maintain Security -> Use -> Permission List

_____________________________________________________________________________________________________

Page 11: Component Interface Cook Book

PeopleTools 8.x - Component Interface

Navigate to the permission List for SPCMPINT.

When you view the component interfaces tab, you can see all the component interfaces that the permission list is authorized to use.

_____________________________________________________________________________________________________

Page 12: Component Interface Cook Book

PeopleTools 8.x - Component Interface

Use the lookup icon to find the IN_CI_USER_PROFILE.

_____________________________________________________________________________________________________

Page 13: Component Interface Cook Book

PeopleTools 8.x - Component Interface

After you have selected the component interface, select the ‘EDIT’ hyperlink for the access. Access Permission is either Full access or No access.

_____________________________________________________________________________________________________

Page 14: Component Interface Cook Book

PeopleTools 8.x - Component Interface

Select Full Access (All) and click OK.

_____________________________________________________________________________________________________

Page 15: Component Interface Cook Book

PeopleTools 8.x - Component Interface

5. Testing a Component Interface

After you have set up the security parameters for a component interface, you can then test the contents and behavior of the component.

Open the component interface in the Application Designer. To test a component interface with in Application Designer, you can:

1. Select Tools, Test Component Interface from the menu2. Right-click anywhere in the Component Interface view and select ‘Test

Component Interface’.

_____________________________________________________________________________________________________

Page 16: Component Interface Cook Book

PeopleTools 8.x - Component Interface

The below screen shot shows ‘Component Interface Tester’. This dialog displays the key structures defined as part of the component interface. To enter a key value, double-click on any field displayed in the key structures column. You can then edit the value in the right-hand column. The data used for the test will correspond to the key values you enter here.

_____________________________________________________________________________________________________

Page 17: Component Interface Cook Book

PeopleTools 8.x - Component Interface

Double-click on OPRID in the ‘Get Existing’ keys group box and enter ‘PS’.

_____________________________________________________________________________________________________

Page 18: Component Interface Cook Book

PeopleTools 8.x - Component Interface

Expand the OPRDEFN record, and you will se the content information.

Double-click on emaild field and make a change. Right click on the component interface name and you will see a list of methods. Choose save from the list of methods.

_____________________________________________________________________________________________________

Page 19: Component Interface Cook Book

PeopleTools 8.x - Component Interface

6. Build PeopleSoft API

After creating your component interface, you need to create an API, which will build the dynamic link libraries, classes, and registry settings necessary to allow a third party application to communicate with PeopleSoft. These files reside on the client machine; that is, the web server for ASP, and the machine running the Java program for Java. The registry file may also need to be executed to update the registry with the new libraries.

Only external applications, such as COM or C/C++ programs, require a component interface API. PeopleCode programs do not require a component interface API.

With the component interface open, select Build -> PeopleSoft API

We only want to build the COM type library, Turn the check box for Java Classes off. Click ‘OK’ to build.

_____________________________________________________________________________________________________

Page 20: Component Interface Cook Book

PeopleTools 8.x - Component Interface

_____________________________________________________________________________________________________

Page 21: Component Interface Cook Book

PeopleTools 8.x - Component Interface

COM Type Library

The COM API consisting of the type library PeopleSoft_PeopleSoft.tlb and the registry file PeopleSoft_PeopleSoft.reg will be built in the Target Directory. The PeopleSoft API adapter (psapiadapter.dll) will be placed in the COM server DLL location.

_____________________________________________________________________________________________________

Page 22: Component Interface Cook Book

PeopleTools 8.x - Component Interface

7. Develop ASP page

<%'************************************************************************'* *'* Confidentiality Information: *'* *'* This module is the confidential and proprietary information of *'* PeopleSoft, Inc.; it is not to be copied, reproduced, or transmitted *'* in any form, by any means, in whole or in part, nor is it to be used *'* for any purpose other than that for which it is expressly provided *'* without the written permission of PeopleSoft. *'* *'* Copyright (c) 1988-2002 PeopleSoft, Inc. All Rights Reserved. *'* *'* Created by Tushar Chury 7/10 *'* *'* Description - PSCITester.asp *'* *'************************************************************************%><html>

<head><title>PeopleSoft Component Interface Tester</title><script language="JavaScript1.2"><!--function getHostName(form){ if (form.SERVERNAME.value == "") { form.SERVERNAME.value = location.hostname; }}//--></script>

</head><body><h3>PeopleSoft Component Interface Tester</h3><%'***** Declare Global Variables *****Dim oSessionDim oCI

'Connect InformationstrServerPort = "9000"

_____________________________________________________________________________________________________

Page 23: Component Interface Cook Book

PeopleTools 8.x - Component Interface

strUserID = "PS"strUserPswd = "PS"

'***** Generic functions/subs *****Sub ErrorOut(SubName, SubMsg) Response.Write("<br>oSession.PSMessages.Count = " & oSession.PSMessages.Count) If oSession.PSMessages.Count > 0 Then For i = 1 To oSession.PSMessages.Count Response.Write("<br>" & oSession.PSMessages.Item(i).Text) Next Else Response.Write("<br>err.Number = " & err.number) Response.Write("<br>err.Description = " & err.description) End If Call SessionDisconnectEnd Sub

Function SessionConnect(strServerName, strServerPort, strUserID, strUserPswd) On Error Resume Next 'Establishes a PeopleSoft Session 'The Connect method connects a session object to a PeopleSoft application server 'Syntax : (version, {"EXISTING" | ConnectID:Port}, OperatorID, Password, ExtAuth)

Set oSession = CreateObject("PeopleSoft.Session") If err <> 0 Then Response.Write("<br>err.Number = " & err.number) Response.Write("<br>err.Description = " & err.description) SessionConnect = False Else SessionConnect = oSession.Connect(1, strServerName & ":" & strServerPort, strUserID, strUserPswd, 0)

If Not SessionConnect Then Call ErrorOut(SubName, SubMsg) Response.Write("<br>Connect to session failed. Possible causes are: ") Response.Write("<br>1. PsExtApi not installed") Response.Write("<br>2. APIs not built") Response.Write("<br>3. Connect Information to the Application Server is incorrect") Response.Write("<br>4. Application Server not running") End If End IfEnd Function

Sub SessionDisconnect 'Disconnect current session to free memory and session variables Call oSession.disconnect Set oSession = nothing

_____________________________________________________________________________________________________

Page 24: Component Interface Cook Book

PeopleTools 8.x - Component Interface

End Sub%>

<%'***** Main *****If (Request.Form.Item = "") Then%><form method="POST" action="PSCITester.asp" name="CITEST"> <strong>Connection Information:</strong><br> <table border="0" width="80%"> <tr> <td><strong>Application Server Name</strong></td> <td><strong>Application Server Jolt Port</strong></td> <td><strong>PeopleSoft User ID</strong></td> <td><strong>User ID Password</strong></td> </tr> <tr> <td><strong><input type="text" size="20" name="SERVERNAME" onFocus="getHostName(this.form)"</strong></td> <td><strong><input type="text" size="20" name="SERVERPORT" value="<%=strServerPort%>"></strong></td> <td><strong><input type="text" size="20" name="USERID" value="<%=strUserID%>"></strong></td> <td><strong><input type="password" size="20" name="USERPSWD" value="<%=strUserPswd%>"></strong></td> </tr> </table> <br><input type="submit" value="Submit"></form><%Else strServerName = Request.Form("SERVERNAME") strServerPort = Request.Form("SERVERPORT") strUserID = Request.Form("USERID") strUserPswd = Request.Form("USERPSWD")

'***** Connect to the App Sever ***** If Not SessionConnect(strServerName, strServerPort, strUserID, strUserPswd) Then Response.Write("<h3>Connect to Appserver failed</h3>") Response.Write("<br>Error connecting to the Application Server.") Response.Write("<br>Please make sure you entered your Server, JSL port number, User ID, ") Response.Write("and User Password correctly.") Response.Write("<br>Check the Application Server log files for additional messages.") Else Response.Write("<h3>Connected to Appserver...</h3>") '***** Get the Component ***** CIName = "IN_CI_USER_PROFILE" Set oUSER_PROFILE = oSession.GetComponent(CIName)

_____________________________________________________________________________________________________

Page 25: Component Interface Cook Book

PeopleTools 8.x - Component Interface

If oUSER_PROFILE Is Nothing Then Response.Write("<br>Get on Component Interface " & CIName & " failed") End If Response.Write("<br>Get on Component Interface " & CIName & " succeeded") Call SessionDisconnect End IfEnd If%></body></html>

_____________________________________________________________________________________________________

Page 26: Component Interface Cook Book

PeopleTools 8.x - Component Interface

8. Testing the IN_CI_USER_PROFILE Component Interface

First we need to associate the ASP with a website.

1. Start -> Settings -> Control Panel -> Administrative Tools -> Internet Services Manager

2. Set up a Virtual directory

_____________________________________________________________________________________________________

Page 27: Component Interface Cook Book

PeopleTools 8.x - Component Interface

The New Virtual Directory wizard will lead you through the process.

Click Next on the Virtual Directory wizard dialog.

We will name our Virtual directory Intel.

_____________________________________________________________________________________________________

Page 28: Component Interface Cook Book

PeopleTools 8.x - Component Interface

The Physical path will point to the directory where the ASP program resides in the hard disk(c:\Intel\).

Use the Browse button to find the path, then click Next.

_____________________________________________________________________________________________________

Page 29: Component Interface Cook Book

PeopleTools 8.x - Component Interface

Set Access permissions as show below.

Click Next.

_____________________________________________________________________________________________________

Page 30: Component Interface Cook Book

PeopleTools 8.x - Component Interface

Click Finish to complete setup.

_____________________________________________________________________________________________________

Page 31: Component Interface Cook Book

PeopleTools 8.x - Component Interface

Right-click on the program and select Browse option.

_____________________________________________________________________________________________________

Page 32: Component Interface Cook Book

PeopleTools 8.x - Component Interface

Here you can enter the session connection information for your workstation.

Application server name = your MACHINENAMEApplication server port (JOLT) = 9000PeopleSoft User ID = PSPeopleSoft User Password = PS

Click Submit.

_____________________________________________________________________________________________________

Page 33: Component Interface Cook Book

PeopleTools 8.x - Component Interface

When you click Submit, you will get the following screen with the message. That means you have successfully integrated ASP page with PeopleSoft.

*******ALL THE BEST******

_____________________________________________________________________________________________________