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.
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 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
MenuContextDetailRelations( Relations )
Menu item name | Menu Id |
---|---|
Delete relationship | menuContextRelationsDestroy |
MenuContextDetailRenditions( Renditions )
Menu item name | Menu Id |
---|---|
Export rendition | menuContextRenditionsExport |
Delete rendition | menuContextRenditionsRemove |
MenuContextDetailVersions( Versions )
Menu item name | Menu Id |
---|---|
Properties | menuContextProperties |
MenuContext( Action Toolbar )
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 |
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 |
MenuNewObject( + Menu )
Menu item name | Menu Id |
---|---|
Add file | menuNewObjNewDocument |
Upload file | menuNewObjImportDocument |
Add folder | menuNewObjNewFolder |
Add cabinet | menuNewObjNewCabinet |
Upload folder | menuNewObjImportFolderStructure |
MenuUser( User Menu )
Menu item name | Menu Id |
---|---|
User settings | menuUserSettings |
Help | menuHelpContents |
About D2 | menuHelpAbout |
Sign out | svMenuUserLogout |
MenuContextVD( VDoc Action Toolbar )
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 |
MenuContextTasksList( Tasks )
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 |
MenuContextTaskDocument( Task Documents Actions Toolbar )
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 |
MenuContextWorkflowOverview( Workflow Actions Toolbar )
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 |
MenuContextCollection( Collections )
Menu item name | Menu Id |
---|---|
Add items | menuContextAddToCollectionItems |
Rename | menuContextRenameCollection |
Delete | menuContextDestroy |
MenuContextCollectionItems( Collections Items Action Toolbar)
Menu item name | Menu Id |
---|---|
Properties | menuContextProperties |
Copy link | menuContextCopyLink |
Edit | menuContextEdit |
Add version | menuContextAddVersion |
Checkout | menuContextCheckout |
Cancel checkout | menuContextCancelCheckout |
Permissions | menuContextPermissions |
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 |
Sub menu contexts which are used for lifecycle/workflows/mass update/vdoc actions
MenuDocumentLifeCycle (Lifecycle sub menus)
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 |
MenuDocumentWorkflow (Workflow sub menus)
Menu item name | Menu Id |
---|---|
Dynamic display of D2 workflow | dynamicMenuDocumentD2Workflow |
MenuToolsMassUpdate (Mass update sub menus)
Menu item name | Menu Id |
---|---|
Dynamic display D2 mass updates | dynamicMenuToolsMassUpdate |
MenuContextVDAddChildOption( Add Child submenu in VDoc action toolbar )
Menu item name | Menu Id |
---|---|
Browse | menuSVVDAddChildBrowse |
Create | menuVDAddChildCreate |
Upload | menuSVVDAddChildImport |
From template | menuSVVDAddChildTemplate |
MenuContextVDReplaceChildOption( Replace Child submenu context in VDoc action toolbar )
Menu item name | Menu Id |
---|---|
Browse | menuVDReplaceChildBrowse |
Create | menuVDReplaceChildCreate |
Upload | menuSVVDReplaceChildImport |
MenuContextTaskPriority( Change task priority sub-menu in Tasks toolbar)
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 an 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
orposition-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
andinsert-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
orposition-after
.
position-before
andposition-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.
System Defined Menu Conditions
What are System Defined Menu Conditions?
System defined menu conditions are the default or implicit conditions applied to menu item. These are set of validation rules declared by the source code developer which a D2-Config user can neither modify nor remove.
If the developer wants to apply system-defined condition(s) to menu configuration(s), then developer need to create a MenuSystemDefinedConditionsDelta.xml file to
define those changes in the following path:
resources/xml/unitymenu/rules/
For example:
resources/xml/unitymenu/rules/MenuSystemDefinedConditionsDelta.xml
Sample Code
<system-conditions>
<system-condition>
<dynamic-action class="com.emc.d2fs.dctm.ui.dynamicactions.events.U4Publish" event="D2_ACTION_CUT" />
<condition class="com.emc.d2fs.dctm.ui.conditions.permits.HasClientCapability" value="contributor"/>
</system-condition>
</system-conditions>
Whenever a configured menu item matches all the attributes of <dynamic-action>
, then the corresponding condition(s) will be applied as default condition(s) which evaluates the visibility of the menu item.
Referring to the above XML, if a menu is configured with dynamic-action
class value of U4Publish
and event value of D2_ACTION_CUT
, the condition for the user with a HasClientCapability
value of contributor
will be applied as default condition.
While evaluating the visibility of a menu item, condition(s) defined under system-condition will be checked first, after that, any additional condition(s) configured for the menu item in D2-Config will be evaluated.
These system-defined conditions will be honored, but they will not be reflected in D2-Config.