Changeset 4856


Ignore:
Timestamp:
07/25/11 15:23:55 (10 years ago)
Author:
fernando-alberto
Message:

Ticket #1269 - Desenvolvimento da nova solucao de arquivamento local MailArchiver?, from e subj nulos

File:
1 edited

Legend:

Unmodified
Added
Removed
  • sandbox/expressoMail1_2/MailArchiver/2.2/expressoMail1_2/js/mail_archiver.js

    r4722 r4856  
     1<!-- 
    12/*  
    23 * Mail Archive JS API 
     
    150151    this.drawdata = null; 
    151152    this.onprocess = false; 
     153    this.queryconfig = new MAQueryConfig(); 
    152154} 
    153155 
     
    597599 
    598600//listMessages operation 
     601//OLD local_messages.prototype.get_local_range_msgs = function(folder,msg_range_begin,emails_per_page,sort,sort_reverse,search,preview_msg_subject,preview_msg_tip) { 
     602//ONLINE messages_proxy.prototype.messages_list = function(folder,msg_range_begin,emails_per_page,sort_box_type,search_box_type,sort_box_reverse,preview_msg_subject,preview_msg_tip,call_back,tree_name) { 
    599603MailArchiver.prototype.listMessages = function(){ 
    600604    try{ 
     
    655659// -----------------------------------SERIALIZED DATA TEMPLATES ---------------- 
    656660MailArchiver.prototype.toExpressoAddress = function(data){ 
     661    if((typeof(data) != 'undefined') && (data.length > 0)){ 
    657662    /*var dataFormat = expresso_mail_archive.toExpressoFormatNameMail(data); 
    658663    var dataName = dataFormat[0]; 
     
    673678+           's:'+(dataName.length + dataEmail.length + 3)+':"'+dataName+'" <'+dataEmail+'>;' 
    674679+       '}'; 
    675     //window.alert('retorno do email: ' + tplFrom); 
     680    } 
     681    //Data adrress from mailbox is empty, null, or canot be correctly returned by service invocation (will return 'unknow mailbox' string) 
     682    else { 
     683        tplFrom = 'a:2{s:4:"name";s:14:"Unknow mailbox";s:5:"email";s:15:"Unknow_mailbox";}'; 
     684    } 
    676685    return(tplFrom); 
     686} 
     687 
     688MailArchiver.prototype.toExpressoSubject = function(data){ 
     689    if((typeof(data) != 'undefined') && (data.length > 0)){ 
     690        var tplSbj = 's:'+data.length+':"'+data+'";' 
     691    } 
     692    //Subject is empty, null, or canot be correctly returned by service invocation (will return 'Message without subject' string) 
     693    else { 
     694        tplSbj = 's:25:"[Message without subject]";'; 
     695    } 
     696    return(tplSbj); 
    677697} 
    678698 
     
    739759+           expresso_mail_archive.toExpressoAddress(data.getTo()) 
    740760+           's:7:"subject";' 
    741 +           's:'+data.getSubject().length+':"'+data.getSubject()+'";' 
     761+           expresso_mail_archive.toExpressoSubject(data.getSubject()) 
    742762+           's:4:"Size";' 
    743763+           'i:'+data.getSize()+';' 
     
    769789     
    770790} 
     791 
     792 
     793MailArchiver.prototype.Query = function(offlow, offup, qdata){ 
     794    var querystring = this.queryconfig.query(offlow, offup, qdata); 
     795    this.listMessages(); 
     796} 
     797 
    771798/* 
    772799 *The all pourpose JavaScript variable, used by all related functionalityes at 
     
    776803var expresso_mail_archive; 
    777804expresso_mail_archive = new MailArchiver(); 
     805--> 
Note: See TracChangeset for help on using the changeset viewer.