Package fr.norsys.mapper.console.model

Examples of fr.norsys.mapper.console.model.Connection


    if (log.isDebugEnabled()) {
      log.debug("init method called");
    }
    DynaActionForm connectionForm = (DynaActionForm) form;
    connectionForm
        .set(ConsoleCst.CONNECTION_REQUEST_BEAN, new Connection());
    request.getSession().setAttribute(ConsoleCst.IS_APPLICATION_MODIFIED,
        ConsoleCst.APPLICATION_NOT_MODIFIED);
    refreshMenu(request, "");
    return mapping.findForward(ConsoleCst.CONNECTIONS_PAGE_FORWARD);
  }
View Full Code Here


      throws Exception {
    if (log.isDebugEnabled()) {
      log.debug("save method called");
    }
    DynaActionForm connectionForm = (DynaActionForm) form;
    Connection connection = (Connection) connectionForm
        .get(ConsoleCst.CONNECTION_REQUEST_BEAN);
    String forward = request.getParameter("forward");
    if (log.isDebugEnabled()) {
      log.debug(connection);
    }
    connectionService.save(connection, (Collection) request.getSession()
        .getAttribute(ConsoleCst.CONNECTIONS_SESSION_BEAN));
    String caller = request.getParameter("caller");
    if (!"connections".equals(caller)) {
      request.getSession().setAttribute(
          ConsoleCst.IS_CONNECTION_MODIFIED,
          ConsoleCst.CONNECTION_MODIFIED);
    }
    refreshMenu(request, connection.getId());
    return mapping.findForward(forward);
  }
View Full Code Here

      throws Exception {
    if (log.isDebugEnabled()) {
      log.debug("delete method called");
    }
    DynaActionForm connectionForm = (DynaActionForm) form;
    Connection connection = (Connection) connectionForm
        .get(ConsoleCst.CONNECTION_REQUEST_BEAN);
    connectionService
        .delete(connection.getId(), (Collection) request.getSession()
            .getAttribute(ConsoleCst.CONNECTIONS_SESSION_BEAN));
    refreshMenu(request, connection.getId());
    blankConnectionBean(form);
    return mapping.findForward(ConsoleCst.CONNECTIONS_PAGE_FORWARD);
  }
View Full Code Here

    String forward = request.getParameter("forward");
    DynaActionForm connectionForm = (DynaActionForm) form;
    if (log.isDebugEnabled()) {
      log.debug(id);
    }
    Connection connection = null;
    if (id != null && !"".equals(id)) {
      connection = connectionService.get(id, (Collection) request
          .getSession().getAttribute(
              ConsoleCst.CONNECTIONS_SESSION_BEAN));
      if (connection == null || connection.getUrl() == null) {
        String name = connection.getName();
        Map map;
        map = propertyService.getProperty(connectionService
            .getConnectionsDirPath()
            + name + ".properties");
        if (log.isDebugEnabled()) {
View Full Code Here

                ConsoleCst.IS_CONNECTION_MODIFIED), id);
    request.getSession().setAttribute("nodeList", menu);
  }

  private void blankConnectionBean(ActionForm form) {
    ((DynaActionForm) form).set("connection", new Connection());
  }
View Full Code Here

    oldRepository.addMenu(mc);
    applications = new ArrayList();
    Application application = new Application("Appli1");
    applications.add(application);
    connections = new ArrayList();
    Connection connection = new Connection("Conx1");
    connections.add(connection);
  }
View Full Code Here

    addRequestParameter("method", "init");
    actionPerform();
    verifyForward("connections");
    verifyNoActionErrors();
    DynaActionForm form = (DynaActionForm) getRequest().getAttribute("connectionForm");
    Connection connection = (Connection) form.get("connection");
    assertNotNull("connection not null",connection);
    assertNull("connection id must be null",connection.getId());
  }
View Full Code Here

  }
  public void test02Save() {
    List oldConnections = (List) getRequest().getAttribute("connections");
    setRequestPathInfo("/connection");
    DynaActionForm form = new DynaActionForm();
    Connection connection = new Connection();
    form.set("connection",connection);
    setActionForm(form);
    addRequestParameter("method", "save");
    addRequestParameter("forward", "connection");
    actionPerform();
View Full Code Here

public class BeanUtilsTest extends TestCase {
  protected void setUp() throws Exception {
    super.setUp();
  }
  public void testToMap() {
    Connection con = new Connection("con1");
    con.setUser("user1");
    con.setUrl("url");
    Map map = BeanUtils.toMap(con);
    assertNotNull(map);
    assertEquals("value of user key must be user1","user1",map.get("user"));
  }
View Full Code Here

    assertEquals("value of user key must be user1","user1",map.get("user"));
  }
  public void testToObject() {
    Map map = new HashMap();
    map.put("user","user1");
    Connection con = new Connection();
    BeanUtils.toObject(map,con);
    assertNotNull("must not be null",con);
    assertEquals("user name must be source1","user1",con.getUser());
  }
View Full Code Here

TOP

Related Classes of fr.norsys.mapper.console.model.Connection

Copyright © 2018 www.massapicom. 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.