Developing Component Interfaces

This chapter discusses how to:

Click to jump to parent topicCreating Component Interface Definitions

This section discusses how to:

Click to jump to top of pageClick to jump to parent topicUnderstanding Creating Component Interface Definitions

This section discusses key concepts for creating component interface definitions.

Component Structure

Because each component interface refers to a single component, you must know the structure of the component for which you are constructing a component interface. You can use an existing component within an application or create a new one for the sole purpose of constructing a component interface. Many parts of the component interface, such as the keys, are created based on settings in the referenced component.

Criteria for Setting Automatic Default Properties

To be able to set automatic defaults for fields in the new component interface, the system needs the properties to be of a specific field or page control type.

The fields should be of the following types:

The field should be one of the following page control types:

The field cannot be invisible and should not be the same as the key field of the immediate parent.

Collections must have at least one child property that satisfies the field or page control criteria for providing the field by default. Collections with no properties are not added.

For a field on a secondary page to be selected for the default properties process, it must satisfy all the criteria for field type and page control and must be at the same level as the host page.

Additionally, the component tree that a component interface uses to order the properties lists the fields in the record based on their order in the record definition and not the order of the fields on the page. If the component tree lists the fields of a record based on the page, the properties of the component interface will reflect that order.

Click to jump to top of pageClick to jump to parent topicCreating New Component Interfaces

This section discusses how to create a new component interface.

To create a new component interface:

  1. Select File, New from the PeopleSoft Application Designer menu.

  2. Select Component Interface from the New dialog box.

  3. Select the component on which to base this component interface.

    After you select the appropriate component, you see a message asking whether you want the fields that are exposed in the selected component to become the default properties of the component interface.

    Note. Not all fields on the component interface can have automatic defaults created for them.

  4. Click Yes to confirm the default property definitions or No if you don’t want any properties initially created.

    If you elect to have the property definitions automatically provided by the system by default, then all properties that appear on the pages of the underlying component are added to the component interface. Even though the system adds the default properties, you may need to move other properties into the component view for the component to work.

    An untitled component interface appears, showing the Get keys and Find keys. Create keys are produced only if the underlying component can run in Add mode (the example preceding this procedure does not have Create keys, because the search record of the underlying component cannot run in Add mode). PeopleSoft Application Designer generates the keys for you as you drag definitions.

    The standard methods Cancel, Find, Get, and Save are automatically created. The Create method is not automatically created unless the component supports the Add mode.

    Note. You can begin adding properties to a new component interface at any point. However, you cannot add any user-defined methods to the component interface until you have saved the component interface.

  5. Save the component interface.

    After you have saved the component interface, you can further define user-defined methods.

Click to jump to top of pageClick to jump to parent topicNaming Component Interface Definitions

Like every other definition in PeopleTools, component interfaces must have unique names. The naming of component interfaces should be consistent and systematic. Also, the name should not be changed after the component interface is part of a production system—other applications depend 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 can no longer access it correctly, create a new component interface rather than updating the existing one. No version property is on a component interface, so if you must create a new version of a delivered component interface, adhere to a standard naming guideline to avoid confusion. A suggested naming guideline is:

Click to jump to top of pageClick to jump to parent topicAssociating Component Interfaces with Menus

This applies to component interfaces built from components that are already attached to one or more menus.

To associate a component interface with a menu:

  1. Select File, Open from the PeopleSoft Application Designer menu to open an existing component interface.

  2. Select File, Definition Properties from the PeopleSoft Application Designer menu.

    The Definition Properties dialog box appears.

  3. Select the appropriate menu name on the General tab for this component interface.

    Note. Associate a menu with a component interface only when PeopleCode is in the component that uses the %Menu system variable.

Click to jump to top of pageClick to jump to parent topicDetermining the Fields to Expose in Component Interfaces

You expose fields from a component in the component interface by dragging a record field or a scroll from the component view into the component interface view. However, some forethought is required before exposing a component as a component interface. You need to have a thorough understanding of the underlying component so that you expose fields that are required in the external system. For example, if the component has a field called SSN, you need to be sure that the SSN field is required before exposing it to the external system. Expose only those properties that are necessary.

The component view displays fields that are available in the component buffer at runtime. For example, if a record containing 10 fields has only 3 fields included on a page, then the component view will list only those 3 fields.

The first time that you drag a scroll from the component view to the component interface view, the system uses the following rules to determine what properties to expose:

Click to jump to parent topicUsing Keys

This section discusses how to add and delete keys.

Click to jump to top of pageClick to jump to parent topicUnderstanding Keys

The following table shows the three types of component interface keys:

Key Type

Key Characteristics

Get keys

These keys automatically map to search key fields in the search record for the underlying component. You must change Get keys only if you modify the keys of the component after you create a component interface.

Find keys

These map to both search key fields and alternate search key fields in the search record for the underlying component. You can remove any Find keys based on alternate search key fields that you don’t want to make available for searching.

Create keys

If the underlying component allows the Add action, then Create keys are generated for the component interface automatically. They map to fields marked as Srch (search) in the search record for the component (or the add search record, if one is specified).

Keys are created automatically when you create a component interface. Typically, you must manually add keys only if new search key fields are added to the underlying component after the creation of the component interface. However, you might want to modify the Find keys—either to restrict a user from searching on a particular key or to add an alternate search key that didn’t exist when the component was created.

Component interface keys are based only on the search key fields and alternate search key fields that are designated as list box items in the search record of the underlying component. When you create the component interface, the keys are automatically generated from all key fields that qualify.

Valid Conditions for Modifying Keys

The following conditions are valid for modifying keys.

Note. An X icon precedes a name in the component interface view if the field underlying a component interface key no longer qualifies as a key. Remove keys (or any other properties) that are marked with this symbol to ensure proper operation of the component interface.

Click to jump to top of pageClick to jump to parent topicAdding and Deleting Keys

To add a key:

  1. Expand the search key collection (the first collection) in the component view.

  2. Drag the key to the component interface view.

To delete a key:

  1. Select the key in the component interface view.

  2. Press the Del key.

Click to jump to parent topicSetting Properties

This section provides an overview of standard properties and discusses how to:

Click to jump to top of pageClick to jump to parent topicUnderstanding Standard Properties

Standard properties do not appear in the component interface view in PeopleSoft Application Designer. The following tables name and define the standard properties, and list the interfaces for PeopleCode, Java, C++, and Visual Basic.

This table contains the component interface properties:

Name

Description, Programming Syntax

CreateKeyInfoCollection

Returns a collection of items that describes the Create keys. This property is read-only.

Use these interfaces to call with other programming languages.

  • Java: IcompIntfcPropertyInfoCollection getCreateKeyInfoCollection()

  • C++: HPSAPI_COMPINTFCPROPERTYINFOCOLLECTION <CI_NAME>_GetCreateKeyInfoCollection(HPSAPI_<CI_NAME>)

  • COM: CompIntfcPropertyInfoCollection CreateKeyInfoCollection

GetKeyInfoCollection

Returns a collection of items that describes the Get keys. This property is read-only.

Use these interfaces to call with other programming languages.

  • Java: IcompIntfcPropertyInfoCollection getGetKeyInfoCollection()

  • C++: HPSAPI_COMPINTFCPROPERTYINFOCOLLECTION <CI_NAME>_GetGetKeyInfoCollection(HPSAPI_<CI_NAME>)

  • COM: CompIntfcPropertyInfoCollection GetKeyInfoCollection

FindKeyInfoCollection

Returns a collection of items that describes the Find keys. This property is read-only.

Use these interfaces to call with other programming languages.

  • Java: IcompIntfcPropertyInfoCollection getFindKeyInfoCollection()

  • C++: HPSAPI_COMPINTFCPROPERTYINFOCOLLECTION <CI_NAME>_GetFindKeyInfoCollection(HPSAPI_<CI_NAME>)

  • COM: CompIntfcPropertyInfoCollection FindKeyInfoCollection

GetHistoryItems

Controls whether the component interface runs in Update/Display mode or Correction mode when the underlying component is effective-dated. If GetHistory is set to true, then historical data can be retrieved but not modified. GetHistory items work in accordance with EditHistory items.

The default value is False. This property is read-only.

Use these interfaces to call with other programming languages.

  • Java: boolean getGetHistoryItems(), void setGetHistoryItems(boolean)

  • C++: BOOL <CI_NAME>_GetGetHistoryItems(HPSAPI_<CI_NAME>), void <CI_NAME>_SetGetHistoryItems(HPSAPI_<CI_NAME>, BOOL)

  • COM: Boolean GetHistoryItems

EditHistoryItems

Controls whether the component interface runs in Update/Display All mode, Update/Display mode, or Correction mode when the underlying component is effective-dated. If EditHistory items are set to true, then historical data can be modified. EditHistory items work in accordance with GetHistory items.

The default value is False. This property is read-only.

Use these interfaces to call with other programming languages.

  • Java: boolean getEditHistoryItems(), void setEditHistoryItems(boolean)

  • C++: BOOL <CI_NAME>_GetEditHistoryItems(HPSAPI_<CI_NAME>), void <CI_NAME>_SetEditHistoryItems(HPSAPI_<CI_NAME >, BOOL)

  • COM: Boolean EditHistoryItems

InteractiveMode

Controls whether to apply values and run business rules immediately, or whether items are queued and business rules are run later, in a single step.

Note. You should use interactive mode when testing and debugging a component interface. Interactive mode in a production environment slows performance because of the number of server trips required.

If you are using a component interface as part of a batch process in which thousands of rows are to be inserted, running in interactive mode may reduce performance so much on some UNIX servers that the application times out with a connection failure.

The default value is False. This property is read-only.

Use these interfaces to call with other programming languages.

  • Java: boolean getInteractiveMode(), void setInteractiveMode(boolean)

  • C++: BOOL <CI_NAME>_GetInteractiveMode(HPSAPI_<CI_NAME>), void <CI_NAME>_SetInteractiveMode(HPSAPI_<CI_NAME>, BOOL )

  • COM: Boolean InteractiveMode

StopOnFirstError

When this property is set to True, the first error generated by the component interface halts the program.

The default value is False. This property is read-only.

  • Java: boolean getStopOnFirstError(), setStopOnFirstError(boolean)

  • C++: BOOL <CI_NAME>_GetStopOnFirstError(HPSAPI_<CI_NAME>), void <CI_NAME>_SetStopOnFirstError(HPSAPI_<CI_NAME>, BOOL)

  • COM: Boolean StopOnFirstError

CompIntfcName

Returns the name of the component interface class as named in PeopleSoft Application Designer. This property is read-only.

  • Java: String getCompIntfcName()

  • C++: LPTSTR <CI_NAME>_GetCompIntfcName((HPSAPI_<CI_NAME>)

  • COM: String GetCompIntfcName

ComponentName

Returns the name of the component interface class as named in PeopleSoft Application Designer. This property is read-only.

  • Java: boolean getComponentName()

  • C++: LPTSTR <CI_NAME>_GetComponentName(HPSAPI_<CI_NAME>)

  • COM: Boolean GetComponentName

Description

Returns the description of the component interface class as set in PeopleSoft Application Designer. This property is read-only.

  • Java: boolean getDescription()

  • C++: LPTSTR <CI_NAME>_GetDescription((HPSAPI_<CI_NAME>)

  • COM: String Description

Market

Returns the Market setting of the component used to build this component interface. This property is read-only.

  • Java: String getMarket()

  • C++: LPTSTR <CI_NAME>_GetMarket((HPSAPI_<CI_NAME>)

  • COM: String Market

GetDummyRows

When a new scroll is inserted on a page, that scroll is displayed even though it has no underlying data. Any scroll that is empty has one dummy row displayed with only the defaults set. This property is True if the dummy row is to be displayed, False if it is not. The default value for this property is True. This property is read-write.

  • Java: boolean getGetDummyRows(), void setGetDummyRows(boolean)

  • C++: BOOL <CI_NAME>_GetGetDummyRows(HPSAPI_<CI_NAME>), void <CI_NAME>_SetGetDummyRows(HPSAPI_<CI_NAME>, BOOL)

  • COM: Boolean GetDummyRows

PropertyInfoCollection

Returns a collection of items that describes a specific property. The specific properties that are available in the propertyinfocollection are listed here. This property is read-only.

Use these interfaces to call with other programming languages.

  • Java: IcompIntfcPropertyInfoCollection getPropertyInfoCollection()

  • C++: HPSAPI_COMPINTFCPROPERTYINFOCOLLECTION <CI_NAME>_GetPropertyInfoCollection(HPSAPI_<CI_NAME>)

  • COM: CompIntfcPropertyInfoCollection PropertyInfoCollection

The CompIntfPropInfoCollection object supports the following properties:

PropertyName

Description

Name

This property returns the name of the object executing the property as a string. This property is read-only.

  • Java: String getName()

  • C++: LPTSTR CompIntfcPropertyInfo_GetName(HPSAPI_COMPINTFCPROPERTYINFO)

  • COM: String name

RecordName

This property returns the record name associated with the object executing the property. This property is read-only.

  • Java: String getRecordName()

  • C++: LPTSTR CompIntfcPropertyInfo_GetRecordName(HPSAPI_COMPINTFCPROPERTYINFO)

  • COM: String RecordName

FieldName

This property returns the field name associated with the object executing the property. This property is read-only.

  • Java: String getFieldName()

  • C++: LPTSTR CompIntfcPropertyInfo_GetFieldName(HPSAPI_COMPINTFCPROPERTYINFO \)

  • COM: String FieldName

LabelLong

This property returns the record field Long Name value as a string. If a component override exists for this value, it is not included. This property is read-only.

  • Java: String getLabelLong()

  • C++: LPTSTR CompIntfcPropertyInfo_GetLabelLong(HPSAPI_COMPINTFCPROPERTYINFO)

  • COM: String LabelLong

LabelShort

This property returns the record field ShortName value as a string. If a component override exists for this value, it is not included. This property is read-only.

  • Java: String getLabelShort()

  • C++: LPTSTR CompIntfcPropertyInfo_GetLabelShort(HPSAPI_COMPINTFCPROPERTYINFO)

  • COM: String LabelShort

IsCollection

This property returns True if the object executing the property is a data collection, False otherwise. If IsCollection is True, other field-oriented properties like Required, Type, Xlat, YesNo, Prompt, and Format are undefined. If IsCollection is False, the object represents a field and all the previous properties are defined as described. This property is read-only.

  • Java: boolean getIsCollection()

  • C++: BOOL CompIntfcPropertyInfo_GetIsCollection(HPSAPI_COMPINTFCPROPERTYINFO)

  • COM: Boolean IsCollection

Type

This property returns the field type, as a number, of the object.

See CompIntfPropInfoCollection Object Properties.

This property is read-only.

  • Java: long getType()

  • C++: PSI32 CompIntfcPropertyInfo_GetType(HPSAPI_COMPINTFCPROPERTYINFO)

  • COM: Long Type

OAType

This property returns the field type, as a number, of the object. This property is read-only.

  • Java: long getOAType()

  • C++: PSI32 CompIntfcPropertyInfo_GetOAType(HPSAPI_COMPINTFCPROPERTYINFO)

  • COM: Long OAType

Format

This property returns the field format for the object executing the property (that is, name, phone, zip, SSN, and so on) as a number. This property is read-only.

See CompIntfPropInfoCollection Object Properties.

  • Java: String getFormat()

  • C++: PSI32 CompIntfcPropertyInfo_GetFormat(HPSAPI_COMPINTFCPROPERTYINFO)

  • COM: Long Format

Key

This property returns True if the object executing the property is a key, False otherwise. This property is read-only.

  • Java: boolean getKey()

  • C++: BOOL CompIntfcPropertyInfo_GetKey(HPSAPI_COMPINTFCPROPERTYINFO hCompIntfcPropertyInfo)

  • COM: Boolean Key

Required

This property returns True if the object executing the property is a required property, False otherwise. This property is read-only.

  • Java: boolean getRequired()

  • C++: BOOL CompIntfcPropertyInfo_GetRequired(HPSAPI_COMPINTFCPROPERTYINFO)

  • COM: Boolean Required

Xlat

This property returns True if the object executing the property is associated with an XLAT table, False otherwise. This property is read-only.

  • Java: String getXlat()

  • C++: BOOL CompIntfcPropertyInfo_GetXlat(HPSAPI_COMPINTFCPROPERTYINFO)

  • COM: String Xlat

Yesno

This property returns True if the object executing the property is associated with the Yes/No table, False otherwise. This property is read-only.

  • Java: boolean getYesno()

  • C++: BOOL CompIntfcPropertyInfo_GetYesno(HPSAPI_COMPINTFCPROPERTYINFO)

  • COM: Boolean Yesno

Prompt

This property returns True if the object executing the property is associated with a prompt table, False otherwise. This property is read-only.

  • Java: boolean getPrompt()

  • C++: BOOL CompIntfcPropertyInfo_GetPrompt(HPSAPI_COMPINTFCPROPERTYINFO)

  • COM: Boolean Prompt

Length

This property returns the length of the object executing the property. This property is read-only.

  • Java: long getLength()

  • C++: PSI32 CompIntfcPropertyInfo_GetLength(HPSAPI_COMPINTFCPROPERTYINFO)

  • COM: Long Length

DecimalPosition

This property returns the decimal position for the object executing the property. This property is read-only.

  • Java: long getDecimalPosition()

  • C++: PSI32 CompIntfcPropertyInfo_GetDecimalPosition(HPSAPI_COMPINTFCPROPERTYINFO)

  • COM: Long DecimalPosition

IsReadOnly

This property returns True if the property marked read-only in the component interface definition; False otherwise. This property is read-only.

  • Java: boolean getIsReadOnly()

  • C++: BOOL CompIntfcPropertyInfo_GetIsReadOnly(HPSAPI_COMPINTFCPROPERTYINFO)

  • COM: Boolean IsReadOnly

Altkey

This property returns True if the object executing the property is an alternate key, False otherwise. This property is read-only.

  • Java: boolean getAltkey()

  • C++: BOOL CompIntfcPropertyInfo_GetAltkey(HPSAPI_COMPINTFCPROPERTYINFO)

  • COM: Boolean Altkey

Listboxitem

This property returns True if the object executing the property is associated with a list box, False otherwise. This property is read-only.

  • Java: boolean getListboxitem()

  • C++: BOOL CompIntfcPropertyInfo_GetListboxitem(HPSAPI_COMPINTFCPROPERTYINFO)

  • COM: Boolean Listboxitem

Example of PropertyInfoCollection

Here is a Java example that calls PropertyInfoCollection:

IcompIntfcPropertyInfoCollection oLO_PropInfoColl IcompIntfcPropertyInfo oLO_PropInfoItem oLO_PropInfoColl = oCI.getPropertyInfoCollection(); for (int I=0; I < oLO_PropInfoColl.getCount(); I++) { oLO_PropInfoItem = oLO_PropInfoColl.item(i); System.out.println("\t Name = " + oLO_PropInfoColl.getName()); System.out.println("\t Record Name = " + oLO_PropInfoColl.getRecordName()); System.out.println("\t Field Name = " + oLO_PropInfoColl.getFieldName()); System.out.println("\t Label Long = " + oLO_PropInfoColl.getLabelLong()); System.out.println("\t Label Short = " + oLO_PropInfoColl.getLabelShort()); System.out.println("\t IsCollection = " + oLO_PropInfoColl.getIsCollection()); System.out.println("\t Type = " + oLO_PropInfoColl.getType()); System.out.println("\t OAType = " + oLO_PropInfoColl.getOAType()); System.out.println("\t Format = " + oLO_PropInfoColl.getFormat()); System.out.println("\t Is Get Key? = " + oLO_PropInfoColl.getKey()); System.out.println("\t Is Required = " + oLO_PropInfoColl.getRequired()); System.out.println("\t Is Xlat? = " + oLO_PropInfoColl.getXlat()); System.out.println("\t Is Yesno? = " + oLO_PropInfoColl.getYesno()); System.out.println("\t Prompt = " + oLO_PropInfoColl.getPrompt()); System.out.println("\t Length = " + oLO_PropInfoColl.getLength()); System.out.println("\t DecimalPosition = " + oLO_PropInfoColl. getDecimalPosition()); System.out.println("\t Is Read Only? = " + oLO_PropInfoColl. getIsReadOnly()); System.out.println("\t Is Alt Key? = " + oLO_PropInfoColl.getAltkey()); System.out.println("\t Is ListBox item? = " + oLO_PropInfoColl. getListboxitem());

Object Adapter

The name of the property is OAType, and it holds the value of the object adapter type. Exposing this property and supplying the associated methods enables you to detect possible data type mismatches between the database and the component interface object.

The Java methods are:

getOAType()

Returns the object adapter type.

getType()

Returns the type of the property of a particular database field.

For example:

public static void printPropertyType(String propName, ICompIntfcPropertyInfo i⇒ PropertyInfo) { String strOAType = null; String strDBType = null; try { switch ((int)iPropertyInfo.getOAType()) { /* Object Adapter Type == 0 */ case CIPropertyTypes.PSPROPERTY_OA_TYPE_BOOL: strOAType = "BOOL"; break; /* Object Adapter Type == 1 */ case CIPropertyTypes.PSPROPERTY_OA_TYPE_NUMBER: strOAType = "INTEGER"; break; /* Object Adapter Type == 2 */ case CIPropertyTypes.PSPROPERTY_OA_TYPE_FLOAT: strOAType = "FLOAT"; break; /* Object Adapter Type == 3 */ case CIPropertyTypes.PSPROPERTY_OA_TYPE_STRING: strOAType = "STRING"; break; } switch ((int)iPropertyInfo.getType()) { /* Database Type == 0 */ case CIPropertyTypes.PSPROPERTY_DB_TYPE_CHARACTER: strDBType = "CHARACTER"; break; /* Database Type == 1 */ case CIPropertyTypes.PSPROPERTY_DB_TYPE_LONG_CHARACTER: strDBType = "LONG_CHARACTER"; break; /* Database Type == 2 */ case CIPropertyTypes.PSPROPERTY_DB_TYPE_NUMBER: strDBType = "NUMBER"; break; /* Database Type == 3 */ case CIPropertyTypes.PSPROPERTY_DB_TYPE_SIGNED_NUMBER: strDBType = "SIGNED NUMBER"; break; /* Database Type == 4 */ case CIPropertyTypes.PSPROPERTY_DB_TYPE_DATE: strDBType = "DATE"; break; /* Database Type == 5 */ case CIPropertyTypes.PSPROPERTY_DB_TYPE_TIME: strDBType = "TIME"; break; /* Database Type == 6 */ case CIPropertyTypes.PSPROPERTY_DB_TYPE_DATETIME: strDBType = "DATETIME"; break; } } catch (Exception e) { e.printStackTrace(); } System.out.println("\n" + propName + " Object Adapter Type is: " + strOAType + ", Database Type is: " + strDBType); }

Component Interface Collection Property

This table contains the component interface collection property Count.

Name

Description, Programming Syntax

Count

Returns the number of items in a collection.

  • Java: long getCount()

  • C++: PSI32 CompIntfcCollection_GetCount(HPSAPI_<CI_NAME>)

  • COM: Integer Count

Data Item Property

This table contains the data item property ItemNum:

Name

Description, Programming Syntax

ItemNum

Returns the position of the row within the given collection of a DataRow.

  • Java: long getItemNum()

  • C++: PSI32 <CI_NAME>_GetItemNum(HPSAPI_<CI_NAME>)

  • COM: Integer ItemNum

Note. The component interface classes contain information about PropertyInfo properties and related PeopleCode.

Click to jump to top of pageClick to jump to parent topicCreating User-Defined Properties

User-defined properties are those properties on the underlying component that are exposed through the component interface. User-defined properties are derived from the component to which the component interface is associated and must be added manually. They are the specific record fields that you expose to an external system with the component interface. 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.

User-defined properties are the points where the component and the underlying database are exposed to the external system. This is the means that component interfaces use to add or change fields and data in the database.

To create a user-defined property, drag a record, field, or scroll from the component view to the component interface view.

Where you insert the definition in the component interface view does not matter. When the component interface is opened, the system automatically converts the field or record into a component interface property and places it in the appropriate place in the list of properties. Also, when you drag a definition from the component view into the component interface view, all child definitions are brought into the component interface automatically. After these child properties are added to the component interface, you can remove each property individually, if desired.

Dragging a key from the search records, which precede the level-zero record in the page view, adds a key to all appropriate key collections (Get, Create, and Find) in the component interface. Because appropriate keys are added automatically when a component interface is first created, you typically must add keys only if the new keys are added to the underlying component after the creation of the component interface.

Click to jump to top of pageClick to jump to parent topicDeleting User-Defined Properties

To delete a property:

  1. Select the property to be deleted.

  2. Either press the Del key on the keyboard, or right-click the key and select Delete.

    Standard Windows behavior is employed for selecting multiple properties using the Shift and Ctrl keys.

Click to jump to top of pageClick to jump to parent topicRenaming User-Defined Properties

Property names are automatically generated according to the corresponding fields from the component. If these names are cryptic, you might want to rename these properties to explain them better. Renaming a property does not change the field that the property references.

Important! PeopleSoft Mobile Agent is a deprecated product. The options listed in the Mobile Property Persistence group box of the Edit Property dialog box exist for backward compatibility only.

 

To rename a property:

  1. Double-click the property name or right-click the property name and select Edit Name from the menu.

  2. Enter the new property name.

    Programs accessing this component interface must reference the new property name. For example, if SDK_NAME was changed to NAME, programs must use NAME instead of SDK_NAME.

  3. Add any comments that might be helpful.

  4. Select the Read-Only check box to make this property read-only.

  5. If this property is for a mobile application, select a radio button that sets the persistence of the property.

Note. PeopleSoft Application Designer generates an error message if it detects that a component interface has properties that resolve to the same name when creating, saving, or opening a given component interface.

For example, NAME1 and NAME_1 both resolve to the same name when PeopleSoft APIs are built. The set and get functions that are generated for the properties RTE_CNTL_TYPE1 and RTE_CNTL_TYPE_1 are:

public String getRteCntlType1()

public void setRteCntlType1(String inRteCntlType1)

This results in a compile error. To fix this condition, name the properties so that they do not resolve to the same name.

Click to jump to top of pageClick to jump to parent topicCreating Reference Properties

Each component interface is isolated and unaware of the other component interfaces in the system. To access and update information from other component interfaces, references establish relationships between component interfaces.

Create a reference property in one component interface to access data exposed in another component interface. For example, the Customer object and the component interface exposing its properties include properties such as the customer’s name, address, and telephone numbers. Another object, Contact, includes data associated with all contacts in the system. The link between a specific customer and its associated contacts is owned by the Contact record, not the Customer record.

Therefore, to access contact data, the Customer component interface needs a reference property referring to the Contact component interface. For you to update contact data from the Customer component interface, the reference must include a valid reference path and reference backpointer to the customer ID.

Access the Create Reference dialog box by right-clicking the property and selecting Create Reference.

The Create Reference dialog box has the following fields:

Name

Describes the name of the reference you are creating.

Related Component Interface

Designates the component interface referenced from the current component interface.

Comments

Enter any comments to track the reference.

Related Key Mapping

Maps the property from the related component interface to the selected component interface property.

Valid Reference Path

Supports dynamic enumeration of the objects that can be selected as the value of the reference property being defined. This effectively filters these values so that you can select only objects that support the defined reference.

Because references use the concept of a walkpath to go from level zero of one component interface to level zero of another component interface, and then “walk” down to the lower levels of the component interface, only the level zero references are displayed in the Valid Reference Path drop-down list of a reference definition.

Reference Backpointer

Refers to the path back to the original component interface.

Click to jump to top of pageClick to jump to parent topicMaking Properties Read-Only

You can make any property read-only. At runtime, the value of a read-only property can be read but not updated.

To make a property read-only:

  1. Select the property.

  2. Select Edit, Toggle Read Only Access from the PeopleSoft Application Designer menu.

    A Y appears in the Read Only column of the component interface view corresponding to each property that you selected to be read-only.

Note. You can double-click the icon of any existing user-defined property to edit its name or comment or to toggle read-only access.

Click to jump to parent topicWorking with Collections

A collection is a property that points to a scroll, rather than a field, in the underlying component for a component interface. 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.

You create collections the same way you create properties—drag the scroll from the component view into the component interface view. Consider these points when creating collections:

Click to jump to parent topicWorking with Methods

This section provides and overview of session functions and methods, standard methods and collection methods. This section also discuses how to:

Click to jump to top of pageClick to jump to parent topicUnderstanding Session Functions and Methods

The session functions and methods connect to a session on an Application server. This connection must be made before you can use the component interface methods.

Component Interface Session Functions

This table contains the component interface session function createSession:

Name

Description, Programming Syntax

createSession

(In PeopleCode, &session = %session)

Returns a session object.

  • Java: ISession API.createSession()

  • C++: HPSAPI_SESSION PSApiCreateSession()

  • COM: PeopleSoft_PeopleSoft.Session CreateObject("PeopleSoft.Session")

Component Interface Session Methods

This table contains the component interface session methods:

Name

Description, Programming Syntax

Connect

(not used in PeopleCode)

Connects to the application server.

Use these interfaces to call with other programming languages.

  • Java: boolean connect(long apiVersion, string server, string username, string password, byte[ ] ExternalAuth)

  • C++: Bool session_Connect(HPSAPI hSession, PSI32 ApiVersion, LPTSTR server, LPSTR username, LPTSTR password, PSAPIVAPBLOB ExternalAuth)

  • COM: connect(apiVersion As Long, server As string, username As string, password As String, externalAuth As Integer) As Boolean

getCompIntfc

Returns a reference to a component interface. getCompIntfc also checks to determine whether the given user that is connecting has the appropriate security to access the component interface.

Use these interfaces to call with other programming languages.

  • Java: I<CI_Name> getCompIntfc(string ciName)

  • C++: HPSAPI_<CI_Name> Session_GetCompIntfc(HPSAPI_SESSION hsession, LPTSTR ciName)

  • COM: <CI_Name> GetCompIntfc(ciName As String)

Click to jump to top of pageClick to jump to parent topicUnderstanding Standard Methods

A method is a definition that performs a specific function on a component interface at runtime. Each standard method is added by default when the component interface is created and is available in PeopleCode and other programming languages. Like properties, methods are saved as part of a component interface definition. Two main types of methods are available: standard methods and user-defined methods.

Standard Methods

Description, Programming Syntax

Cancel

Backs out of the current component interface, canceling any changes made since the last save. This is equivalent to clicking the Return to Search button online. Returns True on success, and False on failure.

Use these interfaces to call with other programming languages.

  • Java: boolean cancel()

  • C++: BOOL <CI_NAME>_Cancel(HPSAPI_<CI_NAME> hObj)

  • COM: Function Cancel() As Boolean

Create

Creates a new instance of a component interface. This is equivalent to creating a new record in Add mode online. Returns True on success, and False on failure.

Use these interfaces to call with other programming languages.

  • Java: boolean create()

  • C++: BOOL <CI_NAME>_Create(HPSAPI_<CI_NAME> hObj)

  • COM: Function Create() As Boolean

Find

Performs a partial key search for a particular instance of a component interface, using the search keys at level 0. Returns a collection of component interface instances which match the search criteria. If no component interface instances match the search criteria, the count on the collection is zero.

Use these interfaces to call with other programming languages.

  • Java: <CI_NAME>Collection find()

  • C++: HPSAPI_<CI_NAME>COLLECTION <CI_NAME>_Find(HPSAPI_<CI_NAME> hObj)

  • COM: Function Find() As <CI_NAME>Collection

Get

Retrieves a particular instance of a component interface. This is equivalent to opening a record in Update/Display or Correction mode when online with a PeopleSoft application. Returns True on success, and False on failure.

Use these interfaces to call with other programming languages.

  • Java: boolean get()

  • C++: BOOL <CI_NAME>_Save(HPSAPI_<CI_NAME> hObj)

  • COM: Function Get() As Boolean

Save

Saves an instance of a component interface. This is equivalent to clicking the Save button in the online system. Returns True on success, and False on failure. You should cancel after a save.

Use these interfaces to call with other programming languages.

  • Java: boolean save()

  • C++: BOOL <CI_NAME>_Save(HPSAPI_<CI_NAME> hObj)

  • COM: Function Save() As Boolean

GetPropertyByName

Returns the value of a property that is specified by name. This function typically is used only in applications that cannot get the names of the component interface properties until runtime.

Use these interfaces to call with other programming languages.

  • Java: Object getPropertyByName(String str)

  • C++: HPSAPI_OBJECT <CiCollectionItem>_GetPropertyByName(HPSAPI_<CI_COLLECTION_ITEM> hColItem, LPTSTR Name)

  • COM: Function GetPropertyByName(name As String)

SetPropertyByName

Sets the value of a property that is specified by name. This function typically is used only in applications that cannot set the names of the component interface properties until runtime.

Use these interfaces to call with other programming languages.

  • Java: long setPropertyByName(String str, Object o)

  • C++: PSI32 <CiCollectionItem>_SetPropertyByName(HPSAPI_<CI_ COLLECTION_ITEM> hColItem, LPTSTR name, HPSAPI_OBJECT Value)

  • COM: Function SetPropertyByName(name As String, value) As Long

GetPropertyInfoByName

(In PeopleCode, CompIntfPropInfoCollection)

Returns specific information, such as length, about the definition of a property that is specified by name. This function typically is used only in applications that cannot get the names of component interface properties until runtime or by applications that need to provide a dynamic list of values that would normally be found in prompt tables.

Use these interfaces to call with other programming languages.

  • Java: IcompIntfcPropertyInfo getPropertyInfoByName(String name)

  • C++: HPSAPI_COMPINTFCPROPERTYINFO<CiPropOrItem>_GetPropertyInfoByName(HPSAPI_<CIPROPORITEM> hPropOrItem, LPTSTR name)

    where CiPropOrItem is the name of either a property or an item in a collection.

  • COM: Function GetPropertyInfoByName(name As String) As CompIntfcPropertyInfo

    See CompIntfPropInfoCollection Object Properties.

By default, each component interface is created with four standard methods—Cancel, Find, Get, and Save. Additionally, the Create standard method is generated if Create keys have been added to the component interface.

Example for GetPropertyInfoByName

The GetPropertyInfoByName method returns an object containing the property information. Here is a Java example that calls GetPropertyInfoByName:

IcompIntfcPropertyInfo oCompIntfcPropertyInfo oCompIntfcPropertyInfo = oCI.getPropertyInfoByName(tempName); System.out.println(oCompIntfcPropertyInfo.getName()); if (!oCompIntfcPropertyInfo.getIsCollection()) { System.out.println("\t Format = " + oCompIntfcPropertyInfo.getFormat()); System.out.println("\t Type = " + oCompIntfcPropertyInfo.getType()); } System.out.println("\t Is Required = " + oCompIntfcPropertyInfo. getRequired()); System.out.println("\t Is Collection? = " + oCompIntfcPropertyInfo. getIsCollection ()); System.out.println("\t Is Read Only? = " + oCompIntfcPropertyInfo. getIsReadOnly()); System.out.println("\t Is Get Key? = " + oCompIntfcPropertyInfo.getKey()); System.out.println("\t Label Long = " + oCompIntfcPropertyInfo. getLabelLong()); System.out.println("\t Label Short = " + oCompIntfcPropertyInfo. getLabelShort()); System.out.println("\t Length = " + oCompIntfcPropertyInfo.getLength()); System.out.println("\t Name = " + oCompIntfcPropertyInfo.getName()); System.out.println("\t Is Xlat? = " + oCompIntfcPropertyInfo.getXlat()); System.out.println("\t Is Yesno? = " + oCompIntfcPropertyInfo. getYesno());

Note. When creating a new component interface, you must save the component interface before the standard methods are created. PeopleSoft Application Designer adds the standard methods upon the first save of a new component interface.

Click to jump to top of pageClick to jump to parent topicUnderstanding Collection Methods

The first item in a component interface collection is always indexed as item 1 from PeopleCode and COM programs, which is consistent with other PeopleCode processing. From Java and C++ programs, this item is indexed as item 0.

Component Interface Collection Properties

This table contains the component interface collection properties:

Data Collection Method

Action, Usage

Count

Returns the number of items in a collection.

Use these interfaces to call with other programming languages.

  • Java: long getCount()

  • C++: PSI32 <CiCollectionName>_GetCount (HPSAPI_<CI_COLLECTION_NAME> hCol)

  • COM: Count As Long

ItemByName

(not used in PeopleCode)

Returns the property in the collection. It takes Name as a parameter.

Use these interfaces to call with other programming languages.

  • Java: ICompIntfcPropertyInfo itemByName(String Name)

  • C++: CompIntfcPropertyInfoCollection_ItemByName (HPSAPI_COMPINTFCPROPERTYINFOCOLLECTION, LPTSTR Name)

  • COM: Function ItemByName(name As String) As CompIntfcPropertyInfo

InsertItem(Index)

Inserts a new item. This is equivalent to clicking the Add button to insert a new row when online. It takes Index as a parameter and follows the same conventions for performing business rules (PeopleCode) as the online system.

Use these interfaces to call with other programming languages.

  • Java: <CiCollectionName> insertItem( long Index)

  • C++: HPSAPI_<CI_COLLECTION_ITEM> <CiCollectionName>_InsertItem(HPSAPI_<CI_COLLECTION_NAME> hCol, PSI32 Index)

  • COM: Function InsertItem(index As long) As <CI_COLLECTION_ITEM>

DeleteItem(Index)

Deletes the item that is designated by Index. This is equivalent to clicking the Delete button to delete the selected row when online.

Use these interfaces to call with other programming languages.

  • Java: boolean deleteItem(long Index)

  • C++: BOOL <CiCollectionName>_DeleteItem(HPSAPI_<CI_COLLECTION_NAME> hCol, PSI32 Index)

  • COM: Function DeleteItem(index As Long) As Boolean

Item(Index)

Takes an item number as a parameter and returns a definition of the type that is stored in the specified row in the collection. For example, if the collection is a data collection, the return value is a DataRow. If the return value is a PropertyInfoCollection, then the return value is a PropertyInfo definition, and so on.

Use these interfaces to call with other programming languages.

  • Java: <CiCollectionName> item(long Index)

  • C++: HPSAPI_<CI_COLLECTION_ITEM> <CiCollectionName>_Item(HPSAPI_<CI_ COLLECTION_NAME> hCol, PSI32 Index) (HPSAPI_COMPINTFCPROPERTYINFOCOLLECTION, PSI32)

  • COM: Function Item(item As Long) As <CI_COLLECTION_ITEM>

ItemByKeys(keys)

Identifies and finds a specific item, based on keys. The keys vary according to the design of the collection.

Use these interfaces to call with other programming languages.

  • Java: <CiCollectionName> itemByKeys(String Key1, String Key2, …)

  • C++: HPSAPI_<CI_COLLECTION_ITEM> <CiCollectionName>_ItemByKeys (HPSAPI_<CI_COLLECTION_NAME > hCol, LPTSTR Key1, LPTSTR Key2, …)

  • COM: Function ItemByKeys(KEY_1 As String, KEY_2,…) As <CI_COLLECTION_ITEM>

CurrentItem

Returns the current effective DataRow in the collection. The behavior is consistent with effective date rules that are used online. This method works with effective-dated records only.

Use these interfaces to call with other programming languages.

  • Java: <CiCollectionName>currentItem()

  • C++: HPSAPI_<CI_COLLECTION_ITEM> <CiCollectionName>_ CurrentItem(HPSAPI_<CI_COLLECTION_NAME> hCol)

  • COM: Function CurrentItem() As <CI_COLLECTION_ITEM>

CurrentItemNum

(CurrentItemNumber)

Returns the item number of the current effective DataRow in the collection. The behavior is consistent with effective date rules that are used online. This method works with effective-dated records only.

Use these interfaces to call with other programming languages.

  • Java: long currentItemNum()

  • C++: PSI32 <CiCollectionName>_ _CurrentItemNum(HPSAPI_<CI_COLLECTION_NAME> hCol)

  • COM: Function CurrentItemNum() As Long

GetEffectiveItem(DateString, SeqNum)

Returns the DataRow that would be effective for the specified date and sequence number. This is a more general case of the GetCurrentItem function, which returns the definition that is effective at this moment. This method works with effective-dated records only.

Use these interfaces to call with other programming languages.

  • Java: <CiCollectionName> getEffectiveItem(String Date, long SeqNum)

  • C++: HPSAPI_<CI_COLLECTION_ITEM> <CiCollectionName>_ GetEffectiveItem(HPSAPI_<CI_COLLECTION_NAME> hCol, LPTSTR Date, PSI32 SeqNum)

  • COM: Function GetEffectiveItem(Date As String, SeqNum As Long) As <CI_COLLECTION_ITEM>

GetEffectiveItemNum(DateString, SeqNum)

Returns the item number of the DataRow in the collection that would be effective for the specified date and sequence number. This is a more general case of the GetCurrentItemNum function, which returns the number of the definition that is effective at this moment. This method works with effective-dated records only.

Use these interfaces to call with other programming languages.

  • Java: long getEffectiveItemNum(string Date, long SeqNum)

  • C++: <CiCollectionName>_GetEffectiveItemNum( HPSAPI_<CI_COLLECTION_NAME> hCol, LPTSTR Date,PSI32 SeqNum)

  • COM: Function GetEffectiveItemNum(Date As String, SeqNum As Long)

Click to jump to top of pageClick to jump to parent topicEnabling and Disabling Standard Methods

You can control whether standard methods are accessible at runtime.

To enable or disable standard methods:

  1. Select File, Definition Properties from the PeopleSoft Application Designer menu.

    The Definition Properties dialog box appears.

  2. Select the Standard Methods tab.

    You can enable or disable any of the standard methods selecting the corresponding check box. Doing so determines whether the method is available at runtime when the component interface is accessed. The Create option is available only if the component interface has Create keys.

Click to jump to top of pageClick to jump to parent topicCreating User-Defined Methods

This section discusses how to create user-define methods.

To create a user-defined method:

  1. Right-click anywhere in the component interface view.

  2. Select View PeopleCode from the menu.

    The PeopleCode editor appears. If you are using a new component interface, no PeopleCode will appear in the editor because no user-defined methods have been created.

  3. Write the required PeopleCode functions.

    PeopleCode functions that you write are stored in a single PeopleCode program that is attached to the component interface and associated with the Methods event.

    Note. New user-defined methods do not appear in the list of methods until you save the component interface. Double-click the icon of any existing user-defined method to return to this PeopleCode program.

  4. Set permissions for the methods that you created.

    You must set permissions for every user-defined method. If you set permission to Full Access, at runtime that function is exposed to external systems as a method on the component interface object.

Click to jump to top of pageClick to jump to parent topicExporting User-Defined Methods

If you want a user-defined component interface to be exportable, meaning used by code that instantiates the component interface, the method PeopleCode definition must include a Doc statement. It is in the form of:

Doc <documentation for method>

where <documentation for method> describes what the method does

For example, the following method returns true if foo is positive; otherwise, it returns false.

Function MyFooBar(int foo) returns boolean Doc if (foo >0) then return True; else return False; end-if; end-function;

Click to jump to parent topicValidating Component Interfaces

Validation ensures that the structure of a component interface is still valid. Over time, the structure of a component interface can become invalid due to component structural changes and modifications. For example, this can happen whenever a component deletes or adds a record or field. It can also happen if the keys on the component are added or removed. Properties and keys that no longer synchronize with their associated components are marked with an X icon.

Note the following points about validating component interfaces:

To correct an invalid component interface, you might have to delete properties for which appropriate fields or records no longer exist. If the structure of the source component has changed, you might have to delete old properties and re-add the new properties in their appropriate locations. You may also need to rename a property or collection.

To validate a component interface:

  1. Open the component interface in PeopleSoft Application Designer.

    Validation occurs automatically whenever you open a component interface in PeopleSoft Application Designer.

  2. Select Tools, Validate for Consistency from the PeopleSoft Application Designer menu to validate an open component interface.

    As you change components or other related definitions, you should validate a component interface that is already open in PeopleSoft Application Designer.

Click to jump to parent topicSetting Security Options

After creating a component interface, you must set security for it. Each individual method also needs to be provided security. Security for the component interface is provided through the PeopleSoft Internet Architecture pages. Component interface permissions are set at the permission list level in PeopleSoft security.

To set up component interface security:

  1. Sign in to the PeopleSoft Pure Internet Architecture through the browser, and select PeopleTools, Security, Permissions & Roles, Permission Lists.

  2. Select the permission list for which you want to set security.

    The Permission List component appears.

  3. Access the Component Interfaces page.

  4. Select the component interface for which you want to set security.

    To add another component interface to the list, click the Add button.

  5. Click Edit.

    The Component Interface Permissions page appears, showing all of the methods (both standard and user-defined) in the component interface and their method of access.

  6. Set the access permission for each method.

    Select Full Access or No Access. You must grant full access to at least one method to make the component interface available for testing and other online use.

  7. Click OK when you are done.

  8. Save the page.

Click to jump to parent topicTesting Component Interfaces

After setting the security for a component interface, you can test the contents and behavior using the component interface tester. You should test the component interface before using it in your external system. This proactive tool helps you discover problems with the underlying component or the component interface itself, including user-defined methods. When you are testing a component interface, real data from the database is used. Therefore, if you save the information that you change by calling the Save method, the information is changed in the database.

With the component interface tester, you can:

Click to jump to top of pageClick to jump to parent topicSearching Component Interfaces to Test

To test the component interface, you search for the component interface to test, and then you test it.

Access the Component Interface Tester search dialog box:

To search for a component interface to test:

  1. Open the component interface in PeopleSoft Application Designer.

  2. Select Tools, Test Component Interface from the PeopleSoft Application Designer menu.

    The Component Interface Tester search dialog box appears. This dialog box displays the keys (in the left-hand columns) for getting, creating, or finding an instance of the component interface. The right-hand columns provide a place for you to enter sample key values for testing.

  3. Enter key values.

    1. Double-click the column to the right of any displayed keys.

    2. Enter the value in the right-hand column.

      The data that is used for the test corresponds to the key values that you enter here. In the preceding example, we have entered an employee ID of 6602.

Interactive Mode

In interactive mode, any action request occurs immediately. Each property being set causes an immediate trip to the application server (or database server in two-tier mode). This differs from noninteractive mode, in which actions are often held and later sent in batches. For example, 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. This means that edit processing (and other processing, such as FieldChange PeopleCode) occurs for each set property.

Whether you select this option depends on how you expect a particular component interface to be used and what you are currently testing. In a real production system, this parameter can significantly affect performance, but it makes little difference in the test component. In noninteractive mode, errors and properties are not updated until a method is run. By default, Interactive Mode is selected in the component interface tester.

Get History Items

Select to retrieves history data. This option applies to effective-dated fields only and is equivalent to running in either Update/Display or Update/Display All mode.

Edit History Items

Select to enable editing and saving of history data. This option applies to effective-dated fields only and is equivalent to running in either Update/Display or Correction mode.

Get Dummy Rows

Specify whether to get dummy rows. This option is selected as a default.

The component processor provides dummy rows to enable quick data entry when the level you are accessing does not have any data. Because of this, an API that does not need this row finds it and exposes it to the user. The application that uses the API now has to determine whether the row is a dummy row and accordingly decides to execute Item or InsertItem.

Setting the GetDummyRow to false enables the component interface processor to handle the counts accordingly. With this property set to false, users do not have to use item and InsertItem when adding new data at levels 1 to 3. Instead, they can comfortably always use InsertItem.

Get Existing

Clicking Get Existing is equivalent to opening a record in Update/Display or Correction mode online. It retrieves one instance from the database. After you click the Get Existing button, the Component Interface Tester dialog box appears.

Create New

Clicking Create New is equivalent to creating a new row in Add mode online. If your component does not support the Create method, this button is disabled. After you click the Create New button, the Component Interface Tester dialog box appears.

Getting Existing Records by Using Partial Keys

If you want to retrieve a partial key, click the Find button on the Component Interface Tester page. The Find Results dialog box appears:

You can choose the specific instance by selecting and clicking the Get Selected button. If you do not enter a partial key before clicking Find, all key values in the database are returned (subject to the maximum count of 300, just as when online). This is the same as calling the Find method through the component interface API, followed by selecting a value from the Find results, setting the Get key, and calling the Get method. After you click the Get Selected button, the Component Interface Tester dialog box appears.

Click to jump to top of pageClick to jump to parent topicTesting Component Interfaces

After you have searched for and retrieved the component interface, the Component Interface Tester dialog box appears.

Testing Component Interface Properties

From the Component Interface Tester dialog box, change the value of a property, double-click a value, and enter a new value. Some basic validation is done when you leave the field, which is equivalent to leaving a field using the Tab key in the online case. This validation includes system edit, FieldChange PeopleCode events, and FieldEdit PeopleCode events. Further validation can be done when the Save method is called (SaveEdit, SavePreChange, Workflow, and SavePostChange). If errors occur or warnings are encountered, messages are displayed in the Error Message Log area at the bottom of the window. The error message log displays the same text that would appear in the PSMessages collection of the Session object if you accessed the component through the Component Interface API.

Testing Component Interface Methods

Test component interface methods by right-clicking the component interface name.

A menu appears that shows the Save and Cancel standard methods and any user-defined methods that exist for the component interface. The Find, Create, and Get standard methods are not valid for an instantiated component, and therefore are not shown.

If a component interface method requires one or more parameters, a dialog box in which you can enter the parameters appears. After the method is executed, the same dialog box appears again, displaying changes to the parameters that were caused by the method. The return value of the function appears in the title of the dialog box. If a component interface requires no parameters, you do not see the initial dialog box, but you do see the return value dialog box following the function call.

Note. Because running a component interface method can result in a change to the component interface structure, PeopleSoft Application Designer always redraws the component interface tree in its collapsed form following a method call.

Testing Collection Methods

Test collection methods by right-clicking the collection name.

A menu appears that shows the standard collection methods. Select the collection method that you want to test for this component interface. After you select a collection method to test, the Enter parameters dialog box prompts you to enter an item number for the collection method that you are testing. The value that you enter for index [Number] is used to retrieve, insert, or delete an item, according to the following rules.

After you enter an index number, the result appears in the dialog box. If a return value is sent, it is displayed in the title bar. Otherwise, the message No value is displayed. Click OK or Cancel to dismiss the dialog box.

Collection Method Rules

This table contains the collection method rules:

Collection Method

Purpose

Item(index)

Returns the row at the specified index. Only the success or failure of this routine is of interest from inside the test component.

InsertItem(index)

Inserts a new row either before the index that you specify if the collection is effective-dated or following the index if it isn’t effective-dated.

DeleteItem(index)

Deletes the row that is designated by the index number that you specified in the Enter parameters dialog box.

ItemByKeys(key1, key2, …)

Returns the row corresponding to the specified keys. Only the success or failure of this routine is of interest from inside the test component.

CurrentItem

This method returns the effective row in an effective-dated record. Only the success or failure of this routine is of interest from inside the test component.

GetEffectiveItem(DateString, SeqNum)

Returns the data row that would be effective for the specified date and sequence number. This is a more general case of the GetCurrentItem function, which returns the definition that is effective at this moment. This method works with effective-dated records only.

GetEffectiveItemNum(DateString, SeqNum)

Returns the item number inside the collection of the data row that would be effective for the specified date and sequence number. This is a more general case of the GetCurrentItemNum function, which returns the number of the definition that is effective at this moment. This method works with effective-dated records only.

Note. Component interface classes contain information about collection methods.

Click to jump to top of pageClick to jump to parent topicDetermining ItemByKeys Parameters

You can get the signature for the ItemByKeys method (or any other method) when testing a component interface. This is helpful for the ItemByKeys method, because its signature is different for each component interface.

To determine ItemByKeys parameters:

  1. Open the definition.

  2. Select Tools, Test Component Interface.

  3. Find or get an appropriate populated component interface.

  4. Navigate to the appropriate collection.

  5. Right-click, and select ItemByKeys from the menu.

    A dialog box appears, showing the specific parameters and types and the order in which you should call ItemByKeys.

    In the preceding example, the keys for the SDK_BUS_EXP_PER ItemByKeys method are SDK_EMPID (String) and SDK_EXP_PER_DT (String).

Click to jump to parent topicUnderstanding Synchronization

The Component Interface Properties Synchronization tab is used with PeopleSoft Mobile Agent.

Important! PeopleSoft Mobile Agent is a deprecated product. The Component Interface Properties Synchronization tab exists for backward compatibility only.

PeopleSoft Mobile Agent extends the functionality of PeopleSoft Pure Internet Architecture to disconnected mobile devices, enabling users to continue working with their PeopleSoft applications on a laptop computer or personal digital assistant (PDA) while disconnected from the internet or local network.

Click to jump to parent topicWriting Component Interface Programs

The following chapters in this PeopleBook describe how to write component interface programs in several programming languages.

Also, the PeopleTools PeopleCode Reference contains a chapter that describes the component interface classes, including detailed instructions on the life cycle of a component interface and how to implement a component interface program in PeopleCode. You can use this information to help design your component interface program in other programming languages.

See Component Interface Classes.

Click to jump to parent topicUnderstanding Runtime Considerations

In many ways, accessing a component interface is functionally equivalent to working with an online component. However, some important differences exist between component interfaces and components. This section describes how those differences affect interactive operation, functionality designed for graphical interfaces, client versus server operation, and several miscellaneous situations. These considerations, unless otherwise noted, apply to all the programming languages listed in this manual.

Click to jump to top of pageClick to jump to parent topicGeneral Considerations

This section discusses general considerations for component interface programs.

WinMessage Unavailable

You cannot use the WinMessage API in a component that will be used to build a component interface. Use the MsgGet() function instead.

Email from a Component Interface

To use a component interface to send email, use the TriggerBusinessEvent PeopleCode event, not SendMail.

Related Display

Related display fields are not available for use in a component interface because they are not held in the buffer context that the component interface uses.

Row Inserts

If row insert functionality has been disabled for a page, you must take care when calling inserts against the corresponding component interface. Any PeopleCode associated with buttons used on the page to add rows will not be invoked by the component interface when an insert is done.

Note. If a component has logic that inserts rows on using the RowInsert event, the component interface cannot identify the change and locate the rows that were inserted by the application code. Generic interfaces such as Excel to Component Interfaces utility and the WSDLToCI will not function correctly when using this type of dynamic insert.

Custom Field Formats

Custom field formats that are defined dynamically via Peoplecode are not enforced by component interfaces, as they are evaluated by the page processor and not available to the component interface processor. Only the static formats defined in the Application Designer will be applied.

Click to jump to top of pageClick to jump to parent topicScope Conflicts

This section discusses scope conflicts for component interface programs.

Infinite Processing Loops

A component interface should not call itself in any of the PeopleCode included within its component definition, because this may result in an infinite loop of the component interface. A component interface also should not call itself from a user-defined method.

Multiple Instances of a Component Interface

Because of potential memory conflicts, COM or C++ applications should not create multiple, simultaneous instances of the same component interface, either within a single procedure, or in both a parent and a child procedure.

Click to jump to top of pageClick to jump to parent topicInteractive Mode

This section discusses interactive mode considerations for component interface programs.

UNIX Server Performance

If you are using a component interface as part of a batch process in which thousands of rows are being inserted, running in interactive mode may reduce performance enough on some UNIX servers to produce a connection failure. Prevent this by setting the InteractiveMode property to False.

Hidden Edit Validation Errors

If the InteractiveMode property is set to True, and if a transaction sets a property to a value that isn't allowed in a prompt edit field, the edit field value is reset back to its original value. The error is logged in the PSMessages collection; however, the Save method runs without errors. Check the value of both the Save method and the collection ErrorPending property to discover all of the errors.