Folder Extension Data StructuresLast Updated: 08/15/2018 Introduced in Version: 2.0
Folder Extensions are custom Data Structures that also act as Folders. Folder Extensions can be generated with a default set of Create, Edit, Get and Delete methods, and can also be configured with custom actions using flows.
In our example, we will create a Folder Extension called Vehicle. This Folder Extension will include four standard properties of a car: Color, Year, Make and Model. It will also have a default page view called Car Details and a simple action called Send Notification.
We will begin in the portal by navigating to a Designer Folder, and then select Create Datatypes > User Defined Type > Folder Extension.
Note: This Action can also be found under Datatypes/Database > User Defined Types category on the Folder Actions Panel.
In the resulting Add Folder Extension Data Structure, give the new Folder Extension the name “Car.” To define the additional properties of this folder, add Name and Type.
- Is List – Indicates that the data member is an array.
- Encrypt Data – Would encrypt the data of the data member (which would automatically decrypt when used).
- Override Display Information – Changes the display name for the data member during design time.
- Override Database Field Name – Renames the database column name.
- SelectEditor – Allows for a different default editor for the data member during design time.
- Configure Custom Attributes – Allows for additional custom attributes for the member to be defined.
Next, we will add the additional properties of our folder extension: Year, Make and Model.
Next, define the Type Name Space of our folder extension. This organizational key can be useful for programmers. Because cars are a type of transportation, we will define the Type Name Space as “Transportation”.
Next, define the behaviors of our Folder Extension. In the Folder Extension Editor, under Behavior check the boxes:
- Show Default Folder Pages: The portal will now show the default folder.
- Show In Tree: The Folder Extension will now show in the designer folders folder tree.
- Define Default Page Name: Will show when the Folder Extension is selected.
- Default Page Name: (Car Details)
Next, select which flow steps to create for our Folder Extension. These steps will allow us to conveniently create, edit, delete and get folders of this Extension Type. Once the parameters have been defined, select Save.
In the Flow Designer, select a Send Notification step from the All Steps [Catalog] > Communication> Send Notification.
Choose Add to add it to the flow designer.
Next, we will configure the Send Notification step to send a simple notification to your current user or the default portal administrator.
This completes our Action Flow, so we will save our flow and close the Flow Designer.
In the Page Designer, select the Page Elements tab search for a Folder Header Data component, drag, and drop. in the page designer. Next, locate a Folder Actions Bar component drag and drop this on the page designer.
This completes our default page, so we will save it and close the Page Designer. Return to the Designer Folder. Now create an instance of our Car Folder Extension type, select the Actions menu and select Add > Entity[User Defined]> Create Car.
In the resulting Create Car dialog, give this new folder the name “Honda Civic” and complete its attributes. Select OK.
When we navigate to Folder Extension Data and Car, we will see the default page we defined earlier.
To edit this folder, select the Edit Car action. In the resulting pop-up, we will define more properties of the folder, including the description, color, make, model, and year.
To use the “Send Notification” action we defined earlier, we will expand Honda Civics’ action menu and select “Send Notification.”
The notification we defined in our flow will appear in the top-right corner of the portal screen.