Package java.util

Examples of java.util.HashMap


    try {
      LoginHome lh = (LoginHome)CVUtility.getHomeObject("com.centraview.login.LoginHome", "Login");
      com.centraview.login.Login remote = lh.create();
      remote.setDataSource(this.dataSource);

      HashMap loginResult = remote.authenticateUser(userName, password);

      if (!loginResult.containsKey("error")) {
        // login was successful, generate a sessionID and stick it in the
        // HttpSession UserObject

        // then generate a sesionID
        HttpSession session = request.getSession();
        String sessionID = session.getId();

        // next, create a UserObject, and pass the sessionID to it
        String uoIndividualID = (String)loginResult.get("individualid");
        String uoFirstName = (String)loginResult.get("firstName");
        String uoLastName = (String)loginResult.get("lastName");
        String uoUserType = (String)loginResult.get("type");

        UserObject userObject = remote.getUserObject(Integer.parseInt(uoIndividualID),
            uoFirstName, uoLastName, uoUserType);
        userObject.setSessionID(sessionID);
View Full Code Here


   * Don't use lazy loading since it will be a wasted check every time
   * this thing better be setup.
   */
  private EJBHomeCache()
  {
    homeMap = new HashMap();
  }
View Full Code Here

      int activityID = Integer.parseInt(activityIDString);
      AuthorizationHome authHome = (AuthorizationHome)CVUtility.getHomeObject(
          "com.centraview.administration.authorization.AuthorizationHome", "Authorization");
      Authorization authorizationLocal = authHome.create();
      authorizationLocal.setDataSource(dataSource);
      HashMap ownerInfo = authorizationLocal.getOwner("Activities", activityID);
      String ownerIDString = ownerInfo.get("id").toString();
      int ownerID = -1;
      if (ownerIDString != null && !ownerIDString.equals("")) {
        ownerID = Integer.parseInt(ownerIDString);
      }
View Full Code Here

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

      // hashMap
      HashMap literatureHashMap = null;
      // literature form from session
      LiteratureForm sessionForm = null;

      // get from request windowid
      String windowId = (String) request.getParameter(MarketingConstantKeys.WINDOWID);
      String previousTab = (String) request.getParameter(MarketingConstantKeys.CURRENTTAB);

      if ((request.getParameter(MarketingConstantKeys.TYPEOFOPERATION).toString()).equals(MarketingConstantKeys.ADD))
      {
        // hash map for add literature
        literatureHashMap = (HashMap) session.getAttribute(MarketingConstantKeys.NEWMLHASHMAP);
        // get form from hashmap
        sessionForm = (LiteratureForm) literatureHashMap.get(windowId);
      }
      else if ((request.getParameter(MarketingConstantKeys.TYPEOFOPERATION).toString()).equals(MarketingConstantKeys.EDIT))
      {
        // hash map for edit literature
        literatureHashMap = (HashMap) session.getAttribute(MarketingConstantKeys.NEWMLHASHMAP);
        // get form from hashmap
        sessionForm = (LiteratureForm) literatureHashMap.get(windowId);
      }

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


      // set form for previous permission values
      if (MarketingConstantKeys.DETAIL.equals(previousTab))
      {
        sessionForm.setTitle(previousForm.getTitle());
        sessionForm.setDetail(previousForm.getDetail());
        sessionForm.setEntityname(previousForm.getEntityname());
        sessionForm.setEntityid(previousForm.getEntityid());
        sessionForm.setIndividualid(previousForm.getIndividualid());
        sessionForm.setIndividualname(previousForm.getIndividualname());
        sessionForm.setAssignedtoname(previousForm.getAssignedtoname());
        sessionForm.setAssignedtoid(previousForm.getAssignedtoid());
        sessionForm.setDeliverymethodid(previousForm.getDeliverymethodid());
        sessionForm.setDeliverymethodname(previousForm.getDeliverymethodname());
        sessionForm.setStatusid(previousForm.getStatusid());
        sessionForm.setStatusname(previousForm.getStatusname());
        sessionForm.setDuebymonth(previousForm.getDuebymonth());
        sessionForm.setDuebyday(previousForm.getDuebyday());
        sessionForm.setDuebytime(previousForm.getDuebytime());
        sessionForm.setDuebyyear(previousForm.getDuebyyear());
        sessionForm.setLiteraturenamevec(previousForm.getLiteraturenamevec());
        sessionForm.setLiteraturename(previousForm.getLiteraturename());
      }
/*      else if (MarketingConstantKeys.PERMISSION.equals(previousTab))
      {
        // view permission
        String[] viewPermissionS = previousForm.getViewpermission();
        Vector viewPermisionV = new Vector();
        DDNameValue viewPermissionListBox = null;
        String idName = "";
        String displayName = "";
        // if user have selected records
        if (previousForm.getViewpermission() != null)
        {
          int sizeOfListBox = viewPermissionS.length;
          for (int i=0;i<sizeOfListBox;i++)
          {
            int indexOfHash = viewPermissionS[i].indexOf("#");
            idName = viewPermissionS[i].substring(0, indexOfHash);
            displayName = viewPermissionS[i].substring(indexOfHash+1, viewPermissionS[i].length());
            viewPermissionListBox = new DDNameValue(viewPermissionS[i], displayName);
            viewPermisionV.add(viewPermissionListBox);
          }
          previousForm.setViewpermissionvec(viewPermisionV);
        }
        // if user have not selected records
        else
        {
          previousForm.setViewpermissionvec(new Vector());
        }

        // modify permission
        String[] modifyPermissionS = previousForm.getViewpermission();
        Vector modifyPermisionV = new Vector();
        DDNameValue modifyPermissionListBox = null;
        idName = "";
        displayName = "";
        // if user have selected records
        if (previousForm.getViewpermission() != null)
        {
          int sizeOfListBox = modifyPermissionS.length;
          for (int i=0;i<sizeOfListBox;i++)
          {
            int indexOfHash = modifyPermissionS[i].indexOf("#");
            idName = modifyPermissionS[i].substring(0, indexOfHash);
            displayName = modifyPermissionS[i].substring(indexOfHash+1, modifyPermissionS[i].length());
            modifyPermissionListBox = new DDNameValue(modifyPermissionS[i], displayName);
            modifyPermisionV.add(modifyPermissionListBox);
          }
          previousForm.setViewpermissionvec(modifyPermisionV);
        }
        // if user have not selected records
        else
        {
          previousForm.setViewpermissionvec(new Vector());
        }

        // delete permission
        String[] deletePermissionS = previousForm.getViewpermission();
        Vector deletePermisionV = new Vector();
        DDNameValue deletePermissionListBox = null;
        idName = "";
        displayName = "";
        // if user have selected records
        if (previousForm.getViewpermission() != null)
        {
          int sizeOfListBox = deletePermissionS.length;
          for (int i=0;i<sizeOfListBox;i++)
          {
            int indexOfHash = deletePermissionS[i].indexOf("#");
            idName = deletePermissionS[i].substring(0, indexOfHash);
            displayName = deletePermissionS[i].substring(indexOfHash+1, deletePermissionS[i].length());
            deletePermissionListBox = new DDNameValue(deletePermissionS[i], displayName);
            deletePermisionV.add(deletePermissionListBox);
          }
          previousForm.setViewpermissionvec(deletePermisionV);
        }
        // if user have not selected records
        else
        {
          previousForm.setViewpermissionvec(new Vector());
        }
        sessionForm.setAllindividual(previousForm.getAllindividual());
        sessionForm.setViewpermission(previousForm.getViewpermission());
        sessionForm.setViewpermissionvec(previousForm.getViewpermissionvec());
        sessionForm.setModifypermission(previousForm.getModifypermission());
        sessionForm.setModifypermissionvec(previousForm.getModifypermissionvec());
        sessionForm.setDeletepermission(previousForm.getDeletepermission());
        sessionForm.setDeletepermissionvec(previousForm.getDeletepermissionvec());
      }
*/
      // set the form back in session
      if ((request.getParameter(MarketingConstantKeys.TYPEOFOPERATION).toString()).equals(MarketingConstantKeys.ADD))
      {
        literatureHashMap.put(windowId, sessionForm);
        session.setAttribute(MarketingConstantKeys.NEWMLHASHMAP, literatureHashMap);
      }
      else if ((request.getParameter(MarketingConstantKeys.TYPEOFOPERATION).toString()).equals(MarketingConstantKeys.EDIT))
      {
        literatureHashMap.put(windowId, sessionForm);
        session.setAttribute(MarketingConstantKeys.EDITMLHASHMAP, literatureHashMap);
      }
    }
    catch (Exception e)
    {
View Full Code Here

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

      // hashMap
      HashMap literatureHashMap = null;
      // form from session
      LiteratureForm sessionForm = null;

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

      if ((request.getParameter(MarketingConstantKeys.TYPEOFOPERATION).toString()).equals(MarketingConstantKeys.ADD))
      {
        // hash map for add activity
        literatureHashMap = (HashMap) session.getAttribute(MarketingConstantKeys.NEWMLHASHMAP);
        // get form from hashmap
        sessionForm = (LiteratureForm) literatureHashMap.get(windowId);
      }
      else if ((request.getParameter(MarketingConstantKeys.TYPEOFOPERATION).toString()).equals(MarketingConstantKeys.EDIT))
      {
        // hash map for edit activity
        literatureHashMap = (HashMap) session.getAttribute(MarketingConstantKeys.EDITMLHASHMAP);
        // get form from hashmap
        sessionForm = (LiteratureForm) literatureHashMap.get(windowId);
      }

      // get previous form values
      LiteratureForm currentForm = (LiteratureForm) form;
View Full Code Here

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

      // hashMap
      HashMap literatureHashMap = null;
      // form from session
      LiteratureForm resetForm = null;

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

      if ((request.getParameter(MarketingConstantKeys.TYPEOFOPERATION).toString()).equals(MarketingConstantKeys.ADD))
      {
        // hash map for add activity
        literatureHashMap = (HashMap) session.getAttribute(MarketingConstantKeys.NEWMLHASHMAP);
        // get form from hashmap
        resetForm = (LiteratureForm) literatureHashMap.get(windowId);
      }
      else if ((request.getParameter(MarketingConstantKeys.TYPEOFOPERATION).toString()).equals(MarketingConstantKeys.EDIT))
      {
        // hash map for edit activity
        literatureHashMap = (HashMap) session.getAttribute(MarketingConstantKeys.EDITMLHASHMAP);
        // get form from hashmap
        resetForm = (LiteratureForm) literatureHashMap.get(windowId);
      }

      resetForm.setTitle("");
      resetForm.setDetail("");
      resetForm.setEntityname("");
      resetForm.setEntityid("");
      resetForm.setIndividualid("");
      resetForm.setIndividualname("");
      resetForm.setAssignedtoname("");
      resetForm.setAssignedtoid("");
      resetForm.setDeliverymethodid("");
      resetForm.setDeliverymethodname("");
      resetForm.setStatusid("");
      resetForm.setStatusname("");
      resetForm.setDuebymonth("");
      resetForm.setDuebyday("");
      resetForm.setDuebytime("");
      resetForm.setDuebyyear("");
      resetForm.setLiteraturenamevec(null);
      resetForm.setLiteraturename(null);

/*      resetForm.setAllindividual(null);
      resetForm.setDeletepermission(null);
      resetForm.setDeletepermissionvec(null);
      resetForm.setModifypermission(null);
      resetForm.setModifypermissionvec(null);
      resetForm.setViewpermission(null);
      resetForm.setViewpermissionvec(null);
*/
      // set the form back in session
      if ((request.getParameter(MarketingConstantKeys.TYPEOFOPERATION).toString()).equals(MarketingConstantKeys.ADD))
      {
        literatureHashMap.put(windowId, resetForm);
        session.setAttribute(MarketingConstantKeys.NEWMLHASHMAP, literatureHashMap);
      }
      else if ((request.getParameter(MarketingConstantKeys.TYPEOFOPERATION).toString()).equals(MarketingConstantKeys.EDIT))
      {
        literatureHashMap.put(windowId, resetForm);
        session.setAttribute(MarketingConstantKeys.EDITMLHASHMAP, literatureHashMap);
      }

    }
    catch (Exception e)
View Full Code Here

  public String newItemID;

  public ItemLines()
  {
    viewVector = new Vector();
    this.columnMap = new HashMap();

    columnMap.put( "LineId" , new Integer(100) );
    columnMap.put( "ItemId" , new Integer(100) );
    columnMap.put( "SKU" , new Integer(110) );
    columnMap.put( "Description" , new Integer(139) );
View Full Code Here

   */
  public int authenticateUser(String userName, String passwd)
  {
    String dataSource = Settings.getInstance().getSiteInfo(CVUtility.getHostName(((HttpServlet)MessageContext.getCurrentContext().getProperty(HTTPConstants.MC_HTTP_SERVLET)).getServletContext())).getDataSource();
    int authenticationString = AUTHENTICATION_FAILED_STATUS;
    HashMap hm = null;
    getPATH();
    try {
      InitialContext ic = CVUtility.getInitialContext();
      LoginHome lh = (LoginHome) ic.lookup("Login");
      Login remote = (Login) lh.create();
      remote.setDataSource(dataSource);
      hm = (HashMap) remote.authenticateUser(userName, passwd);
      //checking hashmap
      if (hm != null && hm.get("userid")!= null && hm.get("individualid")!= null && hm.get("lastName")!= null && hm.get("firstName")!= null ) {
        session.set("authenticateUserHashMap", hm);
        authenticationString = AUTHENTICATION_SUCCESS_STATUS;
        //QBSyncHome qbsh = (QBSyncHome) CVUtility.getHomeObject("com.centraview.qbsync.QBSyncHome", "QBSync");
        //QBSync remoteQB = (QBSync) qbsh.create();
        //remoteQB.initializeLog4j(logPATH + userName + "\\");
View Full Code Here

   * @return boolean
   */
  private boolean checkForSession()
  {
    boolean authenticateUserFlag = false;
    HashMap hm = (HashMap) session.get("authenticateUserHashMap");
    if (hm != null)
      authenticateUserFlag = true;

    return authenticateUserFlag;
  }
View Full Code Here

        //convertion module calls here
        QBXMLConverter converter = new QBXMLConverter();
        converter.setDataSource(dataSource);
        String PATH = (String)session.get("PATH");
        // Parse the QBXML and get the list of Objects we have to create or modify
        HashMap voMap = (HashMap) converter.getVOListFromQBXML(qbXML, PATH);
        String qbXMLname = (String)voMap.get("qbxmlname");
        // An array List of the VOs we parsed from the QBXML.
        ArrayList voList = (ArrayList)voMap.get("listvo");
        String moduleName = (String)voMap.get("modulename");

        System.out.println("*******************************MODULENAME************************************");
        System.out.println("***************************" + moduleName + "********************************");
        session.set("qbXMLName", qbXMLname);
        ArrayList newVOarrl = new ArrayList();
        ArrayList modVOarrl = new ArrayList();
        //sort objects for new and modify
        // Only Entity, Individual and Item have modifications?
        if (isEntityModule(moduleName) || moduleName.equals("Individual") || isItemModule(moduleName))
        {
          HashMap syncVOs = (HashMap)remote.chooseNewAndModify(voList, moduleName, LastSyncDate);
          newVOarrl = (ArrayList)syncVOs.get("ADD");
          modVOarrl = (ArrayList)syncVOs.get("MODIFY");
        } else {
            newVOarrl = voList;
        }
        //save in session modify VO arraylist, lastSyncDate, moduleName
        if (modVOarrl == null)
        {
          modVOarrl = new ArrayList();
          session.set("modArrl", modVOarrl);
        } else {
          session.set("modArrl", modVOarrl);
        }
        session.set("syncDate", LastSyncDate);
        session.set("moduleName", moduleName);
        //get from session individualID
        HashMap userhm = (HashMap)session.get("authenticateUserHashMap");
        int individualID = Integer.parseInt(userhm.get("individualid").toString());
        //call sync
        ArrayList VO = SynchronizeMod(individualID, LastSyncDate, moduleName, newVOarrl, "ADD");
        saveCVID(VO, moduleName);
        if (VO.size() > 0)
        {
          //convert VO to qbXML
          xmlVo = (String) converter.getQBXMLFromVOList(VO, qbXMLname, PATH, new HashMap(), "ADD");
        } else {
          xmlVo = "";
        }
      }
      catch (Exception e)
View Full Code Here

TOP

Related Classes of java.util.HashMap

Copyright © 2015 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.