AnsweredAssumed Answered

Adding a menu item from code

Question asked by br36524 on Feb 2, 2016
Latest reply on Jul 26, 2016 by pyotr

When adding “tool link”-menu item from code, the menu item does not appear in the menu.

If I toggle the Student Preview or edit another menu item from the GUI then it appears.

 

Any ideas what I am doing wrong?

 

blackboard.data.navigation.CourseToc courseToc = new CourseToc();

courseToc.setCourseId(courseId);

courseToc.setTargetType(blackboard.data.navigation.CourseToc.Target.APPLICATION);

courseToc.setLabel("My Menu Item");

courseToc.setLaunchInNewWindow(false);

courseToc.setInternalHandle("auus-aucem-nav-course_info");

courseToc.setIsEnabled(true);

courseToc.setAllowGuests(false);

try {

  blackboard.persist.navigation.CourseTocDbPersister.Default.getInstance().persist(courseToc);

} catch (PersistenceException | ValidationException e1) {

  e1.printStackTrace();

}

 

 

auus-aucem-nav-course_info” is specified as a handle in the manifest under application-defs, and once the menu item does appear it works correctly. The issue is just to have the generated menu item appearing.

Outcomes