RCService Class Methods

In this section, the RCService class methods are presented in alphabetical order.

Syntax

AddNewService(service_ID, instance_ID)

Description

Use the AddNewService method to instantiate and return a PTCS_SRVCONFIG:RCServiceConfig object. The object returned depends on the value of the instance_ID parameter:

  • When the instance_ID parameter is 0, the PTCS_SRVCONFIG:RCServiceConfig object represents a new related content service configuration and a new instance ID is automatically generated.

  • When the instance_ID parameter corresponds to an existing value, the PTCS_SRVCONFIG:RCServiceConfig object is instantiated from this existing configuration.

  • When either the service_ID parameter or the instance_ID parameter is invalid and does not corresponds to an existing value, Null is returned.

Parameters

Field or Control

Definition

service_ID

Specifies a string value representing the service ID of an existing related content service definition.

instance_ID

Specifies an integer value representing the instance ID for a specific related content service configuration.

Returns

A PTCS_SRVCONFIG:RCServiceConfig object.

Example 1

The following example demonstrates how to instantiate an RCServiceConfig object for a new service configuration:

import PTCS_SERVICE:RCService;
import PTCS_SRVCONFIG:RCServiceConfig;

Component PTCS_SERVICE:RCService &pgRFFlRcService;

&pgRFFlRcService = create PTCS_SERVICE:RCService("EMPLOYEE", "QE_NUI_RI_GBL");
Local PTCS_SRVCONFIG:RCServiceConfig &rcRFFlServConfig = &pgRFFlRcService.AddNewService("APPTEST_UTIL_SERVID", 0);
Local boolean &bRetSav = &pgRFFlRcService.Save();

Example 2

The following example demonstrates how to instantiate an RCServiceConfig object for an existing service configuration:

import PTCS_SERVICE:RCService;
import PTCS_SRVCONFIG:RCServiceConfig;
import PTCS_SRVCONFIG:RCMapFields;

Component PTCS_SERVICE:RCService &pgRFFlRcService;
Component PTCS_SRVCONFIG:RCMapFields &rcMapFields;

&pgRFFlRcService = create PTCS_SERVICE:RCService("EMPLOYEE", "QE_NUI_RI_GBL");
&pgRFFlRcService.LanguageCd = "ENG";
Local PTCS_SRVCONFIG:RCServiceConfig &rcRFFlServConfig = &pgRFFlRcService.AddNewService("APPTEST_UTIL_SERVID", 569863);
&rcMapFields = &rcRFFlServConfig.GetMapField(1);
If (&rcMapFields <> Null) Then
   /* do some processing */
End-If;

Syntax

Delete()

Description

Use the Delete method to delete all related content service configurations for this component.

Parameters

None.

Returns

A boolean value: True if the delete is successful, False otherwise.

Example

import PTCS_SERVICE:RCService;

Component PTCS_SERVICE:RCService &pgRFFlRcService;

&pgRFFlRcService = create PTCS_SERVICE:RCService("EMPLOYEE", "QE_NUI_RI_GBL");
Local boolean &bRetDel = &pgRFFlRcService.Delete();

Syntax

DeleteService(service_ID)

Description

Use the DeleteService method to delete all related content service instances from this component for the given service_ID parameter.

Parameters

Field or Control

Definition

service_ID

Specifies a string value representing the service ID of an existing related content service definition.

Returns

A boolean value: True if the delete is successful, False otherwise.

Example

import PTCS_SERVICE:RCService;

Component PTCS_SERVICE:RCService &pgRFFlRcService;

&pgRFFlRcService = create PTCS_SERVICE:RCService("EMPLOYEE", "QE_NUI_RI_GBL");
Local boolean &bRetDel = &pgRFFlRcService.DeleteService("APPTEST_UTIL_SERVID");
Local boolean &bRetSav = &pgRFFlRcService.Save()

Syntax

DeleteServiceInstance(instance_ID)

Description

Use the DeleteServiceInstance method to delete a specific service configuration instance from this component.

Parameters

Field or Control

Definition

instance_ID

Specifies an integer value representing the instance ID for a specific related content service configuration.

Returns

A boolean value: True if the delete is successful, False otherwise.

Example

import PTCS_SERVICE:RCService;
import PTCS_SRVCONFIG:RCServiceConfig;

Component PTCS_SERVICE:RCService &pgRFFlRcService;

&pgRFFlRcService = create PTCS_SERVICE:RCService("EMPLOYEE", "QE_NUI_RI_GBL");
Local PTCS_SRVCONFIG:RCServiceConfig &rcRFFlServConfig = &pgRFFlRcService.AddNewService("APPTEST_UTIL_SERVID", 0);
Local boolean &bRetDel = &pgRFFlRcService.DeleteServiceInstance(&rcRFFlServConfig.InstanceId);
Local boolean &bRetSav = &pgRFFlRcService.Save();

Syntax

GetInstanceId(service_ID)

Description

Use the GetInstanceId method to return an array of integer representing the instance IDs associated with the specified service_ID parameter.

Parameters

Field or Control

Definition

service_ID

Specifies a string value representing the service ID of an existing related content service definition.

Returns

An array of integer.

Example

Local array of integer &instArr = &pgRFFlRcService.GetInstanceId("APPTEST_UTIL_SERVID");
If All(&instArr) Then
   For &i = 1 To &instArr.Len
      /* do something */
   End-For;
End-If;

Syntax

GetServiceInfo(service_ID)

Description

Use the GetServiceInfo method to return all service configurations for the given service_ID parameter as an array of PTCS_SRVCONFIG:RCServiceConfig objects.

Parameters

Field or Control

Definition

service_ID

Specifies a string value representing the service ID of an existing related content service definition.

Returns

An array of PTCS_SRVCONFIG:RCServiceConfig objects.

Example

Local array of PTCS_SRVCONFIG:RCServiceConfig &rcServCfg = &pgRFFlRcService.GetServiceInfo("APPTEST_UTIL_SERVID");
If All(&rcServCfg) Then
   For &i = 1 To &rcServCfg.Len
      /* do something */
   End-For;
End-If;

Syntax

RCService(portal_name, CREF_name)

Description

Use the RCService constructor method to instantiate a PTCS_SERVICE:RCService object to manage all related content service configurations for the specified component.

Parameters

Field or Control

Definition

portal_name

Specifies a string value representing the portal name.

CREF_name

Specifies a string value representing the component using its content reference ID (also referred to as its portal object name).

Returns

None.

Example

import PTCS_SERVICE:RCService;

Component PTCS_SERVICE:RCService &pgRFFlRcService;

&pgRFFlRcService = create PTCS_SERVICE:RCService("EMPLOYEE", "QE_NUI_RI_GBL");

Syntax

Save()

Description

The Save method saves the related content service configurations for this component to the database. Invoke the Save method after instantiating a new component configuration, after updating configuration properties for the component, or after invoking any of these methods: AddNewService, DeleteService, or DeleteServiceInstance.

Parameters

None.

Returns

A boolean value: True if the save is successful, False otherwise.

Example

Local boolean &bRet = &pgRFFlRcService.Save();