} catch (Exception e) {
throw new PluginException("Failed to register resource type.", e);
}
// Add the new items to the main menu
MenuTree tree = NavigationManager.getMenuTree(CoreMenuTree.MENU_ITEM_MENU_TREE);
tree.addMenuItem("resources", new MenuItem("userSamples", "sample", "/showUserSamples.do", 50, true, null,
SessionInfo.USER_CONSOLE_CONTEXT, null, null, Sample.SAMPLE_RESOURCE_TYPE));
tree.addMenuItem("globalResources", new MenuItem("managementSamples", "sample", "/showSamples.do", 50, true, null,
SessionInfo.MANAGEMENT_CONSOLE_CONTEXT, Sample.SAMPLE_RESOURCE_TYPE, new Permission[] {
PolicyConstants.PERM_CREATE_EDIT_AND_ASSIGN, PolicyConstants.PERM_EDIT_AND_ASSIGN,
PolicyConstants.PERM_DELETE }, Sample.SAMPLE_RESOURCE_TYPE));
// Add the new page tasks
MenuTree pageTasks = NavigationManager.getMenuTree(PageTaskMenuTree.PAGE_TASK_MENU_TREE);
pageTasks.addMenuItem(null, new MenuItem("showSamples", null, null, 100, false, SessionInfo.MANAGEMENT_CONSOLE_CONTEXT));
pageTasks.addMenuItem("showSamples", new MenuItem("createSample", "sample", "/sampleDefaultDetails.do", 100, true, "_self",
SessionInfo.MANAGEMENT_CONSOLE_CONTEXT, Sample.SAMPLE_RESOURCE_TYPE,
new Permission[] { PolicyConstants.PERM_CREATE_EDIT_AND_ASSIGN }));
// This demonstrates listening for events. In this case we will look for
// 'sample created' events and display a message on the console