Package javax.servlet.http

Examples of javax.servlet.http.HttpSession


  public ActionForward execute(ActionMapping mapping, ActionForm form, HttpServletRequest request, HttpServletResponse response) throws Exception
  {
    try
    {
      HttpSession session  = request.getSession(false);
      session.setAttribute("highlightmodule", "email");
      FORWARD_final = FORWARD_email;
    }catch(Exception e){
      e.printStackTrace();
      FORWARD_final = GLOBAL_FORWARD_failure;
    }
View Full Code Here


  private static String TICKET = "ticket";
  private static String SALES = "sales";
  public ActionForward execute(ActionMapping mapping, ActionForm form, HttpServletRequest request, HttpServletResponse response) throws ServletException
  {
    String dataSource = Settings.getInstance().getSiteInfo(CVUtility.getHostName(super.getServlet().getServletContext())).getDataSource();
    HttpSession session = request.getSession();
    UserObject user = (UserObject)session.getAttribute("userobject");
    int individualId = user.getIndividualID();
    UserPrefererences preferences = user.getUserPref();
    String type = request.getParameter("type");
    PreferenceVO preferenceVO = new PreferenceVO();
View Full Code Here

    String dataSource = Settings.getInstance().getSiteInfo(CVUtility.getHostName(super.getServlet().getServletContext())).getDataSource();

    try
    {

      HttpSession session = request.getSession(true);
      UserObject userobjectd = (UserObject)session.getAttribute("userobject");
      int individualId = userobjectd.getIndividualID();
      ListPreference listpreference = userobjectd.getListPreference("Email");

      //account object created
      MailAccount mailaccount = new MailAccount();
View Full Code Here

  {
    String dataSource = Settings.getInstance().getSiteInfo(
        CVUtility.getHostName(super.getServlet().getServletContext())).getDataSource();

    try {
      HttpSession session = request.getSession();
      UserObject userObject = (UserObject)session.getAttribute("userobject");
      int individualId = userObject.getIndividualID();
      String typeOfActivity = "";

      // Check the session for an existing error message (possibly from the
      // delete handler)
      ActionMessages allErrors = (ActionMessages)session.getAttribute("listErrorMessage");
      if (allErrors != null) {
        saveErrors(request, allErrors);
        session.removeAttribute("listErrorMessage");
      }

      if (request.getParameter(ConstantKeys.TYPEOFACTIVITY) == null) {
        // here we can get values all / my / multi, so check if value not equal
        // to types of activity
        if (!(typeOfActivity.equals(ConstantKeys.APPOINTMENT)
            || typeOfActivity.equals(ConstantKeys.CALL)
            || typeOfActivity.equals(ConstantKeys.FORECASTSALE)
            || typeOfActivity.equals(ConstantKeys.LITERATUREREQUEST)
            || typeOfActivity.equals(ConstantKeys.MEETING)
            || typeOfActivity.equals(ConstantKeys.NEXTACTION)
            || typeOfActivity.equals(ConstantKeys.TODO) || typeOfActivity.equals(ConstantKeys.TASK))) {
          ActivityHelperHome home = (ActivityHelperHome)CVUtility.getHomeObject(
              "com.centraview.activity.helper.ActivityHelperHome", "ActivityHelper");
          try {
            ActivityHelper remote = home.create();
            remote.setDataSource(dataSource);
            String findActivityId = request.getParameter("rowId");
            typeOfActivity = remote.getTypeOfActivity(Integer.parseInt(findActivityId))
                .toUpperCase();
          } catch (Exception e) {
            logger.error("[execute]: Exception", e);
          }
        }
      } else if (request.getParameter(ConstantKeys.TYPEOFACTIVITY) != null) {
        typeOfActivity = request.getParameter(ConstantKeys.TYPEOFACTIVITY);
        // call to activity helper to get typeOfActivity if
        // here we get value from "TYPEOFACTIVITYLIST" hidden text box from jsp
        // pages
        if (!(typeOfActivity.equals(ConstantKeys.APPOINTMENT)
            || typeOfActivity.equals(ConstantKeys.CALL)
            || typeOfActivity.equals(ConstantKeys.FORECASTSALE)
            || typeOfActivity.equals(ConstantKeys.LITERATUREREQUEST)
            || typeOfActivity.equals(ConstantKeys.MEETING)
            || typeOfActivity.equals(ConstantKeys.NEXTACTION)
            || typeOfActivity.equals(ConstantKeys.TODO) || typeOfActivity.equals(ConstantKeys.TASK))) {

          ActivityHelperHome home = (ActivityHelperHome)CVUtility.getHomeObject(
              "com.centraview.activity.helper.ActivityHelperHome", "ActivityHelper");

          try {
            ActivityHelper remote = home.create();
            remote.setDataSource(dataSource);
            String findActivityId = request.getParameter("rowId");
            typeOfActivity = remote.getTypeOfActivity(Integer.parseInt(findActivityId))
                .toUpperCase();
          } catch (Exception e) {
            logger.error("[execute]: Exception", e);
          }
        } else {
          typeOfActivity = request.getParameter(ConstantKeys.TYPEOFACTIVITY).toUpperCase();
        }
      } else {
        // Something tells me, we'll NEVER reach this point!!!
        typeOfActivity = ConstantKeys.APPOINTMENT;
      }

      if (typeOfActivity.equals("NEXT ACTION")) {
        typeOfActivity = ConstantKeys.NEXTACTION;
      } else if (typeOfActivity.equals("TO DO")) {
        typeOfActivity = ConstantKeys.TODO;
      }

      // set request to pass to jsp
      request.setAttribute(ConstantKeys.TYPEOFACTIVITY, typeOfActivity);

      // set default opening window to detail sub-type activity
      request.setAttribute(ConstantKeys.TYPEOFSUBACTIVITY, ConstantKeys.DETAIL);
      request.setAttribute(ConstantKeys.TYPEOFOPERATION, ConstantKeys.EDIT);

      request.setAttribute("actionName", "");

      String currTimeZone = userObject.getUserPref().getTimeZone();
      String findActivityId = request.getParameter("rowId");

      ActivityVO activityVO = new ActivityVO();
      ActivityFacadeHome aa = (ActivityFacadeHome)CVUtility.getHomeObject(
          "com.centraview.activity.activityfacade.ActivityFacadeHome", "ActivityFacade");
      ActivityFacade remote = aa.create();
      remote.setDataSource(dataSource);

      activityVO = remote.getActivity(Integer.parseInt(findActivityId), individualId);
      activityVO.changeTimeZoneOfAllDates("EST", currTimeZone);

      ActivityForm actFrm = (ActivityForm)form;
      ActivityGenericFillVOX agf = new ActivityGenericFillVOX();
      actFrm.setLocale(request.getLocale());
      actFrm = agf.fillBasicForm(activityVO, actFrm);

      request.setAttribute("activityform", actFrm);
      session.setAttribute("activityform", actFrm);

      request.setAttribute("RECORDOPERATIONRIGHT", new Integer(CVUtility.getRecordPermission(
          individualId, "Activities", activityVO.getActivityID(), dataSource)));
      FORWARD_final = FORWARD_view;
    } catch (Exception e) {
View Full Code Here

  public ActionForward execute(ActionMapping mapping, ActionForm form, HttpServletRequest request, HttpServletResponse response) throws Exception
  {
    String dataSource = Settings.getInstance().getSiteInfo(CVUtility.getHostName(super.getServlet().getServletContext())).getDataSource();

    try {
      HttpSession session = request.getSession(true);

      DynaActionForm dynaForm = (DynaActionForm)form;

      String composeType = (String)dynaForm.get("composeType");
      if (composeType.equalsIgnoreCase("HTML")) {
        session.setAttribute(Constants.EMAILTYPEFLAG, "HTML");
      } else {
        session.setAttribute(Constants.EMAILTYPEFLAG, "PLAIN");
      }

      int individualID = 0;
      UserObject userObject = (UserObject)session.getAttribute("userobject");

      individualID = userObject.getIndividualID();

      Vector vec = new Vector();
      PreferenceVO pvo1 = new PreferenceVO();

      pvo1.setModuleId(4);
      pvo1.setPreferenceName("contenttype");
      pvo1.setPreferenceValue(composeType);

      vec.addElement(pvo1);
      PreferenceHome prefHome = (PreferenceHome)CVUtility.getHomeObject("com.centraview.preference.PreferenceHome", "Preference");
      Preference prefRemote = prefHome.create();
      prefRemote.setDataSource(dataSource);
      prefRemote.updateUserPreference(individualID, vec);
     
      request.setAttribute("emailComposition", composeType);
     
      UserPrefererences userPref= userObject.getUserPref();
      userPref.setContentType(composeType);
      userObject.setUserPref(userPref);
      session.setAttribute("userobject", userObject);
     
      request.setAttribute(AdminConstantKeys.PREFERENCEPAGE, "EMAILCOMPOSITION");
    } catch (Exception e) {
      System.out.println("[Exception][SaveEmailComposition.execute] Exception Thrown: " + e);
      e.printStackTrace();
View Full Code Here

  public void setForm (HttpServletRequest request, HttpServletResponse response, ActionForm form) {
    try {
      System.out.println("PopulateThreadForm:1:setForm(HttpServletRequest, HttpServletResponse, ActionForm)::entry");

      // get from session the form associated with windowid
      HttpSession session = request.getSession();

      // hashMap
      HashMap threadHashMap = null;
      // file form from session
      ThreadForm sessionForm = null;

      // get from request windowid
      String windowId = (String) request.getParameter(ThreadConstantKeys.WINDOWID);
      System.out.println("1");     
      if ((request.getParameter(ThreadConstantKeys.TYPEOFOPERATION).toString()).equals(ThreadConstantKeys.ADD)) {
        // hash map for add folder
        threadHashMap = (HashMap) session.getAttribute(ThreadConstantKeys.NEWTHREADHASHMAP);
        // get form from hashmap
        sessionForm = (ThreadForm) threadHashMap.get(windowId);
      }
      else if ((request.getParameter(ThreadConstantKeys.TYPEOFOPERATION).toString()).equals(ThreadConstantKeys.EDIT)) {
        // hash map for edit activity
        threadHashMap = (HashMap) session.getAttribute(ThreadConstantKeys.EDITTHREADHASHMAP);
        // get form from hashmap
        sessionForm = (ThreadForm) threadHashMap.get(windowId);
      }

      // get previous form values 
      ThreadForm previousForm = (ThreadForm) form;

      // set activity id if present
      if (previousForm.getThreadId() != null)
        sessionForm.setThreadId(previousForm.getThreadId());     

      // set form for previous permission values
      if (ThreadConstantKeys.DETAIL.equals(""))//(previousTab)) 
      {
        sessionForm.setTitle(previousForm.getTitle());
        sessionForm.setDetail(previousForm.getDetail());
        sessionForm.setPriorityId(previousForm.getPriorityId());
        sessionForm.setPriorityName(previousForm.getPriorityName());
      }

      // set the form back in session
      if ((request.getParameter(ThreadConstantKeys.TYPEOFOPERATION).toString()).equals(ThreadConstantKeys.ADD)) {     
        threadHashMap.put(windowId, sessionForm);
        session.setAttribute(ThreadConstantKeys.NEWTHREADHASHMAP, threadHashMap);
      }
      else if ((request.getParameter(ThreadConstantKeys.TYPEOFOPERATION).toString()).equals(ThreadConstantKeys.EDIT)) {
        threadHashMap.put(windowId, sessionForm);
        session.setAttribute(ThreadConstantKeys.EDITTHREADHASHMAP, threadHashMap);
      }
    }
    catch (Exception e) {
      e.printStackTrace();   
    }
View Full Code Here

  public ActionForm getForm (HttpServletRequest request, HttpServletResponse response, ActionForm form, String currentTab) {
    try {
      System.out.println("PopulateNoteForm::getForm(HttpServletRequest, HttpServletResponse, ActionForm)::entry");

      // get from session the form associated with windowid
      HttpSession session = request.getSession();

      // hashMap
      HashMap threadHashMap = null;
      // form from session
      ThreadForm sessionForm = null;

      // get from request windowid
      String windowId = (String) request.getParameter(ThreadConstantKeys.WINDOWID);

      if ((request.getParameter(ThreadConstantKeys.TYPEOFOPERATION).toString()).equals(ThreadConstantKeys.ADD)) {
        // hash map for add activity
        threadHashMap = (HashMap) session.getAttribute(ThreadConstantKeys.NEWTHREADHASHMAP);
        // get form from hashmap
        sessionForm = (ThreadForm) threadHashMap.get(windowId);
      }
      else if ((request.getParameter(ThreadConstantKeys.TYPEOFOPERATION).toString()).equals(ThreadConstantKeys.EDIT)) {
        // hash map for edit activity
        threadHashMap = (HashMap) session.getAttribute(ThreadConstantKeys.EDITTHREADHASHMAP);
        // get form from hashmap
        sessionForm = (ThreadForm) threadHashMap.get(windowId);
      }

      // get previous form values 
View Full Code Here

{
  private static Logger logger = Logger.getLogger(OrderListDeleteHandler.class);
  public ActionForward execute(ActionMapping mapping,ActionForm form,HttpServletRequest request,HttpServletResponse response) throws IOException, ServletException, CommunicationException, NamingException
  {
    String dataSource = Settings.getInstance().getSiteInfo(CVUtility.getHostName(super.getServlet().getServletContext())).getDataSource();
    HttpSession session = request.getSession(true);
    int individualId = ((UserObject)session.getAttribute("userobject")).getIndividualID();
    ArrayList deleteLog = new ArrayList();
    String rowId[] = request.getParameterValues("rowId");
    AccountFacadeHome accountFacadeHome = (AccountFacadeHome)CVUtility.getHomeObject("com.centraview.account.accountfacade.AccountFacadeHome","AccountFacade");
    try
    {
      AccountFacade remote = (AccountFacade)accountFacadeHome.create();
      remote.setDataSource(dataSource);
      for (int i=0; i<rowId.length; i++)
      {
        if(rowId[i] != null && !rowId[i].equals(""))
        {
          int elementID = Integer.parseInt(rowId[i]);
          try
          {
      remote.deleteOrder(elementID,individualId);
          } catch(AuthorizationFailedException ae) {
            String errorMessage = ae.getExceptionDescription();
            deleteLog.add(errorMessage);
          } catch(RemoteException re) {
            logger.error("[execute] Exception thrown.", re);
          }
        } //end of if(rowId[i] != null && !rowId[i].equals(""))
      } //end of for (int i=0; i<rowId.length; i++)
    } catch(CreateException e) {
      logger.error("[execute] Exception thrown.", e);
      throw new CommunicationException(e.getMessage());
    }
    if (!deleteLog.isEmpty())
    {
      ActionErrors allErrors = new ActionErrors();
      allErrors.add(ActionMessages.GLOBAL_MESSAGE, new ActionMessage("error.freeForm", "You do not have permission to delete one or more of the records you selected."));
      session.setAttribute("listErrorMessage", allErrors);
    }
    ActionForward forward = new ActionForward(request.getParameter("currentPage"), true);
    return forward;
  }
View Full Code Here

  public void resetForm (HttpServletRequest request, HttpServletResponse response, ActionForm form) {
    try {
      System.out.println("PopulateNoteForm::resetForm(HttpServletRequest, HttpServletResponse, ActionForm)::entry")

      // get from session the form associated with windowid
      HttpSession session = request.getSession();

      // hashMap
      HashMap threadHashMap = null;
      // form from session
      ThreadForm resetForm = null;

      // get from request windowid
      String windowId = (String) request.getParameter(ThreadConstantKeys.WINDOWID);

      if ((request.getParameter(ThreadConstantKeys.TYPEOFOPERATION).toString()).equals(ThreadConstantKeys.ADD)) {
        // hash map for add activity
        threadHashMap = (HashMap) session.getAttribute(ThreadConstantKeys.NEWTHREADHASHMAP);
        // get form from hashmap
        resetForm = (ThreadForm) threadHashMap.get(windowId);
      }
      else if ((request.getParameter(ThreadConstantKeys.TYPEOFOPERATION).toString()).equals(ThreadConstantKeys.EDIT)) {
        // hash map for edit activity
        threadHashMap = (HashMap) session.getAttribute(ThreadConstantKeys.EDITTHREADHASHMAP);
        // get form from hashmap
        resetForm = (ThreadForm) threadHashMap.get(windowId);
      }

      resetForm = (ThreadForm) form;

      resetForm.setThreadId("0");
      resetForm.setTitle("");
      resetForm.setDetail("");
      resetForm.setPriorityId(0);
      resetForm.setPriorityName("");


      resetForm.setCreatedby("");
      resetForm.setCreateddate("");
      resetForm.setModifieddate("");

      // set the form back in session
      if ((request.getParameter(ThreadConstantKeys.TYPEOFOPERATION).toString()).equals(ThreadConstantKeys.ADD)) {     
        threadHashMap.put(windowId, resetForm);
        session.setAttribute(ThreadConstantKeys.NEWTHREADHASHMAP, threadHashMap);
      }
      else if ((request.getParameter(ThreadConstantKeys.TYPEOFOPERATION).toString()).equals(ThreadConstantKeys.EDIT)) {
        threadHashMap.put(windowId, resetForm);
        session.setAttribute(ThreadConstantKeys.EDITTHREADHASHMAP, threadHashMap);
      }   

    }
    catch (Exception e) {
      e.printStackTrace();
View Full Code Here

    ActionForward forward = null;
    try
    {
      DynaActionForm dynaForm = (DynaActionForm)form;

      HttpSession session = request.getSession();
      int individualId = ((UserObject)session.getAttribute("userobject")).getIndividualID();

      String typeOfSave = "saveclose";

      if (request.getParameter("buttonpress") != null)
      {
View Full Code Here

TOP

Related Classes of javax.servlet.http.HttpSession

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.