Documenti di Didattica
Documenti di Professioni
Documenti di Cultura
x - Component Interface
_____________________________________________________________________________________________________
Table of Contents _______________________________________________________________________ _ Introduction .......................................................................................................................2 Steps....................................................................................................................................2 Steps for creating Component Interface..........................................................................3 Setting Component Interface Security.............................................................................9 Testing a Component Interface......................................................................................14 Build PeopleSoft API.......................................................................................................18 Develop ASP page............................................................................................................22 Testing the IN_CI_USER_PROFILE Component Interface......................................25 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?
Steps
Step 1 2 Description Design Define the component Objects Requirement specification document Each component interface can be associated with one and only one component. While defining CI, you need to choose PeopleSoft Component. Component Interfaces need to be authorized in Maintain Security. Test the component interface in the Application Designer
3 4
_____________________________________________________________________________________________________
6 7 8 9
Install Ext API Develop ASP page Deploy ASP Page Test the 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. Install External API application in IIS Server. Build web application (third party) page using ASP. Deploy ASP program, .tlb and .reg files in IIS server. Test the complete interface between third party and PeopleSoft.
_____________________________________________________________________________________________________
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.
_____________________________________________________________________________________________________
When you select the component, the system will prompt to accept the default properties. Select Yes
_____________________________________________________________________________________________________
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.
_____________________________________________________________________________________________________
_____________________________________________________________________________________________________
_____________________________________________________________________________________________________
_____________________________________________________________________________________________________
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
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.
_____________________________________________________________________________________________________
_____________________________________________________________________________________________________
After you have selected the component interface, select the EDIT hyperlink for the access. Access Permission is either Full access or No access.
_____________________________________________________________________________________________________
_____________________________________________________________________________________________________
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 menu 2. Right-click anywhere in the Component Interface view and select Test
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, doubleclick 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.
Double-click on OPRID in the Get Existing keys group box and enter PS.
_____________________________________________________________________________________________________
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.
_____________________________________________________________________________________________________
_____________________________________________________________________________________________________
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.
_____________________________________________________________________________________________________
_____________________________________________________________________________________________________
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.
_____________________________________________________________________________________________________
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 oSession Dim oCI 'Connect Information strServerPort = "9000" 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 SessionDisconnect End 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 If End Function Sub SessionDisconnect 'Disconnect current session to free memory and session variables Call oSession.disconnect Set oSession = nothing 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) 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 If End If %> </body> </html>
_____________________________________________________________________________________________________
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
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.
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.
_____________________________________________________________________________________________________
Click Next.
_____________________________________________________________________________________________________
_____________________________________________________________________________________________________
Here you can enter the session connection information for your workstation. Application server name = your MACHINENAME
_____________________________________________________________________________________________________
Application server port (JOLT) = 9000 PeopleSoft User ID = PS PeopleSoft User Password = PS Click Submit.
When you click Submit, you will get the following screen with the message. That means you have successfully integrated ASP page with PeopleSoft.
_____________________________________________________________________________________________________
_____________________________________________________________________________________________________