COMPONENT INTERFACE
Click to edit Master subtitle style
By, Mr. Srinivas.
12/22/12
What is Component Interface? A means to access the PeopleSoft application without using the
PeopleSoft pages.
It exposes a PeopleSoft component for synchronous access from
external application(peoplecode,c/p, java).
External applications need not be concerned with the details of page
structures and component definitions in order to access the underlying data and business logic through component interfaces.
12/22/12
Architecture of Component Interface
12/22/12
Architecture(Contd..) Fundamental elements to the component interface architecture.
• Components • Component Interface • Component Interface API
12/22/12
Elements of ComponentInterface Every component interface has the following four main attributes 1)Name 2)Keys GetKeys Findkeys CreateKeys Generated in CI when the Use tab on the Component Properties dialog allows the Add action
12/22/12
Elements of ComponentInterface(contd…) 3) Properties and collections (fields and records) Provide access to both component data and component interface settings. Two types of properties: Standard and -defined.
Standard properties can be set to true or false. Examples : InteractiveMode, GetHistoryItems, EditHistoryItems. •
12/22/12
defined methods •
-defined properties map to record fields on the PeopleSoft component and are displayed in the PeopleSoft Application Designer.
•
A component interface collection is a special type of property that corresponds to a scroll.
4)Methods •
A method is a function that performs a specific task on a component interface at runtime.
•
Two main types of methods: standard and -defined.
12/22/12
Standard methods •
Standard methods are those that are available for all component interfaces. 1.Cancel: Cancels any changes made since the last save. 2.Create: Creates new instance of CI
3.Find :Performs partial key search on the particular instance of the CI using search key at level zero. 4.Get
:Retrieves a particular instance of CI.
5.Save : Saves an instance of the CI. 6.GetPropertyByName:Returns the value of the property specified by name. 7.SetPropertyName: Sets the value to the property specified by name.
12/22/12
defined Methods Those that you can create to meet the requirements of an individual component interface. •
A method is simply a PeopleCode function that you wish to make accessible through the component interface •
•
Each method maps to a single People Code function
The Component Interface object, instantiated from a session object, is created at runtime as a way to access the data specified &oSession = %Session; by the Component Interface. &oSIdn1Ci = &oSession.GetCompIntfc(CompIntfc.S_IDN1_CI); •
12/22/12
•
When you populate a Component Interface with data, the first thing you fill out are its keys, as you would in a component. These can be keys for getting an existing instance of the data or for creating a new instance of the data.
•
Component Interface properties provide access to the data in a component buffer.
•
Component Interface methods are functions that can be called to perform operations on a Component Interface.
•
Component Interface can map to only one component.
•
A component can have any number of CIs.
12/22/12
Component Interface Definition
12/22/12
Developing & Implementing CI Design Define Fields Record Definition Build Record Defines Pages Define Components Define the Component Interface Link the Component to the Menu Authorize Access (Security) Test your Component Interface •
A component interface is a PeopleTools object that you create in Application Designer. 12/22/12
Creating & Working with a CI To create a new component interface Select File, New from the Application Designer menu. Select the Component Interface object type from the New dialog. Select the component on which this component interface will be based. Save the component interface. Add properties, collections, or methods to the component interface. Set the security. Test the component interface.
12/22/12
Working with Component Interface Declaring a Component Interface Object Component Interfaces are declared as type ApiObject. For
example: Local ApiObject &TESTCI;
Scope of a Component Interface Object A Component Interface can be instantiated from PeopleCode, from a Visual
Basic program, from COM and C/C++.
Variables defined at Component and Global are only for Component Interface
12/22/12
Example In this example, you are getting an existing instance of data for the EMPL_CHECK_CI
Component Interface, which is based on the EMPL_CHECKLIST component, for the Update/Display mode.
Local ApiObject &TESTSESSION; Local ApiObject &TESTCI; &TESTSESSION = GetSession(); &TESTSESSION.Connect(1, "EXISTING", "", "", 0); &TESTCI = &TESTSESSION.GetCompIntfc(COMPINTFC.EMPL_CHECK_CI); &TESTCI.EMPLID= "8001"; &TESTCI.Get(); /* Get checklist Code */ &CHECKLIST_CD = &TESTCI.CHECKLIST_CD; /* Set Effective date */
12/22/12
Component Interface Working with a CI – Setting Security Two ways to Secure Component Interfaces
1) Can be used to restrict access to individual methods or entire Component Interface
12/22/12
Setting Security(contd..) 2)Application Designer • To make individual property =Read Only‘
12/22/12
Using the CI Tester
12/22/12
Using the CI Tester(contd..) •
Specify whether to run in Interactive mode.
In noninteractive mode, if you set a property, the property is not validated until you perform the save. However, in interactive mode the property is validated immediately.
•
Specify whether to get or edit history items. Selecting Get History Items retrieves history data Selecting Edit History Items enables editing and saving of history data. These options apply to effective-dated fields only
12/22/12
Runtime considerations WinMessage Unavailable
You cannot use WinMessage in a component that will be used to build a component interface. Use MsgGet() instead. Email from a Component Interface
To use a component interface to send email, use TriggerBusinessEvent People Code event, not SendMail. Related Display
Related display fields are not available 12/22/12 for use in a
Benefits of CI Access to all business logic
Delivered PeopleSoft logic
Your customizations Insulated from complexities of application
Data relationships
Data Integrity
Upgradeable PeopleTools object
12/22/12
Thank you
12/22/12