(Fluid only) Using a PeopleCode Program to Publish Additional Tiles

You can also write a PeopleCode program to call the delivered PublishToHomepage function, which runs the same PT_TILE_PUB Application Engine program that is invoked from the Tile Publish page. This methodology provides users that do not have the Portal Administrator role a way to publish tiles to already personalized fluid homepages or dashboards. If already personalized homepages or dashboards are found that do not include the tiles to be published, the initiator of this action will be prompted to continue before the PT_TILE_PUB program is submitted to the Process Scheduler; otherwise, the PT_TILE_PUB program is not submitted.

Note:

To run the PT_TILE_PUB program, at least one of the user’s permission lists must also include the TLSALL process group.

Syntax

PublishToHomepage(HP_name, tile_list, behavior, run_now, run_DT)

Description

Use the PublishToHomepage function to add and then publish tiles to personalized fluid homepages or dashboards.

Parameters

Field or Control Description

HP_name

Specifies the content reference name (ID) for the fluid homepage or dashboard as a string value.

tile_list

Specifies one or more content reference names (IDs) for tile definitions as a comma-delimited string value.

behavior

Specifies the tile behavior for all tiles in the tile list as a string value:

  • 3DEF – Optional default.

  • 4OPT – Optional. This behavior pertains to fluid dashboards only.

Note: If a specified tile is already configured for the homepage or dashboard and its current behavior differs from what is specified here, then the behavior will be updated when the program is executed.

run_now

Specifies a boolean value indicating whether to submit the Application Engine program to the Process Scheduler immediately.

run_DT

Specifies the date and time to submit the Application Engine program as a datetime value. If run_now is True, this value is ignored.

Returns

A Record object in the format of the PT_TILEPUB_WRK2 record definition with the following fields:

  • PROCESSINSTANCE (number): The process request number if the request was submitted successfully.

  • PTSCHEDULESTATUS (number): 0 indicates the process was submitted successfully; a non-zero number indicates that the submit function failed.

  • STATUS (string): 0 indicates that the process was not required to be scheduled because there were no user personalizations to this homepage. Y indicates that the operator clicked Yes to submit the process; N indicates that the operator clicked No to decline submitting the process.

Example

Declare Function PublishToHomepage PeopleCode PT_TILE_PUB_WRK.FUNCLIB FieldFormula;

&rec = PublishToHomepage("DEFAULT_LP", "TILE_CREF_1, TILE_CREF_2", "3DEF", True, DateTimeValue("2020-06-30 22:30:00"));

If &rec.STATUS = "Y" Then
   If &rec.PTSCHEDULESTATUS.Value = "0" Then
      MY_WRK.PROCESSINSTANCE = &rec.PROCESSINSTANCE;
      MessageBox(0, "", 99999, 101, "Publish process submitted. Process ID: " | &rec.PROCESSINSTANCE);
   Else
      MessageBox(0, "", 99999, 102, "Process could not be scheduled.");      
   End-If;
End-If;