PeopleTools 8.12 Component Interface PeopleBook - Oracle

Transcription

PeopleTools 8.12 ComponentInterface PeopleBook

PeopleTools 8.12 Component Interface PeopleBookSKU MTCIr8SP1 1200PeopleBooks Contributors: Teams from PeopleSoft Product Documentation andDevelopment.Copyright 2001 by PeopleSoft, Inc. All rights reserved.Printed in the United States of America.All material contained in this documentation is proprietary and confidential to PeopleSoft,Inc. and is protected by copyright laws. No part of this documentation may be reproduced,stored in a retrieval system, or transmitted in any form or by any means, including, but notlimited to, electronic, graphic, mechanical, photocopying, recording, or otherwise without theprior written permission of PeopleSoft, Inc.This documentation is subject to change without notice, and PeopleSoft, Inc. does not warrantthat the material contained in this documentation is free of errors. Any errors found in thisdocument should be reported to PeopleSoft, Inc. in writing.The copyrighted software that accompanies this documentation is licensed for use only instrict accordance with the applicable license agreement which should be read carefully as itgoverns the terms of use of the software and this documentation, including the disclosurethereof.PeopleSoft, the PeopleSoft logo, PeopleTools, PS/nVision, PeopleCode,PeopleBooks, Vantive, and Vantive Enterprise are registered trademarks, andPeopleTalk and "People power the internet." are trademarks of PeopleSoft, Inc. Allother company and product names may be trademarks of their respective owners.

ContentsAbout This PeopleBookBefore You Begin . viiRelated Documentation . viiDocumentation on the Internet.viiiDocumentation on CD-ROM .viiiHardcopy Documentation .viiiTypographical Conventions and Visual Cues.viiiComments and Suggestions . xChapter 1Component InterfaceIntroduction. 1-1Component Interface Architecture. 1-2Attributes of a Component Interface. 1-3Component Interface Name . 1-3Keys . 1-3Properties and Collections. 1-4Security for Properties. 1-5Methods. 1-6Chapter 2Creating a Component InterfaceViews in Application Designer. 2-1Component Interface View . 2-2Component Interface View Display. 2-2Creating a New Component Interface. 2-3Creating Properties. 2-5Making Properties Read-Only. 2-6Creating Collections. 2-6Adding and Removing Keys . 2-7Which Properties to Expose? . 2-7PEOPLESOFT PROPRIETARYANDCONFIDENTIALCONTENTSiii

PEOPLETOOLS 8.12 COMPONENT INTERFACE PEOPLEBOOKJANUARY 2001Guidelines for Exposing Components. 2-7Working with Methods . 2-8Standard Methods . 2-8User-Defined Methods . 2-9Setting Component Interface Security. 2-10Testing a Component Interface. 2-13Getting the Signature of the ItemByKeys Method. 2-18Validating a Component Interface. 2-20Generating Visual Basic Template . 2-20Generating PeopleCode . 2-24Chapter 3The Component Interface APIBinding Considerations . 3-3COM Binding. 3-3Third Party Application. 3-3External API Installation. 3-4C Header Binding. 3-4Third Party Application. 3-4C Header File . 3-4Connecting to a Component Interface . 3-5Installing External Client Settings for the API. 3-5Comparing Component Interface and Components. 3-5Differences in Search Dialog Processing . 3-5Differences in PeopleCode Event and Function Behavior. 3-5Limitations of Client-Only PeopleCode. 3-6Email from a Component Interface. 3-6WinMessage Unavailable. 3-6Calling another Component Interface . 3-6Chapter 4Component Interface ExamplePeopleCode Example. 4-2Java and Active Server Page Examples. 4-4Active Server Page Example. 4-6Connecting to the Application Server . 4-7Getting an Instance. 4-7CONTENTSivPEOPLESOFT PROPRIETARYANDCONFIDENTIAL

JANUARY 2001PEOPLETOOLS 8.12 COMPONENT INTERFACE PEOPLEBOOKFinding an Existing Record. 4-8Getting an Instance of Data. 4-9Migrating Through Scrolls. 4-10Editing and Accessing Data in an Item . 4-11Inserting a Row into a Collection. 4-11Deleting a Row from a Collection . 4-12Disconnecting from a Session. 4-12Java Example . 4-12Connecting to the Application Server . 4-13Getting an Instance of the Component Interface. 4-13Finding an Existing Record. 4-13Getting an Instance of Data. 4-13Migrating Through Scrolls. 4-14Editing and Accessing Data in an Item . 4-14Inserting an Item into a Collection. 4-15Deleting a Row from a Collection . 4-15Disconnecting from a Session. 4-15Chapter 5Component Interface SDKRequirements . 5-1The PTSDK Development Project. 5-1PTSDK Project Objects. 5-2PTSDK Records . 5-2SDK BUS EXPENSES Test Page. 5-7Installing the PTSDK Project. 5-7Component Interface Tester and Samples . 5-10C Tester and Sample. 5-10Preparing Your C Tester and Sample . 5-11Using the C CI Tester . 5-13Using the C CI Sample . 5-14Visual Basic Tester and Sample. 5-15Preparing Your Visual Basic Tester and Sample . 5-15Using the Visual Basic CI Tester . 5-15Using the Visual Basic CI Sample . 5-16ASP Tester and Sample. 5-18Preparing Your ASP Tester and Sample . 5-19Using the ASP CI Tester . 5-19PEOPLESOFT PROPRIETARYANDCONFIDENTIALCONTENTSv

PEOPLETOOLS 8.12 COMPONENT INTERFACE PEOPLEBOOKJANUARY 2001Using the ASP CI Sample . 5-20Java Tester and Sample . 5-22Preparing Your Java Tester and Sample . 5-22Using the Java CI Tester . 5-23Using the Java CI Sample . 5-23IndexCONTENTSviPEOPLESOFT PROPRIETARYANDCONFIDENTIAL

ABOUT THIS PEOPLEBOOKThis book describes a PeopleSoft component interface that is a PeopleTools object that you createin Application Designer. It allows access to a PeopleSoft component for synchronous accessfrom another application. This book includes the following:Introduction to Component Interface introduces the component interface architecture, includingcomponent interface properties, collections, keys, and methods.Creating a Component Interface describes how to create a component interface.The Component Interface API discusses techniques for accessing components from PeopleCodeand through Visual Basic or web-based applications through the Component Interface API.Component Interface Example shows a sample of creating and calling a component interface.Component Interface SDK describes how to use the component interface resources in theSoftware Development Kit to integrate your PeopleSoft application with third party products.Before You BeginTo benefit fully from the information covered in this book, you need to have a basicunderstanding of how to use PeopleSoft applications. We recommend that you complete at leastone PeopleSoft introductory training course.You should be familiar with navigating around the system and adding, updating, and deletinginformation using PeopleSoft windows, menus, and pages. You should also be comfortable usingthe World Wide Web and the Microsoft Windows or Windows NT graphical user interface.Related DocumentationTo add to your knowledge of PeopleSoft applications and tools, you may want to refer to thedocumentation of the specific PeopleSoft applications your company uses. You can accessadditional documentation for this release from PeopleSoft Customer Connection(www.peoplesoft.com). We post updates and other items on Customer Connection, as well. Inaddition, documentation for this release is available on CD-ROM and in hard copy.Important! Before upgrading, it is imperative that you check PeopleSoft CustomerConnection for updates to the upgrade instructions. We continually post updates as werefine the upgrade process.PEOPLESOFT PROPRIETARYANDCONFIDENTIALPREFACEvii

PEOPLETOOLS 8.12 COMPONENT INTERFACE PEOPLEBOOKJANUARY 2001Documentation on the InternetYou can order printed, bound versions of the complete PeopleSoft documentation delivered onyour PeopleBooks CD-ROM. You can order additional copies of the PeopleBooks CDs throughthe Documentation section of the PeopleSoft Customer Connection Web site:http://www.peoplesoft.com/You’ll also find updates to the documentation for this and previous releases on CustomerConnection. Through the Documentation section of Customer Connection, you can downloadfiles to add to your PeopleBook library. You'll find a variety of useful and timely materials,including updates to the full PeopleSoft documentation delivered on your PeopleBooks CD.Documentation on CD-ROMComplete documentation for this PeopleTools release is provided in HTML format on thePeopleTools PeopleBooks CD-ROM. The documentation for the PeopleSoft applications youhave purchased appears on a separate PeopleBooks CD for the product line.Hardcopy DocumentationTo order printed, bound volumes of the complete PeopleSoft documentation delivered on yourPeopleBooks CD-ROM, visit the PeopleSoft Press Web site from the Documentation section ofPeopleSoft Customer Connection. The PeopleSoft Press Web site is a joint venture betweenPeopleSoft and Consolidated Publications Incorporated (CPI), our book print vendor.We make printed documentation for each major release available shortly after the software is firstshipped. Customers and partners can order printed PeopleSoft documentation using any of thefollowing methods:InternetFrom the main PeopleSoft Internet site, go to theDocumentation section of Customer Connection. You canfind order information under the Ordering PeopleBookstopic. Use a Customer Connection ID, credit card, orpurchase order to place your order.PeopleSoft Internet site: http://www.peoplesoft.com/.TelephoneContact Consolidated Publishing Incorporated (CPI) at800 888 3559.EmailEmail CPI at callcenter@conpub.com.Typographical Conventions and Visual CuesTo help you locate and interpret information, we use a number of standard conventions in ouronline documentation.Please take a moment to review the following typographical cues:PREFACEviiiPEOPLESOFT PROPRIETARYANDCONFIDENTIAL

JANUARY 2001PEOPLETOOLS 8.12 COMPONENT INTERFACE PEOPLEBOOKmonospace fontIndicates PeopleCode.Indicates field names and other page elements, such asbuttons and group box labels, when these elements aredocumented below the page on which they appear. Whenwe refer to these elements elsewhere in thedocumentation, we set them in Normal style (not in bold).BoldWe also use boldface when we refer to navigational paths,menu names, or process actions (such as Save and Run).ItalicsIndicates a PeopleSoft or other book-length publication.We also use italics for emphasis and to indicate specificfield values. When we cite a field value under the page onwhich it appears, we use this style: field value.We also use italics when we refer to words as words orletters as letters, as in the following: Enter the number 0,not the letter O.KEY KEYIndicates a key combination action. For example, a plussign ( ) between keys means that you must hold down thefirst key while you press the second key. For ALT W,hold down the ALT key while you press W.Jump linksIndicates a jump (also called a link, hyperlink, orhypertext link). Click a jump to move to the jumpdestination or referenced section.Cross-referencesThe phrase For more information indicates where you canfind additional documentation on the topic at hand. Weinclude the navigational path to the referenced topic,separated by colons (:). Capitalized titles in italicsindicate the title of a PeopleBook; capitalized titles innormal font refer to sections and specific topics within thePeopleBook. Cross-references typically begin with ajump link. Here's an example:For more information, see Documentation on CD-ROM inAbout These PeopleBooks: Related Documentation. Topic listContains jump links to all the topics in the section. Notethat these correspond to the heading levels you'll find inthe Contents window.Name of Page orDialog BoxPEOPLESOFT PROPRIETARYANDCONFIDENTIALOpens a pop-up window that contains the named page ordialog box. Click the icon to display the image. Somescreen shots may also appear inline (directly in the text).PREFACEix

PEOPLETOOLS 8.12 COMPONENT INTERFACE PEOPLEBOOKJANUARY 2001Text in this bar indicates information that you should pay particular attention to as you workwith your PeopleSoft system. If the note is preceded by Important!, the note is crucial andincludes information that concerns what you need to do for the system to function properly.Text in this bar indicates For more information cross-references to related or additionalinformation.Text within this bar indicates a crucial configuration consideration. Pay very close attentionto these warning messages.Comments and SuggestionsYour comments are important to us. We encourage you to tell us what you like, or what youwould like changed about our documentation, PeopleBooks, and other PeopleSoft reference andtraining materials. Please send your suggestions to:PeopleTools Product Documentation ManagerPeopleSoft, Inc.4460 Hacienda DrivePleasanton, CA 94588Or send comments by email to the authors of the PeopleSoft documentation le we cannot guarantee to answer every email message, we will pay careful attention to yourcomments and suggestions. We are always improving our product communications for you.PREFACExPEOPLESOFT PROPRIETARYANDCONFIDENTIAL

CHAPTER 1Component InterfaceIntroductionEvery organization depends on real-world business objects—such as invoices and inventoryitems—to conduct its business. In PeopleSoft applications, components represent real-worldbusiness objects. For example, an invoice component is a way to capture, store, and display allthe essential information related to any given invoice—the general billing and shippinginformation, plus details about each line item.Components have keys that enable navigation to a specific instance of a business object, and alsoincludes the essential information that describes the object (the fields in the component).Additionally, a component includes an organization’s business rules associated with whatevertype of business object the component represents.While online, a user can view, enter, and manipulate data about a business object through the useof a component and its associated pages.A component interface is a PeopleTools object that you create in Application Designer. Itexposes a PeopleSoft component for synchronous access from another application. Externalapplications need not be concerned with the details of page structures and component definitionsin order to access the underlying data and business logic through component interfaces.PeopleSoft components can be accessed from the following applications: Microsoft’s Component Object Model (COM) C/C shared libraries Java PeopleCodeAn instance of a component interface refers to the object at runtime, populated with a singlegroup of data that describes a unique business object. In other words, a component interfacerefers to a type of business object, such as an invoice, while a component interface instance refersto a unique version of that business object, such as invoice number 945 versus invoice number946, and so on.PEOPLESOFT PROPRIETARYANDCONFIDENTIALCOMPONENT INTERFACE1-1

PEOPLETOOLS 8.12 COMPONENT INTERFACE PEOPLEBOOKJANUARY 2001Note: In most cases, component interfaces behave exactly the same as their onlinecounterparts (their associated components). This means that PeopleCode events typicallyfire in the same order as the online case, and so on. However, there are ComparingComponent Interface and Components to this behavior that relate both to PeopleCodeprocessing and search dialog processing.Component Interface ArchitectureThe overall component interface architecture includes more than just component interfacesthemselves. There are three fundamental elements to the overall component interfacearchitecture—components, component interfaces, and the component interface API.ElementsDescriptionComponentsOne or more pages performing a business transaction that acomponent interface is associated with.Component InterfaceExposed aspect of a component. However, unlike components,component interfaces are readily accessible by internal andexternal applications and multiple component interfaces canreference the same component.Component InterfaceAPIApplication programming interface for a Microsoft COM (VisualBasic) application.PeopleCodeThe following illustration shows the relationship of the basic elements of the component interfacearchitecture.PeopleSoft ApplicationComponentComponent InterfaceComponentSearch lds and ScrollsProperties andCollectionsExternal ApplicationCOM (VB)C/C Component Interface Architecture1-2COMPONENT INTERFACEPEOPLESOFT PROPRIETARYANDCONFIDENTIAL

JANUARY 2001PEOPLETOOLS 8.12 COMPONENT INTERFACE PEOPLEBOOKAttributes of a Component InterfaceEvery component interface has the following four main attributes: Component Interface Name Keys Properties and Collections MethodsComponent Interface NameAs with every other object in PeopleTools, component interfaces must have a name. Thecomponent interface name is used to access it, and should somehow identify the business objectthat it describes, such as LOCATION.The naming of component interfaces should be consistent and systematic. Also, the name shouldnot be changed once the component interface is part of a production system—other applicationsdepend on a consistent name with which to reference the component interface.If you are changing the structure of a component interface such that an existing program will nolonger be able to access it correctly, create a new component interface rather than updating theexisting one. There is no “version” property on a component interface, so if you need to create anew version of a delivered component interface, adhere to a standard naming guideline to avoidconfusion. A suggested naming guideline is as follows: LOCATION (original component interface) LOCATION V2 (version two of the component interface)KeysKeys define the values that uniquely identify an instance of a component interface. When youcreate a new component interface, component interface keys are created automatically based onthe associated component’s search record. However, you can add or change certain keys, ifdesired.A component interface can have three types of keys:Key TypeKey CharacteristicsGet KeysThese keys automatically map to fields marked as Srch in thecomponent’s search record. You need to change Get keys only if youmodify the keys of the underlying component after you’ve created acomponent interface.PEOPLESOFT PROPRIETARYANDCONFIDENTIALCOMPONENT INTERFACE1-3

PEOPLETOOLS 8.12 COMPONENT INTERFACE PEOPLEBOOKJANUARY 2001Key TypeKey CharacteristicsCreate KeysThese keys get created automatically if the Use tab on theComponent Properties dialog allows the Add action, then Createkeys are generated for the component interface automatically. If thecomponent has an Add mode search record, then the componentinterface uses that search record for the Create keys. Otherwise, thesearch record is used to generate the keys.Find KeysThese map to fields marked as both Alt and Srch in the componentsearch record. You may remove Find Keys that you do not wish tomake available for searching.Note. Application Designer automatically creates certain component interface keys based onhow some options are set in the component properties, in addition to some of the fieldoptions (Alt and Srch) referenced by the search record.Properties and CollectionsProperties are the individual data items (fields) that describe a component interface. Eachproperty maps to a single field in the component interface’s underlying component. A collectionis a type of property—which points to a scroll, instead of of mapping to an individual field, itpoints to a scroll.Note: The first item in a component interface collection is always referred to as item one,not item zero, which is consistent with other PeopleCode processing.There are two main types of properties: user-defined properties and Standard Properties.User-Defined PropertiesUser-defined properties come from a component interface’s associated component, and must beadded manually. They are the specific record fields that you choose to expose to an externalsystem with the component interface.Standard PropertiesStandard properties are common across all component interfaces and are assigned automaticallywhen a component interface is created. Standard properties also exist for each collection within acomponent interface. The following table lists the standard properties, including collection andDataRow types. The Application Designer does not display these properties.1-4COMPONENT INTERFACEPEOPLESOFT PROPRIETARYANDCONFIDENTIAL

JANUARY 2001PEOPLETOOLS 8.12 COMPONENT INTERFACE PEOPLEBOOKTypeNameWhat it does StandardCreateKeyInfoCollectionReturns a set of items that describes theCreate keys.GetKeyInfoCollectionReturns a set of items that describes theGet keys.FindKeyInfoCollectionReturns a set of items that describes theFind keys.PropertyInfoCollectionReturns a set of items that describesproperties.GetHistoryItemsControls whether the component interfaceruns in “Update/Display” mode or“Correction” mode. Applies only togetting a component interface, not tocreating a component interface.InteractiveModeControls whether to apply values and runbusiness rules immediately, or whetheritems are queued and business rules are runlater, in a single step. Interactive mode isrecommended for most cases where youuse a component interface to establish“real-time” integration with anotherinteractive application. However, if youare using a particular component interfaceas part of a batch process in whichthousands of rows are to be inserted,performance may be improved by notrunning in interactive mode.ComponentNameReturns the name of the component classas named in Application DesignerCollectionCountReturns the number of items in a collectionDataRowItemNumReturns the position of the row within thecollection of a DataRow.For more information on properties, including PropertyInfo properties and relatedPeopleCode, see Component Interface Classes in the PeopleCode Reference.Security for PropertiesIn Application Designer, you control access to user-defined properties by not including theproperty in the component definition or by making the property read-only. This is a globalPEOPLESOFT PROPRIETARYANDCONFIDENTIALCOMPONENT INTERFACE1-5

PEOPLETOOLS 8.12 COMPONENT INTERFACE PEOPLEBOOKJANUARY 2001setting, not related to any individual class or operator ID. PeopleSoft row-level security governswhich data values appear for a given property.For more information on setting up component interface security, see Setting ComponentInterface Security.Method

JANUARY 2001 PEOPLETOOLS 8.12 COMPONENT INTERFACE PEOPLEBOOK PEOPLESOFT PROPRIETARY AND CONFIDENTIAL PREFACE ix monospace font Indicates PeopleCode. Bold Indicates field names and other page elements, such as buttons and group box labels, when these elements are documented below the page on which they appear. When we refer to these elements elsewhere in the