Adding a new context menu item to the resource's context menu in the explorer is fairly easy since OpenCms 10.
The example generates a new main menu item "Greet" with a subitem "Say Hello". Clicking on the sub-item you get an alert message, saying hello.
The visibility of the menu items is as follows:
This is illustrated by the following figures.