Package java.util

Examples of java.util.HashMap


    HttpSession session = ((HttpServletRequest)pageContext.getRequest()).getSession();
    UserObject userObject = (UserObject)session.getAttribute("userobject");

    ModuleFieldRightMatrix modulefieldrightmatrix = userObject.getUserPref().getModuleAuthorizationMatrix();

    HashMap hashmap = modulefieldrightmatrix.getFieldRights(getModulename());
    if(hashmap != null && hashmap.containsKey(getFieldname()))
      fieldRight = ((Integer)hashmap.get(getFieldname())).intValue();

    int individualID = userObject.getIndividualID();

    StringBuffer results = new StringBuffer();
View Full Code Here


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

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

    columnMap.put( "individualid" ,   new Integer(100) );
    columnMap.put( "individualname" ,   new Integer(120) );
    columnMap.put( "email" ,       new Integer(120) ) ;
    columnMap.put( "accepted" ,     new Integer(100) );
View Full Code Here

  public void  deleteElement( int indvID, String individualID ) throws CommunicationException,NamingException
  {
    MarketingFacadeHome marketingFacadeHome = (MarketingFacadeHome)CVUtility.getHomeObject("com.centraview.marketing.marketingfacade.MarketingFacadeHome","MarketingFacade");
    try
    {
      HashMap hm = new HashMap();
      hm.put("individualid",individualID);
      hm.put("eventid", new Integer( eventId ));
      MarketingFacade remote =(MarketingFacade)marketingFacadeHome.create();
      remote.setDataSource(this.dataSource);

      int i = remote.deleteEventRegister( hm );
    }
View Full Code Here

      Iterator iter = listkey.iterator();
      while (iter.hasNext()) {
        String key = (String)iter.next();
        ListElement row = (ListElement)questionList.get(key);

        HashMap questionInfo = new HashMap();
       
        StringMember questionField = (StringMember)row.get("Question");
        StringMember answerField = (StringMember)row.get("Answer");
       
        questionInfo.put("questionID", new Integer(row.getElementID()));
        questionInfo.put("question", (String)questionField.getMemberValue());
        questionInfo.put("answer", (String)answerField.getMemberValue());
        qList.add(questionInfo);
      }

      faqForm.set("questionList", qList);
View Full Code Here

  {
    ArrayList resultDeleteLog = new ArrayList();
    MarketingFacadeHome marketingFacadeHome = (MarketingFacadeHome)CVUtility.getHomeObject("com.centraview.marketing.marketingfacade.MarketingFacadeHome","MarketingFacade");
    try
    {
      HashMap hm = new HashMap();
      hm.put("individualid",individualID+"");
      hm.put("eventid", new Integer( eventId ));
     
      //call to EJB server
      MarketingFacade remote =(MarketingFacade)marketingFacadeHome.create();
      remote.setDataSource(this.dataSource);
      for (int i=0; i<recordID.length; i++)
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("EmployeeHandbook");
    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.EMPLOYEE_HANDBOOK_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.employeeHandbookViewMap.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.EMPLOYEE_HANDBOOK_LIST_TYPE);
    listParameters.setColumns(columns);
   
    CvFolderVO folder = null;
    try {
      CvFileHome home = (CvFileHome)CVUtility.getHomeObject("com.centraview.file.CvFileHome", "CvFile");
      CvFile remote = (CvFile)home.create();
      remote.setDataSource(dataSource);
      folder = remote.getFolderByName(individualId, 2, "CV_EMPLOYEEHANDBOOK_DEFAULT_FOLDER");
    } catch (Exception e) {
      logger.error("Exception thrown in EmployeeHandbookValueListAction");
      e.printStackTrace();
    }
    int folderID = folder.getFolderId();
/*    String param = request.getParameter("folderId");
    if (param != null) {
      if (param.indexOf("*") == -1)
        folderID = Integer.parseInt(param);
      else
        folderID = Integer.parseInt(param.substring(0, param.indexOf("*")));
    }
  */  listParameters.setFolderID(folderID);
    request.setAttribute("folderId", String.valueOf(folderID));
   
    // 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("Delete", "delete", "vl_deleteList();", false));
    ValueListDisplay displayParameters = new ValueListDisplay(buttonList, true, true);
    displayParameters.setSortable(true);
    displayParameters.setPagingBar(true);
    displayParameters.setLink(true);
    // Add the download file column
    displayParameters.setDownloadIcon(true);
    listObject.setDisplay(displayParameters);
    request.setAttribute("valueList", listObject);
   
    //  For the searchBar
    String moduleID = (String)moduleList.get("EmployeeHandbook");
    request.setAttribute("moduleId", moduleID);
    request.setAttribute("listType", "EmployeeHandbook");

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

    String strAction = request.getParameter("action");     
   
    if(strAction !=null && !strAction.equalsIgnoreCase("cancel"))
    {
    MailMessage mailmessage  = new MailMessage();
    HashMap hm               = new HashMap();
      String mailTo = (String)dynaForm.get("composeTo");
      String mailFrom = (String)dynaForm.get("composeFrom");
      String subject = (String)dynaForm.get("composeSubject");
      String body = (String)dynaForm.get("composeMessage");
      String replyTo = (String)dynaForm.get("composeReplyTo");

      mailmessage.setMailFrom(mailFrom);
      mailmessage.setSubject(subject);
      mailmessage.setBody(body);
      mailmessage.setReplyTo(replyTo);
 
      String accountid               = (String) dynaForm.get("accountID");
      mailmessage.setAccountID(Integer.parseInt(accountid));
 
      FolderList fl                  = (FolderList) session.getAttribute("folderlist");
      Set listkey                    = fl.keySet();
      Iterator it                    = listkey.iterator();
 
      String smtpserver              = "";
      while (it.hasNext())
      {
      AccountDetail ad1  = (AccountDetail) fl.get(it.next());
      if (Integer.parseInt(accountid) == ad1.getAccountid())
      {
        smtpserver = ad1.getSmtpserver();
        mailmessage.setFolder(ad1.getFolderIDFromName("Sent", "SYSTEM"));
      } //end of if statement (Integer.parseInt(accountid) == ad1.getAccountid())
      } //end of while loop (it.hasNext())
      mailmessage.setSmtpserver(smtpserver);
 
      //message Date
      long l                         = (new java.util.Date()).getTime();
      mailmessage.setMessageDate( new java.sql.Timestamp( ) ) ;
 
      //Attchment
      HashMap attchmentids           = (HashMap) session.getAttribute("AttachfileList");
      mailmessage.setAttachFileIDs(attchmentids);
 
      session.removeAttribute("AttachfileList");
      EmailFacadeHome aa             = (EmailFacadeHome) CVUtility.getHomeObject("com.centraview.email.emailfacade.EmailFacadeHome", "EmailFacade");
      EmailFacade remote             = (EmailFacade) aa.create();
View Full Code Here

   * @param form DynaActionForm to be processed.
   * @return DynaActionForm whose properties have been processed.
   */
  public DynaActionForm parseSpecialChars(DynaActionForm form)
  {
    HashMap properties = (HashMap)form.getMap();
    Set keys = (Set)properties.keySet();
    Iterator iter = keys.iterator();
    while (iter.hasNext())
    {
      String key = (String)iter.next();
      String value = (String)form.get(key);
View Full Code Here

      if (fullPathList != null)
      {
        Iterator pathIter = fullPathList.iterator();
        while (pathIter.hasNext())
        {
          HashMap folderInfo = (HashMap)pathIter.next();
          fullPath.append("/" + (String)folderInfo.get("name"));
        }
      }
      folderForm.set("fullPath", fullPath.toString());
      folderForm.set("parentID", new Integer(parentID));
View Full Code Here

        remote.setDataSource(dataSource);
        EventDetails oldEvent = remote.getEventDetails(individualId, eventID);

        if (oldEvent != null)
        {
          HashMap newEventHashMap = new HashMap();
          newEventHashMap.put("Creator", Integer.toString(individualId));
          newEventHashMap.put("Name", oldEvent.getName());
          newEventHashMap.put("Description", oldEvent.getDetail());
          newEventHashMap.put("WhoShouldAttend", oldEvent.getWhoshouldattend());
          newEventHashMap.put("MaxAttendees", Integer.toString(oldEvent.getMaxattendees()));
          newEventHashMap.put("Moderator", Integer.toString(oldEvent.getModeratorid()));
          //newEventHashMap.put("StartDate", (Timestamp) oldEvent.getStartdate());
          //newEventHashMap.put("EndDate", (Timestamp) oldEvent.getEnddate());
          Timestamp startTimestamp = (Timestamp)oldEvent.getStartdate();
          Timestamp endTimestamp = (Timestamp)oldEvent.getEnddate();

          //This section SHOULD NOT NEED TO BE DONE.
          //The way Timestamps are currently handled means I have to do this this way.
          Calendar tempCalendar = new GregorianCalendar();
          //fix the start time
          tempCalendar.setTimeInMillis(startTimestamp.getTime());
          tempCalendar.add(Calendar.YEAR, 1900);
          startTimestamp.setTime(tempCalendar.getTimeInMillis());

          //fix the end time
          tempCalendar.setTimeInMillis(endTimestamp.getTime());
          tempCalendar.add(Calendar.YEAR, 1900);
          endTimestamp.setTime(tempCalendar.getTimeInMillis());
          //End of This section SHOULD NOT NEED TO BE DONE.

          newEventHashMap.put("StartDate", startTimestamp);
          newEventHashMap.put("EndDate", endTimestamp);

          //Add the attachment here
          MailMessage mailmessage = null;
          EmailFacadeHome cfh = (EmailFacadeHome)CVUtility.getHomeObject("com.centraview.email.emailfacade.EmailFacadeHome", "EmailFacade");
          EmailFacade facade = (EmailFacade)cfh.create();
          HashMap hm = new HashMap();
          hm.put("MessageID", new Integer(eventID));

          mailmessage = facade.getAttachment(individualId, hm);

          ArrayList attachments = mailmessage.getAttachmentID();
          HashMap newAttachments = new HashMap();
          if (attachments != null)
          {
            Iterator attachmentIterator = attachments.iterator();
            while (attachmentIterator.hasNext())
            {
              Attachment attachment = (Attachment)attachmentIterator.next();
              newAttachments.put(Integer.toString(attachment.getFileID()), attachment.getFilename());
            } //end of while loop (attachmentIterator.hasNext())
          } //end of if statement (attachments != null)

          newEventHashMap.put("Attachment", newAttachments);

          newEventID = remote.addEvent(newEventHashMap, individualId);
        } //end of if statement (eventDetails != null)

        Collection oldEventAttendees = remote.getAttendeesForEvent(individualId, eventID);
        if (oldEventAttendees != null)
        {
          HashMap map = new HashMap();
          Iterator iterator = oldEventAttendees.iterator();
          String[] individualIDs = new String[oldEventAttendees.size()];

          map.put("EventId", Integer.toString(newEventID));
          map.put("Accepted", "NO");
          int i = 0;

          while (iterator.hasNext())
          {
            EventAttendeeVO eventAttendeeVO = (EventAttendeeVO)iterator.next();
            individualIDs[i] = Integer.toString(eventAttendeeVO.getIndividualID());
            i++;
          } //end of while loop (iterator.hasNext())
          map.put("IndividualId", individualIDs);

          remote.addEventRegister(map, individualId);

        } //end of if statement (oldEventAttendees != null)
View Full Code Here

TOP

Related Classes of java.util.HashMap

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.