Creating and Using Folder Extension Data Structures

Last 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.

To create a folder extension in the Portal, navigate to a Designer Folder, select the Create Datatypes button and select Folder Extension. Define the name, data members and settings for your data structure, and then click save. 
 
To use a folder extension in the Portal, select Add > [Your Folder Extension] in the Actions menu.
 
Generating this type of custom data structure also creates a data type.

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.

honda civic folder

 

We will begin in the portal by navigating to a Designer Projects folder, and selecting Create Datatypes > Folder Extension.

create datatypes

 

Note: In Decisions 3.2 this Action can be found under Datatypes/Database > User Defined Types category on the Folder Actions Panel.

folderExtension

 

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.

add data members

 
 
In the resulting Edit object pop-up, we will define the first property as “Color” and give it a data type of String. The other options in the screen are:
  • 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.
data member info 
 

Next, we will add the additional properties of our folder extension: Year, Make and Model.

actions

 

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 Actions of our folder extension. To give our new folder extension the same actions as any other folder, select every checkbox. Note that these actions are not controlled by permissions; any user who logs in and can see the folder can use these actions. If you want to lock down these actions according to the groups in which a user is a member, leave the Actions options unchecked. Alternate actions based on a flow would be used instead (See the topic Creating Flow Actions).
 
By selecting the Override Create Action Name checkbox, you are able to define a new action name for creating folders of this extension type. Define a new action name of “Create Car.”

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.

actions completed

 
 
Our new folder extension will appear in our Designer Folder ready to use. Also, a “Vehicle” data type is available to be used. For example, in a flow:
 datatype can be used in the flow
 
 
 
Next, define a simple action for our Car extension type. This can also be done from the same Designer Projects folder where the other entities for the project are housed. The action will be created in a flow. However, the flow will need to know the context of the data structure. What we will do is create a folder of our folder extension type, in which the flow will be created. From the Designer Folder, click the Actions -> Create Configuration Extension -> Add Folder Actions and Configuration.
 add folder behavior
 
Note: In Decisions 3.2 this Action can be found under Datatypes/Database > Configuration Extension category on the Folder Actions Panel.
folderActionsAndConfig
 
 
In the Type Name field, select the Transportation.VehicleFolderBehavior option. Click OK
 customize entity
 
 
Notice a folder under our Designer Folder automatically appears. This is where our action flow will reside. Portal pages and flows that are created in this folder will be used as page templates and actions for instances of the folder extension. Click on this folder.
 folder appeared
 
 
Click on the Create Action button.
 
 
In the resulting New Flow pop-up, call this action “Send Notification” and click OK.
creating flow
 

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.

 

 flowStarts

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.

 
 save notification
 
When we created the Car folder extension type, we defined a default page name of “Car Details.” To create this page, in the same Designer Folder as our Send Notification flow, click the Create Page/Dashboard button.
 
In the resulting New Page pop-up, name the page “Car Details” and click OK.
 Create Page
 

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.

page designer unsaved

 

This completes our default page, so we will save it and close the Page Designer.

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.

create a car

 

In the resulting Add Root Folder pop-up, give this new folder the name “Honda Civic” and complete its attributes. Click OK.

fill up the form

 

When we navigate to Honda Civic, we will see the default page we defined earlier.

honda civic folder

 

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.”

send notification2

 

The notification we defined in our flow will appear in the top-right corner of the portal screen.

 

Additional Resources