Package com.centraview.email

Examples of com.centraview.email.AccountDetail


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



      Set s=hmEmail.keySet();

      Iterator iter=s.iterator();
      AccountDetail accountdetail = null;


      cvdal.setSql("email.getdefaultemailaccount");
      cvdal.setInt(1, userID);

      //System.out.println("userID"+userID);
      Collection defaultaccount = cvdal.executeQuery();
      cvdal.clearParameters();

      Iterator iteratordefaultaccount = defaultaccount.iterator();
      int defaultAccount= 0;
      while(iteratordefaultaccount.hasNext())
      {
        HashMap hmAccount = (HashMap)iteratordefaultaccount.next();
        String prefAccount=(String)hmAccount.get("preference_value");
        if (prefAccount != null && !prefAccount.equals("")){
          defaultAccount=Integer.parseInt(prefAccount);
        }
      }


      while (iter.hasNext())
      {
        Integer intKey  =(Integer)iter.next();
        String str    =(String)hmEmail.get(intKey);

        //System.out.println(" str "+str);
        //System.out.println(" int  "+intKey.intValue());

      //System.out.println("The userID is: " + Integer.toString(userID));
        cvdal.setSql("email.emaillistfolder");
        cvdal.setInt(1, intKey.intValue());
        cvdal.setInt(2, intKey.intValue());
        Collection collection = cvdal.executeQuery();
        cvdal.clearParameters();




        Iterator iterator = collection.iterator();
        String signature = null;
        int j = 0;
        int accountID = 0;
        int k = 0;
        while(iterator.hasNext())
        {

          HashMap hashmap1 = (HashMap)iterator.next();
          signature = (String)hashmap1.get("signature");


          accountID = ((Number)hashmap1.get("accountID")).intValue();
          //System.out.println("accountID  ::"+accountID);
/*
          if(((String)hashmap1.get("Default")).equals("YES"))
          {
            folderlist.setDefaultaccount(accountID);
            if(((String)hashmap1.get("FolderName")).equalsIgnoreCase("Inbox"))
            {
              folderlist.setDefaultFolder(((Long)hashmap1.get("folderid")).intValue());
              //System.out.println("DEFAULT  " + folderlist.getDefaultFolder());
            }
          }
*/
          //System.out.println("defaultAccount  ::"+defaultAccount);
          if(defaultAccount == accountID){
            folderlist.setDefaultaccount(accountID);
            if(((String)hashmap1.get("FolderName")).equalsIgnoreCase("Inbox"))
            {
              folderlist.setDefaultFolder(((Long)hashmap1.get("folderid")).intValue());
              //System.out.println("DEFAULT  " + folderlist.getDefaultFolder());
            }
          }

          if(k == 0)
          {
            //System.out.println("i == 0");
            String address = (String)hashmap1.get("address");
            String accountName = (String)hashmap1.get("accountName");
            accountdetail = new AccountDetail(address);
            // 1408
            String smtpserver = (String)hashmap1.get("smtpserver");
            accountdetail.setSmtpserver( smtpserver );

            accountdetail.setRights(str);

            int folderID = ((Long)hashmap1.get("folderid")).intValue();
            int parentID = ((Long)hashmap1.get("parent")).intValue();
            String folderName = (String)hashmap1.get("FolderName");
            String folderType = (String)hashmap1.get("ftype");

            String parentName = (String)hashmap1.get("parentname");

            int unreadmessages =((Long)hashmap1.get("unreadmessages")).intValue();

            int  allmesaage = ((Long)hashmap1.get("allMesages")).intValue();
            if ( allmesaage == -1 )
            {
              hashmap1 = (HashMap)iterator.next();
              allmesaage = ((Long)hashmap1.get("allMesages")).intValue();
              k++;
            }

            accountdetail.addFolder(new Folder(folderName, folderID, parentID, folderType , allmesaage ,unreadmessages ,parentName));
            accountdetail.setAccountid(accountID);
            accountdetail.setSignature(signature  );
            j = accountID;
          }
          else if(accountID != j)
          {
            //System.out.println("lastid" + j);
            folderlist.put(new Integer(j), accountdetail);
            //System.out.println("lastid");
            String s1 = (String)hashmap1.get("address");
            String s3 = (String)hashmap1.get("accountName");

            accountdetail = new AccountDetail(s1);
            accountdetail.setRights(str);
            int l1 = ((Long)hashmap1.get("folderid")).intValue();
            int j2 = ((Long)hashmap1.get("parent")).intValue();
            String s7 = (String)hashmap1.get("FolderName");
            String parentName = (String)hashmap1.get("parentname");
            String s9 = (String)hashmap1.get("ftype");

            int unreadmessages =((Long)hashmap1.get("unreadmessages")).intValue();

            int  allmesaage = ((Long)hashmap1.get("allMesages")).intValue();
            if ( allmesaage == -1 )
            {
              hashmap1 = (HashMap)iterator.next();
              allmesaage = ((Long)hashmap1.get("allMesages")).intValue();
              k++;
            }

            accountdetail.addFolder(new Folder(s7, l1, j2, s9 , allmesaage ,unreadmessages,parentName ));
            accountdetail.setAccountid(accountID);
            accountdetail.setSignature(signature  );
            j = accountID;
          }
          else
          {
            //System.out.println("same id ");
            int i1 = ((Long)hashmap1.get("folderid")).intValue();
            int j1 = ((Long)hashmap1.get("parent")).intValue();
            String s4 = (String)hashmap1.get("FolderName");
            String parentName = (String)hashmap1.get("parentname");
            String s5 = (String)hashmap1.get("ftype");

            // 1408
            String smtpserver = (String)hashmap1.get("smtpserver");

            int unreadmessages =((Long)hashmap1.get("unreadmessages")).intValue();

            int  allmesaage = ((Long)hashmap1.get("allMesages")).intValue();
            if ( allmesaage == -1 )
            {
              hashmap1 = (HashMap)iterator.next();
              allmesaage = ((Long)hashmap1.get("allMesages")).intValue();
              k++;
            }

            accountdetail.addFolder(new Folder(s4, i1, j1, s5 , allmesaage ,unreadmessages, parentName));
            accountdetail.setRights(str);
            accountdetail.setAccountid(accountID);
            accountdetail.setSignature(signature  );
            j = accountID;
          }

          k++;
          //System.out.println("in while loop ---- value of k -"+k + "----" +accountdetail.getRights() + "----" + accountdetail.getAccountid());
View Full Code Here

TOP

Related Classes of com.centraview.email.AccountDetail

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.