PUIATEXMNU



This program returns the valid Menu Items for a specified user and Menu Group (a.k.a. [ Menu Item ] Parent).

Build the Atrium Menu

D PUIATEXMNU PR ExtPgm('PUIATEXMNU') D iUser 128A Const D iType 1A Const N=NavMenu T=Toolbar H=homepages D iParent 128A Const D ioItem LikeDS(Item) D oError N D oErrorMsg 256A

Menu Items are returned by the PUIATEXMNU exit program one by one in the Item data structure.

D Item DS Qualified D Code 128A D Parent 128A blank = root D Type 1A 0=NONLEAF 1=LEAF D ActionType 1A 0=URL 1=Macro 2=RDFApp 3=PCCmd D Action 512A LIB/PGM or URL D Text 128A D Icon 128A D OpenInWindow 1A D OpenOnceOnly 1A D Parm 256A



Subfield

Subfield Values Explanation

Purpose

Subfield

Subfield Values Explanation

Purpose

Code

  • Character String of length 128 characters.

Used as a unique reference value for Menu Items and Menu Groups, must be unique.

Parent

  • Character String of length 128 characters.

  • *BLANKS for root level Menu Items.

If not at root level, value is Code for Menu Group the Menu Item is directly under. If the Parent value is *BLANKS, the root level Menu Items will be returned.

Type

  • 0 = Non-Leaf Node - Menu Group item to display/hide child node(s), if any, when clicked.

  • 1 = Leaf Node - Menu Item to execute Action as ActionType when clicked.

Specifies Node as being a Menu Item or Menu Group.

ActionType

  • 0 = Regular URL

  • 1 = Genie Macro

  • 2 = Rich Display File Application

  • 3 = PC Command 1

Determines how Action value is to be executed.

Action

  • Character String of length 512 characters.

[ If Leaf Node, ] Execute Action value as ActionType.

Text

  • Character String of length 128 characters.

Name of Menu Item.

Icon

  • Character String of length 128 characters.

  • *BLANKS for default menu icon.

Path of the image to be used as the menu icon for the Menu Item

OpenInWindow

  • 0 = Open in Atrium Tab.

  • 1 = Open in New Browser Window or Tab. 2

Determines whether the Action should be executed in a new Atrium Tab or in a New Browser Window or Tab.

OpenOnceOnly

  • 0 = Number of Menu Item Atrium instances is not limited to 1.

  • 1 = Menu Item may only open one Atrium Tab. 3

Determines the number of times a Menu Item can be opened in Atrium Tabs.

Parm

  • Character String of length 256 characters.

Parameter to be added to the URL or passed to the Application.

1 Requires PC Command Listener, Launcher or Applet.

2 Which one the browser opens the Action in can be affected by user's browser settings. 

3 If Menu Item is being opened in a New Browser Window or Tab, this value will not be able to limit the number of instances.

Program Operation

Because there can be an unknown number of Menu Items to return, when Atrium calls this exit program, just one Menu Item (in the Item data structure) is returned. Atrium repeatedly calls the program until there are no more Menu Items to return, in which case PUIATEXMNU returns the Item data structure empty.

PUIATEXMNU runs in stateless environment and has no way to determine how many menu items it has returned or which one to send next. To handle this, Atrium keeps track of this. Atrium will clear the Item data structure before the first call to indicate that is wants the first Menu Item of parent Item.Parent. On subsequent calls Atrium does not alter the Item data structure previously returned (on second call, first Menu Item is still in the Item data structure). This allows PUIATEXMNU to determine which Menu Item to return next. After the last Menu Item has been returned, Atrium will call PUIATEXMNU again, the item data structure will be returned cleared to indicate that there are no more Menu Items.

Atrium Calls PUIATEXMNU

PUIATEXMNU responds

Atrium Calls PUIATEXMNU

PUIATEXMNU responds

Item data structure is cleared.

Returns the first Menu Item in the item data structure.

Item data structure contains the first Menu Item.

Sets file pointer and returns the second Menu Item.

Item data structure contains the second Menu Item.

Sets file pointer and returns the third Menu Item.

Item data structure contains the nth Menu Item.

Sets file pointer and returns Menu Item n+1.

Item data structure contains second to last Menu Item.

Sets file pointer and returns the last Menu Item.

Item data structure contains last Menu Item.

Sets file pointer, determines pointer at EOF, and returns cleared Item data structure.