RCMenuFolder Class Methods

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

Syntax

AppendMenuLink(service_ID, instance_ID)

Description

Use the AppendMenuLink method to instantiate a PTCS_MENULAYOUT:RCMenuLink object and append that link as the last link in the menu folder.

Parameters

Field or Control

Definition

service_ID

Specifies a string value representing the service ID for the parent related content service configuration.

instance_ID

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

Returns

A PTCS_MENULAYOUT:RCMenuLink object.

Example

import PTCS_SRVDEFN:RCServiceDefinition;
import PTCS_SERVICE:RCService;
import PTCS_SRVCONFIG:RCServiceConfig;
import PTCS_MENULAYOUT:RCMenuLayout;
import PTCS_MENULAYOUT:RCMenuFolder;
import PTCS_MENULAYOUT:RCMenuLink;

Component PTCS_SERVICE:RCService &rcService;
Component PTCS_SRVCONFIG:RCServiceConfig &rcServConfig;
Component PTCS_MENULAYOUT:RCMenuLayout &rcMenuLayout;
Component PTCS_MENULAYOUT:RCMenuFolder &rcMenuFolder;
Component PTCS_MENULAYOUT:RCMenuLink &rcMenuLink;

&rcServConfig = &rcService.AddNewService("MY_SERVICE", 0);
&rcMenuLayout = &rcServConfig.AddPageFieldMenu("QE_BOOK.2", "0.QE_BOOK.QE_BOOK_NAME.2");
&rcMenuFolder = &rcMenuLayout.GetFolder(1);
If (&rcMenuFolder <> Null) Then
   For &n = 1 To &rcMenuFolder.GetMenuLinkCount()
      &rcMenuLink = &rcMenuFolder.AppendMenuLink("MY_SERVICE", &rcServConfig.InstanceId);
      If (&rcMenuLink <> Null) Then
         /* Do some processing */
      End-If;
   End-For;
End-If;

Syntax

DeleteMenuLink(nItem)

Description

Use the DeleteMenuLink method to delete the specified link from the menu folder.

Parameters

Field or Control

Definition

nItem

Specifies the index of the link as a number value.

Returns

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

Example

import PTCS_SERVICE:RCService;
import PTCS_SRVCONFIG:RCServiceConfig;
import PTCS_MENULAYOUT:RCMenuLayout;
import PTCS_MENULAYOUT:RCMenuFolder;
import PTCS_MENULAYOUT:RCMenuLink;

Component PTCS_SERVICE:RCService &rcService;
Component PTCS_SRVCONFIG:RCServiceConfig &rcServConfig;
Component PTCS_MENULAYOUT:RCMenuLayout &rcMenuLayout;
Component PTCS_MENULAYOUT:RCMenuFolder &rcMenuFolder;
Component PTCS_MENULAYOUT:RCMenuLink &rcMenuLink;
Local number &n;

&rcServConfig = &rcService.AddNewService("MY_SERVICE", 0);
&rcMenuLayout = &rcServConfig.AddPageFieldMenu("QE_BOOK.2", "0.QE_BOOK.QE_BOOK_NAME.2");
&rcMenuFolder = &rcMenuLayout.GetFolder(1);
If (&rcMenuFolder <> Null) Then
   For &n = 1 To &rcMenuFolder.GetMenuLinkCount()
      Local boolean &bRet = &rcMenuFolder.DeleteMenuLink(&n);
      If (&bRet) Then
         /* Do some processing */
      End-If;
   End-For;
End-If;

Syntax

GetMenuLink(nItem)

Description

Use the GetMenuLink method to instantiate a PTCS_MENULAYOUT:RCMenuLink object representing the specified link.

Parameters

Field or Control

Definition

nItem

Specifies the index of the link as a number value.

Returns

A PTCS_MENULAYOUT:RCMenuLink object.

Example

import PTCS_SERVICE:RCService;
import PTCS_SRVCONFIG:RCServiceConfig;
import PTCS_MENULAYOUT:RCMenuLayout;
import PTCS_MENULAYOUT:RCMenuFolder;
import PTCS_MENULAYOUT:RCMenuLink;

Component PTCS_SERVICE:RCService &rcService;
Component PTCS_SRVCONFIG:RCServiceConfig &rcServConfig;
Component PTCS_MENULAYOUT:RCMenuLayout &rcMenuLayout;
Component PTCS_MENULAYOUT:RCMenuFolder &rcMenuFolder;
Component PTCS_MENULAYOUT:RCMenuLink &rcMenuLink;
Local number &n;

&rcServConfig = &rcService.AddNewService("MY_SERVICE", 0);
&rcMenuLayout = &rcServConfig.AddPageFieldMenu("QE_BOOK.2", "0.QE_BOOK.QE_BOOK_NAME.2");
&rcMenuFolder = &rcMenuLayout.GetFolder(1);
If (&rcMenuFolder <> Null) Then
   For &n = 1 To &rcMenuFolder.GetMenuLinkCount()
      &rcMenuLink = &rcMenuFolder.GetMenuLink(&n);
      If (&rcMenuLink <> Null) Then
         /* Do some processing */
      End-If;
   End-For;
End-If;

Syntax

GetMenuLinkCount()

Description

Use GetMenuLinkCount method to return the count of menu links in this folder as a number value.

Parameters

None.

Returns

A number value.

Example

import PTCS_SERVICE:RCService;
import PTCS_SRVCONFIG:RCServiceConfig;
import PTCS_MENULAYOUT:RCMenuLayout;
import PTCS_MENULAYOUT:RCMenuFolder;
import PTCS_MENULAYOUT:RCMenuLink;

Component PTCS_SERVICE:RCService &rcService;
Component PTCS_SRVCONFIG:RCServiceConfig &rcServConfig;
Component PTCS_MENULAYOUT:RCMenuLayout &rcMenuLayout;
Component PTCS_MENULAYOUT:RCMenuFolder &rcMenuFolder;
Component PTCS_MENULAYOUT:RCMenuLink &rcMenuLink;
Local number &n;

&rcServConfig = &rcService.AddNewService("MY_SERVICE", 0);
&rcMenuLayout = &rcServConfig.AddPageFieldMenu("QE_BOOK.2", "0.QE_BOOK.QE_BOOK_NAME.2");
&rcMenuFolder = &rcMenuLayout.GetFolder(1);
If (&rcMenuFolder <> Null) Then
   For &n = 1 To &rcMenuFolder.GetMenuLinkCount()
      /* Do some processing */
   End-For;
End-If;