Package javax.servlet

Examples of javax.servlet.ServletException


      Mapping.begin();
      User.getInstance(id).remove();
      Mapping.commit();
    } catch (Exception e) {
      Mapping.rollback();     
      throw new ServletException(e);
    }

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


      Vector v = User.listAll();
      Mapping.commit();
      request.setAttribute("users", v);
    } catch (Exception e) {
      Mapping.rollback();     
      throw new ServletException(e);
    }

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

      Mapping.begin();
      Publication.getInstance(id).remove();
      Mapping.commit();
    } catch (Exception e) {
      Mapping.rollback();     
      throw new ServletException(e);
    }

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

    ValueList valueList = null;
    try {
      valueList = (ValueList)CVUtility.setupEJB("ValueList", "com.centraview.valuelist.ValueListHome", dataSource);
    } catch (Exception e) {
      logger.error("[relatedInfoSetup] Exception thrown.", e);
      throw new ServletException(e);
    }
    // List!
    ValueListVO listObject = valueList.getValueList(individualId, listParameters);
    // Display Junk
    ValueListDisplay displayParameters = new ValueListDisplay(buttonList, true, false, true, true, true, true);
View Full Code Here

    ValueList valueList = null;
    try {
      valueList = valueListHome.create();
    } catch (CreateException e) {
      logger.error("[execute] Exception thrown.", e);
      throw new ServletException(e);
    }
    valueList.setDataSource(dataSource);
    ValueListVO listObject = valueList.getValueList(individualId, listParameters);
    ArrayList buttonList = new ArrayList();
    buttonList.add(new Button("Select", "select", "lu_selectList('group');", false));
View Full Code Here

    ValueList valueList = null;
    try {
      valueList = valueListHome.create();
    } catch (CreateException e) {
      logger.error("[execute] Exception thrown.", e);
      throw new ServletException(e);
    }
    valueList.setDataSource(dataSource);
    ValueListVO listObject = valueList.getValueList(individualId, listParameters);
    ArrayList buttonList = new ArrayList();

    ValueListDisplay displayParameters = null;

    if (actionType != null && actionType.startsWith("lookup")) {
      displayParameters = new ValueListDisplay(buttonList, false, false);
      if (actionType.equals("lookup_attendee")) {
        if (entityId != 0) {
          StringBuffer parameterValues = new StringBuffer();
          parameterValues.append(ValueListConstants.AMP);
          parameterValues.append("entityId=" + entityId);
          listObject.setCurrentPageParameters(parameterValues.toString());
          request.setAttribute("hideMarketingList", new Boolean(true));
        }
        // When we select the lookup then we should add the Select button to the
        // valueList
        buttonList.add(new Button("Select", "select", "lu_selectList('lookup_attendee');", false));
        buttonList.add(new Button("New Individual", "new", "c_newButton('Individual', 15)", false));
        request.setAttribute("dynamicTitle", "Individual Members");
        request.setAttribute("lookupType", "Individual Members");
        displayParameters.setRadioToCheckBox(true);
      }
      if (actionType.equals("lookup")) {
        if (entityId != 0) {
          StringBuffer parameterValues = new StringBuffer();
          parameterValues.append(ValueListConstants.AMP);
          parameterValues.append("entityId=" + entityId);
          listObject.setCurrentPageParameters(parameterValues.toString());
          request.setAttribute("hideMarketingList", new Boolean(true));
        }
        // When we select the lookup then we should add the Select button to the
        // valueList
        buttonList.add(new Button("Select", "select", "lu_selectList('Individual');", false));
        buttonList.add(new Button("New Individual", "new", "c_newButton('Individual', 15)", false));
        request.setAttribute("dynamicTitle", "Individual");
        request.setAttribute("lookupType", "Individual");
      }
      if (actionType.equals("lookupEmployee")) {
        request.setAttribute("hideMarketingList", new Boolean(true));
        // When we select the lookup then we should add the Select button to the
        // valueList
        if (request.getParameter("lookupFlag") != null) {
          buttonList.add(new Button("Select", "select", "lu_selectList('Employee', '"
              + request.getParameter("lookupFlag") + "');", false));
        } else {
          buttonList.add(new Button("Select", "select", "lu_selectList('Employee');", false));
        }
        // buttonList.add(new Button("New Individual", "new",
        // "c_newButton('Individual', 15)", false));
        String defaultEntityName = java.net.URLEncoder.encode(userObject.getEntityName(),
            "ISO-8859-1");
        buttonList.add(new Button("New Individual", "new",
            "c_openWindow('/contacts/new_individual.do?entityNo=1&entityName=" + defaultEntityName
                + "')", false));
        request.setAttribute("dynamicTitle", "Employee");
        request.setAttribute("lookupType", "Employee");
      }
      displayParameters.setRadio(true);
      listObject.setLookup(true);
      listObject.setLookupType(actionType);
    } else {
      buttonList.add(new Button("View", "view", "vl_viewList();", false));
      buttonList.add(new Button("Delete", "delete", "vl_deleteList();", false));
      displayParameters = new ValueListDisplay(buttonList, true, true);
    }
    displayParameters.setSortable(true);
    displayParameters.setPagingBar(true);
    displayParameters.setLink(true);
    listObject.setDisplay(displayParameters);
    request.setAttribute("valueList", listObject);

    // Handle non-deleted users
    ArrayList userList = new ArrayList();
    ArrayList ar = (ArrayList)session.getAttribute("usersNotDeleted");
    session.removeAttribute("usersNotDeleted");
    if (ar != null && !ar.isEmpty()) {
      Iterator it = ar.iterator();
      while (it.hasNext()) {
        String rowId = (String)it.next();
        ArrayList rows = (ArrayList)listObject.getList();
        Iterator iter = rows.iterator();
        while (iter.hasNext()) {
          ValueListRow vlr = (ValueListRow)iter.next();
          if (vlr.getRowId() == Integer.parseInt(rowId)) {
            userList.add(vlr.getRowData().get(2));
          }
        }
        if (userList != null && !userList.isEmpty()) {
          request.setAttribute("usersNotDeleted", userList);
        }
      }
    }
    // Put the MarketingList names on the request so the dropdown on the left
    // can be rendered
    ContactFacadeHome cfh = (ContactFacadeHome)CVUtility.getHomeObject(
        "com.centraview.contact.contactfacade.ContactFacadeHome", "ContactFacade");
    ContactFacade remote = null;
    try {
      remote = cfh.create();
    } catch (CreateException e) {
      logger.error("[execute] Exception thrown.", e);
      throw new ServletException(e);
    }
    remote.setDataSource(dataSource);
    Vector allDBList = remote.getDBList(individualId);
    request.setAttribute("AllDBList", allDBList);
    // For the searchBar
View Full Code Here

    ContactFacade contactFacade = null;
    try {
      contactFacade = (ContactFacade)CVUtility.setupEJB("ContactFacade",
          "com.centraview.contact.contactfacade.ContactFacadeHome", dataSource);
    } catch (Exception e) {
      throw new ServletException(e);
    }

    ActionForward forward = null;
    StringBuffer path = new StringBuffer();
    // Decide if we are updating an existing or creating a new
    if (entityVO.getContactID() < 1) {
      // set the creator
      entityVO.setCreatedBy(individualId);
      // if necessary the account manager
      if (entityVO.getAccManager() < 1) {
        entityVO.setAccManager(individualId);
      }
      String marketingListSession = (String)session.getAttribute("dbid");
      int marketingList = 1;
      try {
        marketingList = Integer.valueOf(marketingListSession).intValue();
      } catch (NumberFormatException nfe) {}

      entityVO.setList(marketingList);

      if (!allErrors.isEmpty()) {
        // if there were any validation errors, show the
        // new entity form again, with error messages...
        this.saveErrors(request, allErrors);
        return mapping.findForward(".view.contact.new_entity");
      }

      int newEntityId = contactFacade.createEntity(entityVO, individualId);

      if (request.getParameter("new") != null) {
        path.append(mapping.findForward("newEntity").getPath());
        path.append(entityVO.getList());
        forward = new ActionForward(path.toString(), true);
      } else {
        path.append(mapping.findForward("viewEntity").getPath());
        path.append(newEntityId);
        path.append("&closeWindow=false");
        forward = new ActionForward(path.toString(), true);
      }
    } else {
      try {
        contactFacade.updateEntity(entityVO, individualId);
      } catch (Exception e) {
        logger.error("[execute] Exception thrown.", e);
        throw new ServletException(e);
      }
      path.append(mapping.findForward("viewEntity").getPath());
      path.append(entityVO.getContactID());
      path.append("&closeWindow=");
      path.append(entityForm.get("closeWindow"));
View Full Code Here

    try {
      activityFacade = (ActivityFacade)CVUtility.setupEJB("ActivityFacade",
          "com.centraview.activity.activityfacade.ActivityFacadeHome", dataSource);
    } catch (Exception e) {
      logger.error("[execute] Exception thrown.", e);
      throw new ServletException(e);
    }
    ArrayList taskList = activityFacade.getTaskList(individualId);

    for (int i = 0; i < taskList.size(); i++) {
      TaskVO task = (TaskVO)taskList.get(i);
      String requestURL = "/projects/view_task.do?rowId=";
      requestURL += task.getTaskid();
      HomeDisplayItem item = new HomeDisplayItem();
      item.setTitle(task.getTitle());
      item.setUrl(requestURL);
      taskDisplayList.add(item);
    }
    request.setAttribute("taskDisplayList", taskDisplayList);
   
    // opportunity

    ArrayList opportunityDisplayList = new ArrayList();
    // ask the EJB layer to give us a list of relevant TASK VO's
    SaleFacade saleFacade = null;
    try {
      saleFacade = (SaleFacade)CVUtility.setupEJB("SaleFacade",
          "com.centraview.sale.salefacade.SaleFacadeHome", dataSource);
    } catch (Exception e) {
      logger.error("[execute] Exception thrown.", e);
      throw new ServletException(e);
    }
    ArrayList opportunityList = saleFacade.getInterestingOpportunityList(individualId);

    for (int i = 0; i < opportunityList.size(); i++) {
      OpportunityVO opportunity = (OpportunityVO)opportunityList.get(i);
View Full Code Here

      ValueList valueList = null;
      try {
        valueList = valueListHome.create();
      } catch (CreateException e) {
        logger.error("[execute] Exception thrown.", e);
        throw new ServletException(e);
      }
      valueList.setDataSource(dataSource);
      ValueListVO listObject = valueList.getValueList(individualId, listParameters);
      listObject.setCurrentPageParameters(ValueListConstants.AMP + "groupId=" + row);
      ArrayList buttonList = new ArrayList();
View Full Code Here

    ContactFacade contactFacade = null;
    try {
      contactFacade = (ContactFacade)CVUtility.setupEJB("ContactFacade",
          "com.centraview.contact.contactfacade.ContactFacadeHome", dataSource);
    } catch (Exception e) {
      throw new ServletException(e);
    }
    ActionForward forward = null;
    StringBuffer path = new StringBuffer();
    // Decide if we are updating an existing or creating a new individual
    if (individualVO.getContactID() < 1) {
      String marketingListSession = (String)session.getAttribute("dbid");
      int marketingList = 1;
      try {
        marketingList = Integer.valueOf(marketingListSession).intValue();
      } catch (NumberFormatException nfe) {}
      individualVO.setList(marketingList);
      individualVO.setCreatedBy(individualId);
      int newIndividualId = 0;
      try {
        newIndividualId = contactFacade.createIndividual(individualVO, individualId);
      } catch (Exception e) {
        logger.error("[execute] Exception thrown.", e);
        throw new ServletException(e);
      }
      if (request.getParameter("new") != null) {
        path.append(mapping.findForward("newIndividual").getPath());
        path.append(individualVO.getList());
        path.append("&entityNo=");
        path.append(individualVO.getEntityID());
        path.append("&entityName=");
        path.append(individualVO.getEntityName());
        forward = new ActionForward(path.toString(), true);
      } else {
        path.append(mapping.findForward("viewIndividual").getPath());
        path.append(newIndividualId);
        path.append("&closeWindow=false");
        forward = new ActionForward(path.toString(), true);
      }
    } else {
      try {
        contactFacade.updateIndividual(individualVO, individualId);
      } catch (Exception e) {
        logger.error("[execute] Exception thrown.", e);
        throw new ServletException(e);
      }
      path.append(mapping.findForward("viewIndividual").getPath());
      path.append(individualVO.getContactID());
      path.append("&closeWindow=");
      path.append(individualForm.get("closeWindow"));
View Full Code Here

TOP

Related Classes of javax.servlet.ServletException

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.