Pagelet Collection Methods

In this section, we discuss the Pagelet collection methods. The methods are discussed in alphabetical order.

Syntax

DeleteItem(PageletName)

Description

The DeleteItem method deletes the pagelet object identified by PageletName from the pagelet Collection.

Note: The portal registry classes execute some methods "interactively", that is, as they happen. The item won't be marked for deletion, then actually deleted later. The item is deleted from the database as soon as the method is executed.

Parameters

Field or Control

Definition

PageletName

Specify the name of a pagelet existing in the pagelet collection.

Returns

A Boolean value: True if the pagelet was deleted, False otherwise.

Example

If Not &MyColl.DeleteItem("Test_Pagelet") Then
   /* can't delete test data. Do error processing */
End-if;

Syntax

First()

Description

The First method returns the first pagelet object in the pagelet collection.

Parameters

None.

Returns

A reference to a pagelet object if successful, NULL otherwise.

Example

&MyCRef = &MyCollection.First();

Syntax

InsertItem(PageletName, Label, NodeName, URL)

Description

The InsertItem method inserts the pagelet object identified by PageletName into the pagelet Collection.

Note: The portal registry classes execute some methods "interactively", that is, as they happen. The item won't be marked for insertion, then actually inserted later. The item is inserted into the database as soon as the method is executed.

Parameters

Field or Control

Definition

PageletName

Specify the name of a new pagelet. This parameter takes a string value. If you specify a name that already exists in the collection, you receive an error.

Label

Specify the label for the new pagelet. This parameter takes a string value.

NodeName

Specify a node. This parameter takes a string value. If you specify a fully qualified URL, you can specify a Null (that is, two quotation marks with no space between them ("")).

URL

Specify a URL that contains the content. The format of this parameter depends on other properties, such as the type of pagelet, where the data is stored, and so on.

Returns

A reference to the new pagelet object if the method executed successfully, NULL otherwise.

Syntax

ItemByName(Name)

Description

The ItemByName method returns the pagelet object with the name Name.

Parameters

Field or Control

Definition

Name

Specify the name of an existing pagelet within the pagelet collection. If you specify an invalid name, the object will be NULL.

Returns

A reference to a pagelet object if successful, NULL otherwise.

Example

&MyPagelet = &CRefColl.ItemByName("PORTAL_ADMIN);

Syntax

Next()

Description

The Next method returns the next pagelet object in the pagelet collection. You can only use this method after you have used the First method: otherwise the system doesn’t know where to start.

Parameters

None.

Returns

A reference to a pagelet object if successful, NULL otherwise.

Example

&MyPagelet = &MyCollection.Next();