Skip to main content

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.

tip

using the ws assistant, developers can try to create a new menu for the custom d2fs dialogs. Add D2FS dialog to a plugin)

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.

info

Details regarding each of the menus can be found in the D2 admin guide

Menu item nameMenu Id
Delete relationshipmenuContextRelationsDestroy
Menu item nameMenu Id
Export renditionmenuContextRenditionsExport
Delete renditionmenuContextRenditionsRemove
Menu item nameMenu Id
PropertiesmenuContextProperties
Menu item nameMenu Id
PropertiesmenuContextProperties
Copy linkmenuContextCopyLink
SharemenuContextShare
EditmenuContextEdit
CutmenuContextCut
CopymenuContextCopy
PastemenuContextPaste
Paste as linkmenuContextPasteLink
Add versionmenuContextAddVersion
CheckoutmenuContextCheckout
Cancel checkoutmenuContextCancelCheckout
PermissionsmenuContextPermissions
PrintmenuDocumentPrint
DownloadmenuContextDownload
Export propertiesmenuContextExport
DeletemenuContextDestroy
Add to collectionmenuContextAddToCollection
Create relationmenuContextRelationCreate
View native contentmenuDocumentViewNative
Convert to virtual documentmenuContextConvertToVD
Convert to virtual documentmenuContextConvertFolderToVD
Display outlinemenuNewOpenVD
Display snapshotmenuNewOpenSVVDSnapshot
LifecyclemenuContextDocumentLifeCycle
Send to workflowmenuContextDocumentWorkflow
Mass updatemenuToolsMassUpdate
Menu item nameMenu Id
Add filemenuNewObjNewDocument
Upload filemenuNewObjImportDocument
Add foldermenuNewObjNewFolder
Add cabinetmenuNewObjNewCabinet
Upload foldermenuNewObjImportFolderStructure
Menu item nameMenu Id
User settingsmenuUserSettings
HelpmenuHelpContents
About D2menuHelpAbout
Sign outsvMenuUserLogout
Menu item nameMenu Id
DownloadmenuContextVDDownload
EditmenuContextVDEdit
CheckoutmenuContextVDCheckout
Check inmenuContextSVVDCheckin
Cancel checkoutmenuContextVDCancelCheckout
Add childmenuContextVDAddChild
Create snapshotmenuContextSVVDSnapshotCreate
Convert to virtual documentmenuContextVDConvertToVd
Convert to simple documentmenuContextVDConvertToSimpleDoc
Set to versionmenuContextSVVDSetBinding
ReplacemenuContextSVVDReplaceChild
RemovemenuContextSVVDRemoveChild
LifecyclemenuContextDocumentLifeCycle
Send to workflowmenuContextDocumentWorkflow
Menu item nameMenu Id
AcquiremenuContextAcquireTaskSV
AcceptmenuContextForwardTaskSV
RejectmenuContextRejectTaskSV
Pause taskmenuContextPauseTask
Resume taskmenuContextResumeTask
RerunmenuContextRerunTask
CompletemenuContextCompleteTask
DelegatemenuContextDelegateTaskSV
Update performersmenuContextUpdatePerformer
Manage supporting filesmenuContextManageAttachmentsSV
Change task prioritymenuContextTaskPriority
Mark as unreadmenuContextTaskUnread
Mark as readmenuContextTaskRead
Add notemenuContextAddTaskNoteSV
Email to performermenuContextSVEmailPerformer
Abort workflowmenuContextAbortWorkflow
Menu item nameMenu Id
PropertiesmenuContextProperties
Go to locationmenuContextGotoLocation
Copy linkmenuContextCopyLink
DownloadmenuContextDownload
Export propertiesmenuContextExport
EditmenuContextEdit
Add to collectionmenuContextAddToCollection
Add versionmenuContextAddVersion
Cancel checkoutmenuContextCancelCheckout
Menu item nameMenu Id
Start workflowmenuContextLaunchScheduledWorkflow
Pause workflowmenuContextPauseWorkflow
Resume workflowmenuContextResumeWorkflow
Change supervisormenuContextChangeSupervisor
Update performersmenuContextUpdatePerformer
Email to supervisormenuContextEmailSupervisor
Email to performersmenuContextEmailPerformer
Manage supporting filesmenuContextManageAttachmentsSV
Abort workflowmenuContextAbortWorkflow
Menu item nameMenu Id
Add itemsmenuContextAddToCollectionItems
RenamemenuContextRenameCollection
DeletemenuContextDestroy
Menu item nameMenu Id
PropertiesmenuContextProperties
Copy linkmenuContextCopyLink
EditmenuContextEdit
Add versionmenuContextAddVersion
CheckoutmenuContextCheckout
Cancel checkoutmenuContextCancelCheckout
PermissionsmenuContextPermissions
PrintmenuDocumentPrint
DownloadmenuContextDownload
Export propertiesmenuContextExport
RemovemenuContextRemoveFromCollection
Add to collectionmenuContextAddToCollection
Create relationmenuContextRelationCreate
View native contentmenuDocumentViewNative
Convert to virtual documentmenuContextConvertToVD
Convert to virtual documentmenuContextConvertFolderToVD
Display outlinemenuNewOpenVD
Display snapshotmenuNewOpenSVVDSnapshot
LifecyclemenuContextDocumentLifeCycle
Send to workflowmenuContextDocumentWorkflow
Mass updatemenuToolsMassUpdate
Menu item nameMenu Id
Dynamic display D2 lifecycle start statedynamicMenuDocumentD2LifeCycleAttach
Dynamic display of D2/DCTM statedynamicMenuDocumentD2LifeCycleNextStates
Dynamic display of DCTM lifecycledynamicMenuDocumentLifeCycleAttach
DetachmenuDocumentLifeCycleDetach
PromotemenuDocumentLifeCyclePromote
DemotemenuDocumentLifeCycleDemote
SuspendmenuDocumentLifeCycleSuspend
ResumemenuDocumentLifeCycleResume
Menu item nameMenu Id
Dynamic display of D2 workflowdynamicMenuDocumentD2Workflow
Menu item nameMenu Id
Dynamic display D2 mass updatesdynamicMenuToolsMassUpdate
Menu item nameMenu Id
BrowsemenuSVVDAddChildBrowse
CreatemenuVDAddChildCreate
UploadmenuSVVDAddChildImport
From templatemenuSVVDAddChildTemplate
Menu item nameMenu Id
BrowsemenuVDReplaceChildBrowse
CreatemenuVDReplaceChildCreate
UploadmenuSVVDReplaceChildImport
Menu item nameMenu Id
HighestmenuContextTaskPriorityHighest
HighmenuContextTaskPriorityHigh
NormalmenuContextTaskPriorityNormal
LowmenuContextTaskPriorityLow
LowestmenuContextTaskPriorityLowest

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
tip

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.
tip
  1. position-before and position-after attributes contains the menu id of other menus
  2. 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:

  1. 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>
  2. 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

  1. 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
  2. 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
  3. 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>
info
  1. Supported values are "true"/"false".
  2. Default value if not set is false.
  3. this value updated in D2-Config will override the default value given in the delta xml.