Package java.util

Examples of java.util.HashMap$KeySpliterator


      // 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 
      ThreadForm currentForm = (ThreadForm) form;
View Full Code Here


      // 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) {
View Full Code Here

  private static Logger logger = Logger.getLogger(EventList.class);

  // constructor
  public  EventList()
  {
    columnMap = new HashMap();

    columnMap.put( "eventid" ,         new Integer(10) );
    columnMap.put( "title" ,         new Integer(120) );
    columnMap.put( "detail" ,         new Integer(120) ) ;
    columnMap.put( "start" ,         new Integer(100) );
View Full Code Here

//System.out.println("parentId"+parentId);
//System.out.println("createJunkMailFolder"+createJunkMailFolder);

    if(createJunkMailFolder){

      HashMap hmFolder = new HashMap();
      hmFolder.put("AccountID", new Integer(accountid));
      hmFolder.put("SubfolderID", new Integer(parentId));
      hmFolder.put("foldername", "Junk Mail");
      int i = remote.checkFoldersPresence(individualId, hmFolder);
      if (i != 0) // 0 means folder is present already
      {
        junkMailId = remote.addFolder(individualId, hmFolder);

          FolderList folderList = (FolderList)remote.getFolderList(individualId);
        session.setAttribute("folderlist", folderList);
      }
    }

//System.out.println("parentId After"+parentId);

        String messageID[] = request.getParameterValues("rowId");
        ArrayList emailFrom = remote.getEmailsFrom(messageID);

//System.out.println("emailFrom"+emailFrom);

    int ruleId = remote.getRuleId(accountid);

//System.out.println("ruleId Before"+ruleId);

    boolean rulecreated = false;
    if (ruleId == 0){

      HashMap hm = new HashMap();
      hm.put("RuleName", "JunkMail");
      hm.put("Description", "JunkMail");
      hm.put("EnabledStatus", "YES");
      hm.put("AccountID", accountid+"");

      int size = emailFrom.size();

      //System.out.println("size"+size);
      String join[] = new String[size];
      String field[] = new String[size];
      String condition[] = new String[size];
      String criteria[] = new String[size];

      for (int i=0; i<size; i++){
        join[i]="1";
        field[i]="1";
        condition[i]="3";
        String fromEmail = (emailFrom.get(i)).toString();
        int startIndex = fromEmail.indexOf("<");
        int endIndex = fromEmail.indexOf(">");
        if (startIndex >0){
          fromEmail = fromEmail.substring(startIndex,(endIndex-1));
        }
        criteria[i]=fromEmail;
        //System.out.println("emailFrom"+fromEmail);
      }
      hm.put("Join", join);
      hm.put("Field", field);
      hm.put("Condition", condition);
      hm.put("Criteria", criteria);

      hm.put("ActionMoveMessage", "1");
      hm.put("MoveFolderId", junkMailId+"");
      hm.put("ActionDeleteMessage", "0");
      hm.put("ActionMarkasRead", "0");
      hm.put("JunkMail", "TRUE");
      ruleId = remote.addRule(hm);
      rulecreated = true;
    }

    //System.out.println("Rule Id Final :"+ruleId);
View Full Code Here

  private static Logger logger = Logger.getLogger(TimeSheetList.class);

  // constructor
  public  TimeSheetList( )
  {
    columnMap = new HashMap();
    //columnMap.put( "TimeSheetID" , new Integer(140) );
    columnMap.put( "ID" , new Integer(140) );
    columnMap.put( "Employee" , new Integer(140) );
    columnMap.put( "StartDate" , new Integer(130) );
    columnMap.put( "EndDate" , new Integer(100) ) ;
View Full Code Here

  public ExpenseList()
  {
    primaryTable ="expense";
    PrimaryMemberType="ExpenseID";

    columnMap=new HashMap();
    columnMap.put("ExpenseID",new Integer(15));
    columnMap.put("Amount",new Integer(25));
    columnMap.put("Created",new Integer(50));
    columnMap.put("Reference",new Integer(50));
    columnMap.put("Status",new Integer(50));
View Full Code Here

  public ActionForward execute(ActionMapping mapping, ActionForm form, HttpServletRequest request, HttpServletResponse response) throws IOException, ServletException, CommunicationException, NamingException {
    String finalForward = ".view.support.tickets.my.list";
    String dataSource = Settings.getInstance().getSiteInfo(CVUtility.getHostName(super.getServlet().getServletContext())).getDataSource();
    GlobalMasterLists globalMasterLists = GlobalMasterLists.getGlobalMasterLists(dataSource);

    HashMap moduleList = new HashMap();
    if (globalMasterLists.get("moduleList") != null)
      moduleList = (HashMap)globalMasterLists.get("moduleList");

    long start = 0L;
    if (logger.isDebugEnabled()) {
      start = System.currentTimeMillis();
    }

    HttpSession session = request.getSession(true);

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

    // Check wheather the actionType is it Lookup or not
    String actionType = (String)request.getParameter("actionType");

    String listScope = request.getParameter("listScope");
       
    if (listScope != null && listScope.equals("ALL")) {
      finalForward = ".view.support.tickets.all.list";
      listScope = "ALL";
    } else {
      finalForward = ".view.support.tickets.my.list";
      listScope = "MY";
    }

    if (actionType != null && actionType.equals("lookup")) {
        listScope = "ALL";
    }
   
    UserObject userObject = (UserObject)session.getAttribute("userobject");
    int individualId = userObject.getIndividualID();
    ListPreference listPreference = userObject.getListPreference("Ticket");
    ListView view = listPreference.getListView(String.valueOf(listPreference.getDefaultView()));
    ValueListParameters listParameters = null;
    ValueListParameters requestListParameters = (ValueListParameters)request.getAttribute("listParameters");
    if (requestListParameters == null) // build up new Parameters
    {
      listParameters = new ValueListParameters(ValueListConstants.TICKET_LIST_TYPE, listPreference.getRecordsPerPage(), 1);
    } else { // paging or sorting or something, use the parameters from the
             // request.
      listParameters = requestListParameters;
    }
    if (listParameters.getSortColumn() == 0) {
      FieldDescriptor sortField = (FieldDescriptor)ValueListConstants.ticketViewMap.get(listPreference.getSortElement());
      listParameters.setSortColumn(sortField.getQueryIndex());
      if (listPreference.getsortOrder()) {
        listParameters.setSortDirection("ASC");
      } else {
        listParameters.setSortDirection("DESC");
      }
    }

    String filter = null;
    String filterParameter = request.getParameter("filter");

    if (filterParameter != null) {
      filter = (String)session.getAttribute("listFilter");
      if (listScope != null && listScope.equalsIgnoreCase("MY")) {
        filter += " AND assignedto = " + individualId + " AND ocstatus = 'OPEN'";
      }
      request.setAttribute("appliedSearch", filterParameter);
    } else {
      if (listScope != null && listScope.equalsIgnoreCase("MY")) {
        filter = " SELECT ticketid FROM ticket WHERE assignedto = " + individualId + " AND ocstatus = 'OPEN'";
      }
      session.removeAttribute("listFilter");
    }
    listParameters.setFilter(filter);

    // TODO remove crappy map between old views and new views.
    Vector viewColumns = view.getColumns();
    ArrayList columns = new ArrayList();
    // We the Action Type is Ticket's Lookup then we must have
    // to set the columns which we are going to look
    if (actionType != null && actionType.equals("lookup")) {
      Vector lookupViewColumns = new Vector();
      lookupViewColumns.add("Number");
      lookupViewColumns.add("Subject");
      lookupViewColumns.add("Entity");
      ActionUtil.mapOldView(columns, lookupViewColumns, ValueListConstants.TICKET_LIST_TYPE);
      listParameters.setRecordsPerPage(100);
      finalForward = ".view.support.ticketslookup";
    } else {
      ActionUtil.mapOldView(columns, viewColumns, ValueListConstants.TICKET_LIST_TYPE);
    }
    listParameters.setColumns(columns);

    // Get the list!
    ValueListHome valueListHome = (ValueListHome)CVUtility.getHomeObject("com.centraview.valuelist.ValueListHome", "ValueList");
    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);

    session.setAttribute("ticketPieChartParams", listParameters);
    session.setAttribute("ticketBarChartParams", listParameters);
    ArrayList buttonList = new ArrayList();
    // For the searchBar
    String moduleID = (String)moduleList.get("Ticket");

    ValueListDisplay displayParameters = null;
    if (actionType != null && actionType.equals("lookup")) {
      // When we select the lookup then we should add the Select button to the
      // valueList
View Full Code Here

      saveErrors(request, allErrors);
      session.removeAttribute("listErrorMessage");
    }
   
    GlobalMasterLists globalMasterLists = GlobalMasterLists.getGlobalMasterLists(dataSource);
    HashMap moduleList = new HashMap();
    if (globalMasterLists.get("moduleList") != null)
      moduleList = (HashMap)globalMasterLists.get("moduleList");
   
    ListPreference listPreference = userObject.getListPreference("Promotion");
    ListView view = listPreference.getListView(String.valueOf(listPreference.getDefaultView()));
   
    ValueListParameters listParameters = null;
    ValueListParameters requestListParameters = (ValueListParameters)request.getAttribute("listParameters");
    if (requestListParameters == null) { // build up new Parameters
      listParameters = new ValueListParameters(ValueListConstants.PROMOTION_LIST_TYPE, listPreference.getRecordsPerPage(), 1);
    } else { // paging or sorting or something, use the parameters from the request.
      listParameters = requestListParameters;
    }
    if (listParameters.getSortColumn() == 0) {
      FieldDescriptor sortField = (FieldDescriptor)ValueListConstants.promotionViewMap.get(listPreference.getSortElement());
      listParameters.setSortColumn(sortField.getQueryIndex());
      if (listPreference.getsortOrder())
        listParameters.setSortDirection("ASC");
      else
        listParameters.setSortDirection("DESC");
    }
   
    //  Search handling
    String filter = null;
    String filterParameter = request.getParameter("filter");
    if (filterParameter != null) {
      filter = (String)session.getAttribute("listFilter");
      request.setAttribute("appliedSearch", filterParameter);
    } else {
      session.removeAttribute("listFilter");
    }
    listParameters.setFilter(filter);
   
    Vector viewColumns = view.getColumns();
    ArrayList columns = new ArrayList();   
    ActionUtil.mapOldView(columns, viewColumns, ValueListConstants.PROMOTION_LIST_TYPE);
    listParameters.setColumns(columns);
   
    // Get the list!
    ValueListHome valueListHome = (ValueListHome)CVUtility.getHomeObject("com.centraview.valuelist.ValueListHome", "ValueList");
    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("View", "view", "vl_viewList();", false));
    buttonList.add(new Button("Delete", "delete", "vl_deleteList();", false));
    buttonList.add(new Button("Duplicate", "duplicate", "vl_duplicateList();", false));
    ValueListDisplay displayParameters = new ValueListDisplay(buttonList, true, true);
    displayParameters.setSortable(true);
    displayParameters.setPagingBar(true);
    displayParameters.setLink(true);
    listObject.setDisplay(displayParameters);
    request.setAttribute("valueList", listObject);
   
    //  For the searchBar
    String moduleID = (String)moduleList.get("Promotion");
    request.setAttribute("moduleId", moduleID);
    request.setAttribute("listType", "Promotion");
   
    return mapping.findForward(finalForward);
  }
View Full Code Here

    AuthorizationHome authHome = (AuthorizationHome)CVUtility.getHomeObject("com.centraview.administration.authorization.AuthorizationHome", "Authorization");
    try {
      HttpSession session = request.getSession(false);

      HashMap hm = new HashMap();

      RecordPermissionForm permissionForm = (RecordPermissionForm)form;

      if (permissionForm == null) {
        permissionForm = new RecordPermissionForm();
      }
      permissionForm.setModify("");
      permissionForm.setDeleten("");
      permissionForm.setView("");

      Vector vecview = new Vector();
      Vector vecmodify = new Vector();
      Vector vecdelete = new Vector();

      Collection colview = new ArrayList();
      Collection colmodify = new ArrayList();
      Collection coldelete = new ArrayList();

      int uid = Integer.parseInt(request.getParameter("contactID").toString());
      request.setAttribute("userID",new Integer(uid));

      Authorization authRemote = (Authorization)authHome.create();

      hm = authRemote.getDefaultPermissions(uid);

      if (! authRemote.getUserDefaultPermission(uid).equalsIgnoreCase("Yes")) {
        if (hm != null) {
          vecview = (Vector)hm.get("VIEW");
          vecmodify = (Vector)hm.get("UPDATE");
          vecdelete = (Vector)hm.get("DELETE");
        }
      }else{
        request.setAttribute("isPublic","Yes");
      }


      ContactFacadeHome facadeHome = (ContactFacadeHome)CVUtility.getHomeObject("com.centraview.contact.contactfacade.ContactFacadeHome", "ContactFacade");
      ContactFacade cfremote = (ContactFacade)facadeHome.create();
      cfremote.setDataSource(dataSource);

      // get the records from the database
      Collection sqlResults = cfremote.getUserListCollection(uid);

      // now create a DisplayList out of those records
      IndividualList employeeList = new IndividualList();

      // ok, now that we have the results from the database,
      // we need to generate a DisplayList object to pass
      // to the List View code (List.jsp)
      Iterator iter = sqlResults.iterator();

      while (iter.hasNext()) {
        HashMap sqlRow = (HashMap)iter.next();

        String individualName = (String)sqlRow.get("Name");
        int individualID  = ((Number)sqlRow.get("IndividualID")).intValue();

        IntMember individualIDfield = new IntMember("IndividualID", individualID, 10, "", 'T', false, 10);
        StringMember nameField  = new StringMember("Name", individualName, 10, "/centraview/ViewHandler.do?" + Constants.TYPEOFCONTACT + "=" + Constants.INDIVIDUAL  + "&rowId=" + individualID, 'T', true);

        if (vecview != null && vecview.contains(new Long(individualID))) {
View Full Code Here

   * @param qbxmlName String
   * @return HashMap (ExternalID,EditSequence)
   */
  public HashMap getEditSequenceList(String qbxml, String qbxmlName)
  {
    HashMap hm = new HashMap();

    try
    {
      NodeList list = getDocumentFromString(qbxml).getElementsByTagName(qbxmlName.substring(0, qbxmlName.length() - 7) + "Ret");
      Node node = null;

      String externalID;
      String editSequence;

      int length = list.getLength();

      for (int i = 0; i < length; i++)
      {
        node = list.item(i);
        externalID = getValueOfNodeByTagName(node, TAG_LISTID);
        editSequence = getValueOfNodeByTagName(node, "EditSequence");
        hm.put(externalID, editSequence);
      }
    } catch (Exception e)
    {
      logger.error("[getEditSequenceList] Exception thrown.", e);
      e.printStackTrace();
View Full Code Here

TOP

Related Classes of java.util.HashMap$KeySpliterator

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.