Examples of HttpSession


Examples of javax.servlet.http.HttpSession

    try
    {

      DynaActionForm dynaForm = (DynaActionForm)form;

      HttpSession session = request.getSession(true);

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

    UserPrefererences userPrefererences = userObject.getUserPref();

      // no need to check for null on userobjectd here, because if it is null
      // we should fail now! instead of making an EJB call with bogus info.    
      individualID = userObject.getIndividualID();

      if (request.getParameter("buttonpress") != null)
      {
        typeOfSave = request.getParameter("buttonpress");
        String minutes = (String) (dynaForm.get("minutes"));
        String seconds = (String) (dynaForm.get("seconds"));
        Vector vec = new Vector();
        PreferenceVO pvo1 = new PreferenceVO();
        PreferenceVO pvo2 = new PreferenceVO();
        PreferenceVO pvo3 = new PreferenceVO();
        pvo1.setModuleId(4);
        pvo1.setPreferenceName("calendarrefreshmin");
        pvo1.setPreferenceValue(minutes);
        pvo2.setModuleId(4);
        pvo2.setPreferenceName("calendarrefreshsec");
        pvo2.setPreferenceValue(seconds);
        pvo3.setModuleId(4);
        pvo3.setPreferenceName("caldefaultview");
        pvo3.setPreferenceValue((String) (dynaForm.get("radio")));

        if(minutes != null && !minutes.equals("") && !minutes.equals("null")
              && seconds != null && !seconds.equals("") && !seconds.equals("null"))
        {
            userPrefererences.setCalendarRefreshMin(minutes);
          userPrefererences.setCalendarRefreshSec(seconds);
          userObject.setUserPref(userPrefererences);
          session.setAttribute("userobject",userObject);
        }
       
        if(dynaForm.get("radio") != null)
        {
          userPrefererences.setCalendarDefaultView((String) dynaForm.get("radio"));
          userObject.setUserPref(userPrefererences);
          session.setAttribute("userobject",userObject);
        }
       
        vec.addElement(pvo1);
        vec.addElement(pvo2);
        vec.addElement(pvo3);
        PreferenceHome prefHome = (PreferenceHome)CVUtility.getHomeObject("com.centraview.preference.PreferenceHome", "Preference");
        Preference prefRemote = prefHome.create();
        prefRemote.setDataSource(dataSource);
        prefRemote.updateUserPreference(individualID, vec);
        FORWARD_final = FORWARD_save;
        request.setAttribute("TYPEOFOPERATION", "EDIT");
        session.setAttribute("userobject", userObject);

      }

      request.setAttribute(AdminConstantKeys.PREFERENCEPAGE, "CALENDAR");
      FORWARD_final = FORWARD_save;
View Full Code Here

Examples of javax.servlet.http.HttpSession

      PurchaseOrderForm purchaseForm = (PurchaseOrderForm)form;
      purchaseForm.convertItemLines();

      ItemLines itemLines = null;

      HttpSession session = request.getSession(true);
      UserObject  userobjectd = (UserObject)session.getAttribute( "userobject" );//get the user object
      int individualID = userobjectd.getIndividualID();

      request.setAttribute(AccountConstantKeys.TYPEOFSUBMODULE, AccountConstantKeys.PURCHASEORDER);

      request.setAttribute("body",AccountConstantKeys.EDIT);
View Full Code Here

Examples of javax.servlet.http.HttpSession

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

    String returnStatus ="";
    try
    {
      HttpSession session = req.getSession();
      com.centraview.common.UserObject  userobjectd = (com.centraview.common.UserObject)session.getAttribute( "userobject" );//get the user object
      int individualID = userobjectd.getIndividualID();
     
      System.out.println("san-OrderLookupHandler-getting OrderList from LG ...");
      ListGenerator lg = ListGenerator.getListGenerator(dataSource);
      OrderList DL = ( OrderList )lg.getOrderList(individualID , 0,0 , "" ,"OrderID");
View Full Code Here

Examples of javax.servlet.http.HttpSession

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

    request.setAttribute(AdminConstantKeys.PREFERENCEPAGE, "EMAIL");

    HttpSession session = request.getSession();
    UserObject userObject = (UserObject)session.getAttribute("userobject");

    int individualID = userObject.getIndividualID();    // logged in user

    ActionErrors allErrors = new ActionErrors();
    String forward = ".forward.preference.mail.account_list";
View Full Code Here

Examples of javax.servlet.http.HttpSession

    String forwardTo = "failure";
    try
    {
      request.setAttribute("refreshWindow", "true");
      HttpSession session = request.getSession(true);
     
      UserObject  userobjectd = (UserObject)session.getAttribute( "userobject" );
      String rowId = (String)request.getParameter("rowId");
      request.setAttribute("rowId",rowId);
      String index = (String)request.getParameter("index");
      request.setAttribute("index",index);
      String folderid = (String)request.getParameter("folderid");
View Full Code Here

Examples of javax.servlet.http.HttpSession

    try
    {
      PurchaseOrderForm purchaseForm = (PurchaseOrderForm)form;
      purchaseForm.convertItemLines();

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


      String typeOfSave = "saveclose";

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

Examples of javax.servlet.http.HttpSession

    String saveandclose = (String) request.getParameter("saveandclose");
    String saveandnew = (String) request.getParameter("saveandnew");
    String returnStatus = "failure";

    HttpSession session = request.getSession(true);
    UserObject userobject = (UserObject) session.getAttribute("userobject");
    currentTZ = userobject.getUserPref().getTimeZone();
    int indvID = 0;

    if (userobject != null)
    {
View Full Code Here

Examples of javax.servlet.http.HttpSession

{
  private static Logger logger = Logger.getLogger(PurchaseOrderListDeleteHandler.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.deletePurchaseOrder(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

Examples of javax.servlet.http.HttpSession

{
  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");
    MailMessage mailMessage = new MailMessage();
    DynaActionForm dynaForm = (DynaActionForm)form;

    String accountid   = (String) dynaForm.get( "AccountID" );

    String messageid    = (String) request.getParameter( "messageid" );
   
    mailMessage.setMessageID( Integer.parseInt( messageid ) );
         

    HashMap attchmentids =( HashMap) session.getAttribute( "AttachfileList" );


    int id = Integer.parseInt( accountid );

    /** code added for query change **/
    FolderList fl = ( FolderList )session.getAttribute("folderlist");
    Set listkey = fl.keySet();
    Iterator it = listkey.iterator();
    int accountID;
    AccountDetail ad1 = null;
    while(it.hasNext())
View Full Code Here

Examples of javax.servlet.http.HttpSession

    throws IOException, ServletException, CommunicationException, NamingException
  {
    String dataSource = Settings.getInstance().getSiteInfo(CVUtility.getHostName(super.getServlet().getServletContext())).getDataSource();
    String FORWARD_final = ".view.marketing.editlistmanager";

    HttpSession session = request.getSession(true);
    String rowId[] = null;
    String row = null;
    if (request.getParameterValues("rowIdParent") != null)
    {
      rowId = request.getParameterValues("rowIdParent");
    } //end of if statement (request.getParameterValues("rowIdParent") != null)
    else if (request.getParameterValues("marketingListID") != null)
    {
      rowId = request.getParameterValues("marketingListID");
    } //end of else if statement (request.getParameterValues("marketingListID") != null)
  else if (session.getAttribute("marketingListID") != null)
  {
     row = (String) session.getAttribute("marketingListID");
     session.removeAttribute("marketingListID");
  } //end of else if statement (getAttribute("marketingListID") != null)   
  else if (request.getParameterValues("listid") != null)
  {
    rowId = request.getParameterValues("listid");
  } //end of else if statement (getAttribute("marketingListID") != null) 
  else
    {
      if (request.getParameterValues("rowId") != null)
      {
        rowId = request.getParameterValues("rowId");
      } //end of if statement (request.getParameterValues("rowId") !=null)
      else if (request.getAttribute("rowId") != null)
      {
        row = (String)request.getAttribute("rowId");
      } //end of else if statement (request.getAttribute("rowId") !=null)
      else
      {
        row = (String)request.getAttribute("groupid");
      } //end of else statement
    } //end of else statement

  // After performing the logic in the DeleteHanlder, we are generat a new request for the list
  // So we will not be carrying the old error. So that we will try to collect the error from the Session variable
  // Then destory it after getting the Session value
  if (session.getAttribute("listErrorMessage") != null)
  {
    ActionErrors allErrors = (ActionErrors) session.getAttribute("listErrorMessage");
    saveErrors(request, allErrors);
    session.removeAttribute("listErrorMessage");
  }//end of if (session.getAttribute("listErrorMessage") != null)

    if (rowId != null)
    {
      row = rowId[0];
    } //end of if statement (rowId != null)

    request.setAttribute("rowId", row);

  MarketingFacadeHome aa = (MarketingFacadeHome)CVUtility.getHomeObject("com.centraview.marketing.marketingfacade.MarketingFacadeHome", "MarketingFacade");
    try
    {
      MarketingFacade remote = (MarketingFacade)aa.create();
      remote.setDataSource(dataSource);
    DynaActionForm dyna = (DynaActionForm)form;
    if (row != null && !row.equals("")){
      int rowID = Integer.parseInt(row);
      ListVO listVO = remote.viewList(rowID);
      dyna.set("listname", listVO.getTitle());
      dyna.set("listdescription", listVO.getDescription());
      dyna.set("listid", listVO.getListID()+"");
      dyna.set("create", listVO.getCreated());
      dyna.set("modify", listVO.getModified());
      dyna.set("owner", listVO.getOwnerID()+"");
      dyna.set("ownername", listVO.getOwnerName());
    }
    request.setAttribute("listFormBean", dyna);
    } //end of try block
    catch (Exception e)
    {
      logger.error("[Exception] ViewListHandler.Execute Handler ", e);
    }

    request.setAttribute("TypeOfOperation", "List Manager");
    request.setAttribute("showAddAttendeesButton", new Boolean(false));
    request.setAttribute("showImportButton", new Boolean(true));

    UserObject userobjectd = (UserObject)session.getAttribute("userobject");
    try
    {
      this.buildSubList(Integer.parseInt(row), userobjectd, request, session, dataSource);
    }
    catch (Exception e)
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.