Creating and Using Folder Extension Data StructuresLast Updated: 08/08/2016 Introduced in Verision: 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.
Example
In our example, we will create a folder extension called Car. 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 Projects folder, and selecting Create Datatypes > Folder Extension.
Note: In Decisions 3.2 this Action can be found under Datatypes/Database > User Defined Types category on the Folder Actions Panel.
In the resulting Add Folder Extension Data Structure pop-up, give the new folder extension the name “Vehicle.” To define the additional properties of this folder, click the Add button.
- Is List – Indicates that the data member is an array.
- Encrypt Data – Would encrypt the data of the data member (which would automaticaly 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. To show the default folder pages when this folder is selected in the portal, select the Show Default Folder Pages checkbox. To show folders of this extension type in the folder tree, select the Show In Tree checkbox. To define a default page to be shown when folders of this extension type are selected, select the Define Default Page Name checkbox and define a new page name of “Car Details.”
Next, select which flow steps to create for our folder extension. These steps will allows us to conveniently create, edit, delete, and get folders of this extension type.
Once we’ve finished defining the parameters of our new extension type, click the OK button.
In the Flow Designer’s startup window, select a Send Notification step from the All Steps [Catalog] > Communication category.
Click Add to add it to the workspace.
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 Toolbox tab, navigate to Basic > Current Folder and drag a Folder Header Data component to the workspace, as well as a Folder Actions Bar component.
This completes our default page, so we will save it and close the Page Designer.
Return to the My Home folder. To create an instance of our Car folder extension type, click the Actions menu and select Add > Create Car.
In the resulting Add Root Folder pop-up, give this new folder the name “Honda Civic” and complete its attributes. Click OK.
When we navigate to Honda Civic, we will see the default page we defined earlier.
To edit this folder, we will 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.