The Component Interface

In this post, let's examine the methods, properties and collections of a component interface.

METHODS, PROPERTIES, COLLECTIONS
In addition to keys, a Component Interface is composed of properties, collections and methods .

PROPERTIES
Some properties can be seen and viewed through the application designer, however, there are other properties that cannot be seen in the application designer and yet can be modified through PeopleCode, Java, C++, or COM. These are known as Standard Properties.

The following is a list of the standard properties, for a more detailed list of the definitions and the interfaces for PeopleCode, Java, C++, and Visual Basic, see your PeopleBooks. (We’ll talk about the important ones later in Programming your CI.)

  • ComponentName
  • CreateKeyInfoCollection
  • Description
  • GetKeyInfoCollection
  • Market
  • FindKeyInfoCollection
  • GetDummyRows
  • GetHistoryItems
  • CompIntfcName
  • EditHistoryItems
  • PropertyInfoCollection
  • InteractiveMode
  • StopOnFirstError

I discussed earlier how Component Interfaces are accessible both from withinPeopleTools and outside through external programs. This means that the CI is programmable through a C interface, Java, XML, an OLE/COM or C/C++ interface, and through PeopleCode. Therefore, Application Engine programs, message notification programs, or any other PeopleCode programs are able to use Component Interfaces within PeopleTools.

User-Defined Properties
User-Defined properties on the component that are exposed through the component interface are derived from the component to which the component interface is associated and must be added manually.

If you recall, user-defined properties are specific record fields that you expose to an external system with the component interface and you create user-defined properties in addition to the standard properties to enable data manipulation of the component. When you create a new component interface, if you accept the default properties, user-defined properties are created automatically for each field displayed to the user on the underlying component.
These user-defined properties are the means that component interfaces use to add or change fields and data in the database.



Properties can be accessed through PeopleCode. We will talk more about this in the Programming the CI chapter.

Important Standard Properties
  • CreateKeyInfoCollection: Returns a set of items that describes the Create keys
  • GetKeyInfoCollection: Returns a set of items that describes the Get keys
  • FindKeyInfoCollection: Returns a set of items that describes the Find keys.
  • PropertyInfoCollection: Returns a set of items that describes properties
  • GetHistoryItems: Controls whether the Component Interface runs in Update/Display or Correction. Only applies to Getting and not creating a component interface.

COLLECTIONS
Many of the components/pages in PeopleSoft have grids and scroll area’s. A component interface collection is a special type of property that corresponds to a specific scroll within your component.
A Collection will therefore contain fields and subordinate scrolls as defined in its underlying component. By default, each collection uses the name of the primary record for the underlying scroll. It’s key to note that a collection is a property that points to a scroll, rather than a field, in the underlying component for a component interface. In addition, here are some other key points.

  • A collection groups multiple fields in a scroll
  • All the fields in the scroll are mapped to a property.
    These properties are part of the collection.

To create a collection, simply drag the scroll from the component view into the component interface view. The Collection will look like a cube similar to the following:


Here are some additional rules about creating collections.
When dragging a scroll into the component interface view, all child scrolls come with it.
  • When dragging a scroll into the component interface view, all record fields contained in that scroll come with it—not just those from the record that defines the scroll.
  • Keys that appear in parent and child scrolls are not added to child collections.|
  • When you drag a child scroll into the component interface view, parent collections are created automatically.
  • For example, if you drag just the level-two scroll from the component view into the component interface view, a level-zero collection and a level-one collection are created automatically in the component interface. This hierarchy of collections is necessary so that it’s possible to navigate to the child collection at runtime.


METHODS

A method is an object that performs a very specific function on a component interface at run-time. Each component Interface has a set of methods that can be used against the objects/properties in a programmatic way. This is how you can manipulate specific data, properties, and collections.

There are 2 types of methods; Standard and User Defined. However, before you can work with any methods you will need to programmatically connect to the Session. There are specific functions that can be used to accomplish this. The GetSession PeopleCode function and getCompIntfc method connects to a session on your Application server.

GetSession: Returns a session object
&session = %session;

Once you instantiate a session object you can use the getCompIntfc method to connect directly to the CI you want to use. We’ll talk about these in more detail when we get to programming our Component Interface.

By default, each component interface is created with four standard methods—Cancel, Find, Get, and Save. Methods are saved as part of a component interface definition.

Here is a list of standard methods

  • Cancel
  • Create
  • Find
  • Get
  • Save
  • GetPropertyByName
  • SetPropertyByName
  • GetPropertyInfoByName – CompIntfPropInfoCollection


The collection object also has a set of methods as listed below

  • Count
  • ItemByName
  • (not used in PeopleCode)
  • InsertItem(Index)
  • DeleteItem(Index)
  • Item(Index)
  • ItemByKeys(keys)
  • CurrentItem
  • CurrentItemNum
  • (CurrentItemNumber)
  • GetEffectiveItem(DateString, SeqNum)
  • GetEffectiveItemNum(DateString, SeqNum)


No comments:

Post a Comment