Delta Menus in D2
Smart View is driven via menu configuration for operations and these menus are shown in the
D2-Config under the 'Menu Smart View' configuration. Each of the menu configuration consists of
various menu context. Developers can change default behaviour of the menu items in the various
menu contexts.
Developers can add/modify or delete each of the menu items in the respective menu context.
If the developer wants to change OOTB default menu, then developer need to create a delta menu xml to
define those changes in the following path and format.
resources/xml/unitymenu/<menu_context_name>Delta.xml
.
For example: If the we want to add a new menu item in the Action Toolbar then we need to create a delta file
as follows:
resources/xml/unitymenu/MenuContextDelta.xml
.
Following are the currently supported menu contexts in Smart View. Each of the context are provided
with the OOTB Menus and their corresponding internal 'id' references needed for appending.
Details regarding each of the menus can be found in the D2 admin guide
Menu item name | Menu Id |
---|
Delete relationship | menuContextRelationsDestroy |
Menu item name | Menu Id |
---|
Export rendition | menuContextRenditionsExport |
Delete rendition | menuContextRenditionsRemove |
Menu item name | Menu Id |
---|
Properties | menuContextProperties |
Menu item name | Menu Id |
---|
Properties | menuContextProperties |
Copy link | menuContextCopyLink |
Share | menuContextShare |
Edit | menuContextEdit |
Cut | menuContextCut |
Copy | menuContextCopy |
Paste | menuContextPaste |
Paste as link | menuContextPasteLink |
Add version | menuContextAddVersion |
Checkout | menuContextCheckout |
Cancel checkout | menuContextCancelCheckout |
Permissions | menuContextPermissions |
Print | menuDocumentPrint |
Download | menuContextDownload |
Export properties | menuContextExport |
Delete | menuContextDestroy |
Add to collection | menuContextAddToCollection |
Create relation | menuContextRelationCreate |
View native content | menuDocumentViewNative |
Convert to virtual document | menuContextConvertToVD |
Convert to virtual document | menuContextConvertFolderToVD |
Display outline | menuNewOpenVD |
Display snapshot | menuNewOpenSVVDSnapshot |
Lifecycle | menuContextDocumentLifeCycle |
Send to workflow | menuContextDocumentWorkflow |
Mass update | menuToolsMassUpdate |
Menu item name | Menu Id |
---|
Add file | menuNewObjNewDocument |
Upload file | menuNewObjImportDocument |
Add folder | menuNewObjNewFolder |
Add cabinet | menuNewObjNewCabinet |
Upload folder | menuNewObjImportFolderStructure |
Menu item name | Menu Id |
---|
User settings | menuUserSettings |
Help | menuHelpContents |
About D2 | menuHelpAbout |
Sign out | svMenuUserLogout |
Menu item name | Menu Id |
---|
Download | menuContextVDDownload |
Edit | menuContextVDEdit |
Checkout | menuContextVDCheckout |
Check in | menuContextSVVDCheckin |
Cancel checkout | menuContextVDCancelCheckout |
Add child | menuContextVDAddChild |
Create snapshot | menuContextSVVDSnapshotCreate |
Convert to virtual document | menuContextVDConvertToVd |
Convert to simple document | menuContextVDConvertToSimpleDoc |
Set to version | menuContextSVVDSetBinding |
Replace | menuContextSVVDReplaceChild |
Remove | menuContextSVVDRemoveChild |
Lifecycle | menuContextDocumentLifeCycle |
Send to workflow | menuContextDocumentWorkflow |
Menu item name | Menu Id |
---|
Acquire | menuContextAcquireTaskSV |
Accept | menuContextForwardTaskSV |
Reject | menuContextRejectTaskSV |
Pause task | menuContextPauseTask |
Resume task | menuContextResumeTask |
Rerun | menuContextRerunTask |
Complete | menuContextCompleteTask |
Delegate | menuContextDelegateTaskSV |
Update performers | menuContextUpdatePerformer |
Manage supporting files | menuContextManageAttachmentsSV |
Change task priority | menuContextTaskPriority |
Mark as unread | menuContextTaskUnread |
Mark as read | menuContextTaskRead |
Add note | menuContextAddTaskNoteSV |
Email to performer | menuContextSVEmailPerformer |
Abort workflow | menuContextAbortWorkflow |
Menu item name | Menu Id |
---|
Properties | menuContextProperties |
Go to location | menuContextGotoLocation |
Copy link | menuContextCopyLink |
Download | menuContextDownload |
Export properties | menuContextExport |
Edit | menuContextEdit |
Add to collection | menuContextAddToCollection |
Add version | menuContextAddVersion |
Cancel checkout | menuContextCancelCheckout |
Menu item name | Menu Id |
---|
Start workflow | menuContextLaunchScheduledWorkflow |
Pause workflow | menuContextPauseWorkflow |
Resume workflow | menuContextResumeWorkflow |
Change supervisor | menuContextChangeSupervisor |
Update performers | menuContextUpdatePerformer |
Email to supervisor | menuContextEmailSupervisor |
Email to performers | menuContextEmailPerformer |
Manage supporting files | menuContextManageAttachmentsSV |
Abort workflow | menuContextAbortWorkflow |
Menu item name | Menu Id |
---|
Add items | menuContextAddToCollectionItems |
Rename | menuContextRenameCollection |
Delete | menuContextDestroy |
Menu item name | Menu Id |
---|
Properties | menuContextProperties |
Copy link | menuContextCopyLink |
Edit | menuContextEdit |
Add version | menuContextAddVersion |
Checkout | menuContextCheckout |
Cancel checkout | menuContextCancelCheckout |
Permissions | menuContextPermissions |
Print | menuDocumentPrint |
Download | menuContextDownload |
Export properties | menuContextExport |
Remove | menuContextRemoveFromCollection |
Add to collection | menuContextAddToCollection |
Create relation | menuContextRelationCreate |
View native content | menuDocumentViewNative |
Convert to virtual document | menuContextConvertToVD |
Convert to virtual document | menuContextConvertFolderToVD |
Display outline | menuNewOpenVD |
Display snapshot | menuNewOpenSVVDSnapshot |
Lifecycle | menuContextDocumentLifeCycle |
Send to workflow | menuContextDocumentWorkflow |
Mass update | menuToolsMassUpdate |
Menu item name | Menu Id |
---|
Dynamic display D2 lifecycle start state | dynamicMenuDocumentD2LifeCycleAttach |
Dynamic display of D2/DCTM state | dynamicMenuDocumentD2LifeCycleNextStates |
Dynamic display of DCTM lifecycle | dynamicMenuDocumentLifeCycleAttach |
Detach | menuDocumentLifeCycleDetach |
Promote | menuDocumentLifeCyclePromote |
Demote | menuDocumentLifeCycleDemote |
Suspend | menuDocumentLifeCycleSuspend |
Resume | menuDocumentLifeCycleResume |
Menu item name | Menu Id |
---|
Dynamic display of D2 workflow | dynamicMenuDocumentD2Workflow |
Menu item name | Menu Id |
---|
Dynamic display D2 mass updates | dynamicMenuToolsMassUpdate |
Menu item name | Menu Id |
---|
Browse | menuSVVDAddChildBrowse |
Create | menuVDAddChildCreate |
Upload | menuSVVDAddChildImport |
From template | menuSVVDAddChildTemplate |
Menu item name | Menu Id |
---|
Browse | menuVDReplaceChildBrowse |
Create | menuVDReplaceChildCreate |
Upload | menuSVVDReplaceChildImport |
Menu item name | Menu Id |
---|
Highest | menuContextTaskPriorityHighest |
High | menuContextTaskPriorityHigh |
Normal | menuContextTaskPriorityNormal |
Low | menuContextTaskPriorityLow |
Lowest | menuContextTaskPriorityLowest |
Defining the delta changes in the xml
Menu item in the D2 will follow the below structure
<menuitem id="MenuId">
<dynamic-action class="ClassName"/>
<condition class="ClassName" equals="value"/>
</menuitem>
Here we have mainly 3 part for the menu as follows
- menuitem: define the menu item which will have a id attribute. The id attribute can be used
to define label and is also a unique identifier.
- dynamic-action: developer can define a class which is extended from the
IDynamicAction
.
This tag is used to define the action that has to be performed when the menu item is clicked. - condition: developer can define condition which has to be extended from
ICondition
Depending on the class custom attributes can be passed to the tag for both dynamic-action
and condition
In order to define the menu item we need to understand the root tag as delta
tag.
Following are the operations that can done on the menu item
- insert - This will be used to insert a new menu item. This tag mandates attributes such as
position-before
or position-after
which will define menu id before or after which the current menu item has to be placed. - append - This will be used to append menu item to the end of the menus.
- modify -Requires id attribute which is a reference to any
existing menu item id which has to be modified. This can can be used to
delete
, insert
,
append
and insert-before
. - delete - This requires an id attribute which will refer to the menu id that has to be deleted.
- insert-before - This can be used along with the
modify
to add new conditions. - move- This can be used to move an exiting menu by using the menu id with the attributes
position-before
or position-after
.
position-before
and position-after
attributes contains the menu id of other menus- menu id, class names for the dynamic actions and conditions can be discovered by
creating menu items in D2-Config and exporting the menus.
Find below some of the ways to use delta menus:
- Insert new menu
<delta>
<insert position-before="menuToolsMassUpdate">
<menuitem id="menuContextViewPermission">
<dynamic-action class="com.emc.d2fs.dctm.ui.dynamicactions.actions.U4Generic" eMethod="getPermissions" eMode="SINGLE" eService="PermissionActionService" rAction="${pluginNamespace}/dialogs/permissions/permissions.dialog:showPermissions" rType="JS"/>
<condition class="com.emc.d2fs.dctm.ui.conditions.interfaces.IsMultipleSelection" equals="false"/>
<condition class="com.emc.d2fs.dctm.ui.conditions.options.IsPluginActivated" value="${pluginName}"/>
</menuitem>
</insert>
<insert position-before="menuToolsMassUpdate">
<separator/>
</insert>
</delta>
- Modify an existing menu with new conditions
<delta>
<modify id="menuDocumentEdit">
<insert-before>
<condition class="com.emc.d2fs.dctm.ui.conditions.typeparts.IsObjectType" value="d2c_bin_deleted_document¬d2c_bin_deleted_folder¬d2c_bin_deleted_folder_dump¬d2c_bin_deleted_rendition" equals="false"/>
</insert-before>
</modify>
</delta>
Overriding the default post action behavior
There are basically 3 types of post action that can be performed on the selected objects
after the completion of the dialog service operation. Those operation can be set as an attribute
on the new custom menus created which will define as the default behavior
- Locate content and refresh state upon action : This will locate the object and update the state of the object
selected. For example, if you are performing some operation which will move the selected object from
one location to another. Then this attribute will help the user to identify where it is located
as well as refreshing the state of the current container. Attribute used for this is
locateAndRefresh
- Refresh state : This will refresh the state of the object selected post dialog operation. For example,
if you have performed a lifecycle operation or a property update as part of the validDialog(.) then
if you want to have the updated menus as well as values in the selected item in the widget we would need
to set this value as part fo the result. Attribute used for this is
refreshCheckoutState
- Refresh widget : This will reload the widget post the operation. Attribute used for this is
refreshWidget
Sample Code
<menuitem id="menuRefreshDialog">
<dynamic-action class="com.emc.d2fs.dctm.ui.dynamicactions.actions.U4ShowDialog"
dialog="RefreshDialog"
locateAndRefresh="false"
refreshWidget="false"
refreshCheckoutState="true"/>
</menuitem>
- Supported values are "true"/"false".
- Default value if not set is false.
- this value updated in D2-Config will override the default value given in the delta xml.