Delete relation condition Sample
This sample shows how to add a custom condition in Delete Relation menu to prevent user from deleting relationship if parent is part of any running workflow
Instruction to try out the sample
- Build the plugin using
npm run buildfrom SDK workspace root. - Copy
D2-Delete-Relation-Condition-1.0.0.jarfrom 'dist' folder in workspace root and paste it insideWEB-INF/libfolder of a deployed D2 SmartView application. - Copy
D2-Delete-Relation-Condition-1.0.0.jarfrom 'dist' folder in workspace root and paste it insideWEB-INF/classes/pluginsfolder of a deployed D2 Config application. - Add an entry for plugin
D2-Delete-Relation-Condition-1.0.0.jarinD2-Config.propertiesfile insideWEB-INF/classesfolder of a deployed D2 Config application. - Restart application server on which D2 SmartView and D2 Config are deployed.
- Login into D2 Config and add the condition in Delete Relation menu under Menu Smart View.
Source code structure
D2-Delete-Relation-Condition
¦ pom.xml
¦
+---src
¦ +---main
¦ | +---java
¦ | ¦ +---com
¦ | ¦ +---emc
¦ | ¦ ¦ D2PluginVersion.java
¦ | ¦ ¦
¦ | ¦ +---opentext
¦ | ¦ +---d2
¦ | ¦ +---rest
¦ | ¦ ¦ +---context
¦ | ¦ ¦ +---jc
¦ | ¦ ¦ PluginRestConfig_Deleterelationcondition.java
¦ | ¦ ¦
¦ | ¦ +---smartview
¦ | ¦ +---deleterelationcondition
¦ | ¦ ¦ DeleterelationconditionPlugin.java
¦ | ¦ ¦
¦ | ¦ +---api
¦ | ¦ ¦ DeleterelationconditionVersion.java
¦ | ¦ ¦
¦ | ¦ +---rest
¦ | ¦ package-info.java
¦ | ¦ ¦
¦ | ¦ +---webfs
¦ | ¦ +---ui
¦ | ¦ +---conditions
¦ | ¦ +---relations
¦ | ¦ DeleteRelationConditionally.java
¦ | ¦
¦ | +---resources
¦ | ¦ ¦ deleterelationcondition-version.properties
¦ | ¦ ¦ D2Plugin.properties
¦ | ¦ ¦
¦ | ¦ +---com
¦ | ¦ +---opentext
¦ | ¦ +---plugin
¦ | ¦ +---deleterelationcondition
¦ | ¦ +---webfs
¦ | ¦ +---ui
¦ | ¦ +---conditions
¦ | ¦ ¦ relations_en.properties
¦ | ¦ ¦
¦ | ¦ +---relations
¦ | ¦ DeleteRelationConditionally_en.properties
Files and their purpose
Following are the list of function oriented source files and their purpose. Other source files present within the plugin are part of common infrastructure code and explained in Understanding D2SV plugin project.
Menu condition to delete relation conditionally
- src/main/java/com/opentext/plugin/deleterelationcondition/webfs/ui/conditions/relations/DeleteRelationConditionally.java - Here we are defining the ICondition class which can be used to add a condition in the Delete Relation menu.
- src/main/resources/com/opentext/plugin/deleterelationcondition/webfs/ui/conditions/relations/DeleteRelationConditionally_en.properties defines labels for the condition in D2 Config
- src/main/resources/com/opentext/plugin/deleterelationcondition/webfs/ui/conditions/relations_en.properties defines group label for the condition in D2 Config