Package com.eforce.baby.auth.vo

Examples of com.eforce.baby.auth.vo.DistributionGroupVO


    {
      con = this.createConnection(dsName);
      String sql = QueryManager.getInstance().getFindDIstributionGroupsQuery(dbType);
      pStmt = con.prepareStatement(sql);
      rs = pStmt.executeQuery();
      DistributionGroupVO vo = null;
      while( rs.next() )
      {
        vo = new DistributionGroupVO();
        vo.setId(rs.getString(1));
        vo.setDistGroupName(rs.getString(2));
        vo.setDistGroupDesc(rs.getString(3));
        list.add( vo );
      }
    }
    catch (SQLException e)
    {
View Full Code Here


   * @throws DAOException
   */
  public DistributionGroupVO findDistGroup(String dsName, String dbType, String reportID) throws DAOException
  {
     Connection con = super.createConnection(dsName);
     DistributionGroupVO distGroupVO =  new DistributionGroupVO();
     distGroupVO.setId(reportID);
    PreparedStatement pstmt=null;
    ResultSet rset=null;
   
     log.debug("start of DB Fetch");
     try {
       String sql = QueryManager.getInstance().getFindDistGroup(dbType);
       pstmt = con.prepareStatement(sql);
       log.debug(sql);
       pstmt.setString(1, distGroupVO.getId());
       rset = pstmt.executeQuery();
   
       String users = "";
       String sep = ", ";
       while(rset.next())
       {
         if(users.equals(""))
         {
          distGroupVO.setDistGroupName(rset.getString(1));
          distGroupVO.setDistGroupDesc(rset.getString(2));
          distGroupVO.setIsEnabled(rset.getString(3));
          
          //log.debug("user="+ rset.getString(1));
         }
         if(!rset.getString(4).equals("NA"))
         {
          users += rset.getString(4)+sep;
         }
       }
       if(users.endsWith(sep))
       {
        users=users.substring(0,(users.length()-sep.length()));
     
       }
       distGroupVO.setUserNames(users);
       log.debug("users="+users);
     }
     catch (Exception e)
     {
       // TODO Auto-generated catch block
View Full Code Here

   * @throws DAOException
   * @throws BusinessException
   */
  public DistributionGroupVO getDistGroup(String dsName, String dbType, String reportIDthrows DAOException, BusinessException
  {
    DistributionGroupVO distGroupVO = null;
       
    DistributionGroupDAO dao = (DistributionGroupDAO)DAOFactory.getInstance().getDAO("com.eteam.ems.auth.dao.DistributionGroupDAO");
    distGroupVO = dao.findDistGroup(dsName, dbType, reportID);

    return distGroupVO;
View Full Code Here

    HttpServletRequest request,
    HttpServletResponse response)
    throws IOException, ServletException {
    log.debug("Creating group ...");
    ActionForward actionFrwd = null;
    DistributionGroupVO distGroupVO = new DistributionGroupVO();
    try {

      BeanUtils.copyProperties(distGroupVO, form);

    } catch (IllegalAccessException e) {
      log.error("ERROR in createDistGroup", e);
    } catch (InvocationTargetException e) {
      log.error("ERROR in createDistGroup", e);
    }
    log.debug("Asking for DistGroupBD");
    try {
      DistributionGroupBD bd =
        (DistributionGroupBD) BusinessDelegateFactory
          .getInstance()
          .getDelegate(
          "com.eteam.ems.auth.delegates.DistributionGroupBD");

      log.debug("BD got, calling create distribution group");

      HttpSession session = request.getSession();
      SessionUserVO sessUser =
        (SessionUserVO) session.getAttribute(
          IConstants.SESSION_ATTR_USER_SESSION_INFO);
      String dsName = sessUser.getDsName();
      String dbType = sessUser.getDbType();

      bd.createDistGroup(dsName, dbType, distGroupVO);
      log.debug("Distribution Group Created Successfully !!!");

      request.setAttribute(
        "fwd",
        "/admin/DistributionGroup.do?target=viewDistGroup&id="
          + distGroupVO.getId());
      actionFrwd = mapping.findForward("pop_success");

    } catch(DAOException e){
      ActionMessage message;
      log.debug("Message Key:= "+e.getMessageKey());
View Full Code Here

    SessionUserVO sessUser =
      (SessionUserVO) session.getAttribute(
        IConstants.SESSION_ATTR_USER_SESSION_INFO);
    String dsName = sessUser.getDsName();
    String dbType = sessUser.getDbType();
    DistributionGroupVO distGroupVO = new DistributionGroupVO();
    try {
      distGroupVO =
        bd.getDistGroup(dsName, dbType, request.getParameter("id"));
    } catch(DAOException e){
      ActionMessage message =  new ActionMessage(IErrorMessageKeys.KEY_DATABASE_ERROR);
View Full Code Here

    SessionUserVO sessUser =
      (SessionUserVO) session.getAttribute(
        IConstants.SESSION_ATTR_USER_SESSION_INFO);
    String dsName = sessUser.getDsName();
    String dbType = sessUser.getDbType();
    DistributionGroupVO distGroupVO = new DistributionGroupVO();
    try {
      distGroupVO =
        bd.getDistGroup(dsName, dbType, request.getParameter("id"));
    } catch(DAOException e){
      ActionMessage message =  new ActionMessage(IErrorMessageKeys.KEY_DATABASE_ERROR);
View Full Code Here

    HttpServletRequest request,
    HttpServletResponse response)
    throws IOException, ServletException {
    ActionForward actionFrwd = null;
    log.debug("Updating  Dist Group ...");
    DistributionGroupVO distGroupVO = new DistributionGroupVO();
    try {

      BeanUtils.copyProperties(distGroupVO, form);

    } catch (IllegalAccessException e) {
      log.error("ERROR in updateDistGroup", e);
    } catch (InvocationTargetException e) {
      log.error("ERROR in updateDistGroup", e);
    }
    log.debug("Asking for DistGroupBD");
    try {
      DistributionGroupBD bd =
        (DistributionGroupBD) BusinessDelegateFactory
          .getInstance()
          .getDelegate(
          "com.eteam.ems.auth.delegates.DistributionGroupBD");
      log.debug("BD got, calling updateDistGroup");

      HttpSession session = request.getSession();
      SessionUserVO sessUser =
        (SessionUserVO) session.getAttribute(
          IConstants.SESSION_ATTR_USER_SESSION_INFO);
      String dsName = sessUser.getDsName();
      String dbType = sessUser.getDbType();

      bd.updateDistGroup(dsName, dbType, distGroupVO);
      log.debug("distGroup Updated Successfully !!!");

      request.setAttribute(
        "fwd",
        "/admin/DistributionGroup.do?target=viewDistGroup&id="
          + distGroupVO.getId());
      actionFrwd = mapping.findForward("pop_success");

    } catch (BusinessException be) {
      // If some business error occured, will return to the input page
      ActionMessage message = new ActionMessage(be.getMessageKey());
      ActionMessages messages = new ActionMessages();
      messages.add(IConstants.PAGE_ERROR_MSG_ERROR_MESSAGE, message);
      this.saveErrors(request, messages);

      actionFrwd = new ActionForward(mapping.getInput());
    } catch(DAOException e){
      ActionMessage message;
      log.debug("Message Key:= "+e.getMessageKey());
      log.debug("Error Message := "+IErrorMessageKeys.KEY_ERROR_DUPLICATE_DIST_GROUP);
      if( e.getMessageKey().equals(IErrorMessageKeys.KEY_ERROR_DUPLICATE_DIST_GROUP)){
        message =  new ActionMessage(IErrorMessageKeys.KEY_ERROR_DUPLICATE_DIST_GROUP);
      }
      else{
        message =  new ActionMessage(IErrorMessageKeys.KEY_DATABASE_ERROR);
      }
      //ActionMessage message =  new ActionMessage(IErrorMessageKeys.KEY_DATABASE_ERROR);
      ActionMessages messages = new ActionMessages();
      messages.add(IConstants.PAGE_ERROR_MSG_ERROR_MESSAGE, message);
      this.saveErrors(request, messages);

      //actionFrwd = new ActionForward(mapping.getInput());
      actionFrwd = new ActionForward("/admin/DistributionGroup.do?target=viewForUpdateDistGroup&id="+distGroupVO.getId());
    } catch (Exception e1) {
      // TODO Auto-generated catch block
      log.error("Error:" + e1);

      // If some business error occured, will return to the input page
      ActionMessage message =  new ActionMessage(IErrorMessageKeys.KEY_FATAL_ERROR);
      ActionMessages messages = new ActionMessages();
      messages.add(IConstants.PAGE_ERROR_MSG_ERROR_MESSAGE, message);
      this.saveErrors(request, messages);

      //actionFrwd = new ActionForward(mapping.getInput());
      actionFrwd = new ActionForward("/admin/DistributionGroup.do?target=viewForUpdateDistGroup&id="+distGroupVO.getId());
    }
    return actionFrwd;
  }
View Full Code Here

TOP

Related Classes of com.eforce.baby.auth.vo.DistributionGroupVO

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.