Examples of MenuRepository


Examples of net.sf.navigator.menu.MenuRepository

  /**
   * This method refreshs the menu.
   */
  private void refreshMenu(HttpServletRequest request) throws Exception {
    MenuRepository oldRepository = (MenuRepository) getServlet()
        .getServletContext().getAttribute(
            MenuRepository.MENU_REPOSITORY_KEY);
    MenuRepository menu = menuService.buildMenu(oldRepository,
        (Collection) request.getSession().getAttribute(
            ConsoleCst.APPLICATIONS_SESSION_BEAN),
        (Collection) request.getSession().getAttribute(
            ConsoleCst.CONNECTIONS_SESSION_BEAN), (String) request
            .getSession().getAttribute(
View Full Code Here

Examples of net.sf.navigator.menu.MenuRepository

  /**
   * This method refreshs the menu.
   */
  private void refreshMenu(HttpServletRequest request, String idthrows Exception {
    MenuRepository oldRepository = (MenuRepository) getServlet()
        .getServletContext().getAttribute(
            MenuRepository.MENU_REPOSITORY_KEY);
    MenuRepository menu = menuService.buildConMenu(oldRepository,
        (Collection) request.getSession().getAttribute(
            ConsoleCst.APPLICATIONS_SESSION_BEAN),
        (Collection) request.getSession().getAttribute(
            ConsoleCst.CONNECTIONS_SESSION_BEAN), (String) request
            .getSession().getAttribute(
View Full Code Here

Examples of net.sf.navigator.menu.MenuRepository

    request.getSession().setAttribute(ConsoleCst.INTFILTER_SESSION_BEAN,intFilters);
    request.getSession().setAttribute(ConsoleCst.IS_APPLICATION_MODIFIED,ConsoleCst.APPLICATION_NOT_MODIFIED);
    request.getSession().setAttribute(ConsoleCst.TYPES_SESSION_BEAN,TYPE_LIST);

    // get menu
    MenuRepository oldRepository = (MenuRepository) getServlet().getServletContext().getAttribute(MenuRepository.MENU_REPOSITORY_KEY);
    // build new menu
    MenuRepository menu = menuService.buildMenu(oldRepository,applications,connections,ConsoleCst.APPLICATION_NOT_MODIFIED,(String) request.getSession().getAttribute("applicationId"));
    // add menu to session
    request.getSession().setAttribute(ConsoleCst.NODE_LIST,menu);

    return mapping.findForward("connections");
  }
View Full Code Here

Examples of net.sf.navigator.menu.MenuRepository

  private List connections;

  protected void setUp() throws Exception {
    super.setUp();
    menuService = new MenuServiceImpl();
    oldRepository = new MenuRepository();
    MenuComponent mc = new MenuComponent();
    mc.setName("Exemple");
    mc.setTitle("Exemple");
    mc.setLocation("#");
    oldRepository.addMenu(mc);
View Full Code Here

Examples of net.sf.navigator.menu.MenuRepository

    Connection connection = new Connection("Conx1");
    connections.add(connection);
  }

  public void test01BuildMenu() throws Exception {
    MenuRepository menu = menuService.buildMenu(oldRepository, applications, connections,ConsoleCst.APPLICATION_MODIFIED,((Application)applications.get(0)).getId());
    assertNotNull("menu must not be null",menu);
  }
View Full Code Here

Examples of net.sf.navigator.menu.MenuRepository

    setRequestPathInfo("/console");
    addRequestParameter("method","init");
    actionPerform();
    verifyForward("home");
    verifyNoActionErrors();
    MenuRepository repository = (MenuRepository) getRequest().getSession().getAttribute("nodeList");
    assertNotNull("menu must not be null",repository);
    assertNotNull("Applications menu must exist",repository.getMenu("Applications"));
    assertNotNull("Connections menu must exist",repository.getMenu("Connections"));
    List applications = (List) getRequest().getSession().getAttribute("applications");
    List connections = (List) getRequest().getSession().getAttribute("connections");
    assertNotNull("applications must exist in session",applications);
    assertNotNull("connections must exist in session",connections);
  }
View Full Code Here

Examples of net.sf.navigator.menu.MenuRepository

  /**
   * This method refreshs the menu.
   */
  private void refreshMenu(HttpServletRequest request) throws Exception {
    MenuRepository oldRepository = (MenuRepository) getServlet()
        .getServletContext().getAttribute(
            MenuRepository.MENU_REPOSITORY_KEY);
    MenuRepository menu = menuService.buildMenu(oldRepository,
        (Collection) request.getSession().getAttribute(
            ConsoleCst.APPLICATIONS_SESSION_BEAN),
        (Collection) request.getSession().getAttribute(
            ConsoleCst.CONNECTIONS_SESSION_BEAN), (String) request
            .getSession().getAttribute(
View Full Code Here

Examples of net.sf.navigator.menu.MenuRepository

    super.setUp();
    ApplicationContext context = new FileSystemXmlApplicationContext("/src/webapp/WEB-INF/applicationContext.xml");
    mm = (LdapTreeBuilderImpl) context.getBean("ldapTreeBuilder");
  }
  public void testBuildMenu() throws Exception {
    MenuRepository mr = new MenuRepository();
    MenuRepository newmr = mm.buildTree(mr,"o=canam","/console-web/ldapbrowser.do");
    assertNotNull(newmr);
    newmr.getMenu("o=canam");
  }
View Full Code Here

Examples of net.sf.navigator.menu.MenuRepository

import fr.norsys.mapper.console.utils.URLEncoderUtil;

public class MenuServiceImpl implements MenuService {
  public MenuRepository buildMenu(MenuRepository oldRepository,
      Collection applications, Collection connexions, String isAppliModified, String currentAppli) {
        MenuRepository repository = new MenuRepository();
        repository.setDisplayers(oldRepository.getDisplayers());

        MenuComponent conMenu = new MenuComponent();
        conMenu.setName("Connections");
        conMenu.setTitle("Connections");
        conMenu.setLocation("javascript:saveBeforeLoad('"+isAppliModified+"','"+currentAppli+"','connection.do?method=init')");
    repository.addMenu(conMenu);
   
    for(Iterator it=connexions.iterator();it.hasNext();) {
          MenuComponent mc = new MenuComponent();
          Connection connection = (Connection) it.next();
          String name = connection.getName();
          mc.setName(name);
          mc.setTitle(name);
          mc.setLocation("javascript:saveBeforeLoad('"+isAppliModified+"','"+currentAppli+"','connection.do?method=edit&forward=connection&id="+URLEncoderUtil.escape(connection.getId())+"')");
          mc.setParent(conMenu);
    }

    MenuComponent appliMenu = new MenuComponent();
    appliMenu.setName("Applications");
        appliMenu.setTitle("Applications");
        appliMenu.setLocation("javascript:saveBeforeLoad('"+isAppliModified+"','"+currentAppli+"','application.do?method=init')");
    repository.addMenu(appliMenu);
    for(Iterator it=applications.iterator();it.hasNext();) {
          MenuComponent mc = new MenuComponent();
          Application application = (Application) it.next();
          String name = application.getName();
          mc.setName(name);
View Full Code Here

Examples of net.sf.navigator.menu.MenuRepository

    }
    return repository;
  }
    public MenuRepository buildConMenu(MenuRepository oldRepository,
        Collection applications, Collection connexions, String isConModified, String con) {
          MenuRepository repository = new MenuRepository();
          repository.setDisplayers(oldRepository.getDisplayers());

          MenuComponent conMenu = new MenuComponent();
          conMenu.setName("Connections");
          conMenu.setTitle("Connections");
          conMenu.setLocation("javascript:saveConBeforeLoad('"+isConModified+"','"+con+"','connection.do?method=init')");
      repository.addMenu(conMenu);
     
      for(Iterator it=connexions.iterator();it.hasNext();) {
            MenuComponent mc = new MenuComponent();
            Connection connection = (Connection) it.next();
            String name = connection.getName();
            mc.setName(name);
            mc.setTitle(name);
            mc.setLocation("javascript:saveConBeforeLoad('"+isConModified+"','"+con+"','connection.do?method=edit&forward=connection&id="+URLEncoderUtil.escape(connection.getId())+"')");
            mc.setParent(conMenu);
      }

      MenuComponent appliMenu = new MenuComponent();
      appliMenu.setName("Applications");
          appliMenu.setTitle("Applications");
          appliMenu.setLocation("javascript:saveConBeforeLoad('"+isConModified+"','"+con+"','application.do?method=init')");
      repository.addMenu(appliMenu);
      for(Iterator it=applications.iterator();it.hasNext();) {
            MenuComponent mc = new MenuComponent();
            Application application = (Application) it.next();
            String name = application.getName();
            mc.setName(name);
View Full Code Here
TOP
Copyright © 2018 www.massapi.com. All rights reserved.
All source code are property of their respective owners. Java is a trademark of Sun Microsystems, Inc and owned by ORACLE Inc. Contact coftware#gmail.com.