Ignore:
Timestamp:
09/11/11 09:16:08 (13 years ago)
Author:
fernando-alberto
Message:

Ticket #1269 - Desenvolvimento da nova solucao de arquivamento local MailArchiver?, tags para arquivamento

File:
1 edited

Legend:

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

    r5049 r5085  
    7171 
    7272MAPattern.prototype.toExpressoAttachmentsHeader = function(data){ 
    73     if((typeof(data) != 'undefined') && (data.length > 0)){ 
     73    if((typeof(data) != 'undefined') && (data.length > 2)){ 
    7474        var Attdata = eval("(" + data + ")"); 
    7575        if(typeof(Attdata.attachment) != 'undefined'){                     
     
    185185 
    186186MAPattern.prototype.toExpressoHeader = function(data){    
    187     var tplHeader = 'a:16:{' 
     187    var tplHeader = 'a:26:{' 
    188188+           's:11:"ContentType";' 
    189189+           's:' + data.getContentType().length + ':"' + data.getContentType() + '";' 
     
    382382    var objTag = eval('(' + tagData + ')'); 
    383383    var tplHMail = ""; 
    384  
     384     
     385    if(objTag.tag){ 
    385386    //More than 1 attachment - because length will be 'undefined' if just one exists 
    386387    if(objTag.tag.length >= 0){ 
     
    423424            tplHMail += 's:7:"Flagged";s:1:" ";';                       
    424425    } 
     426    } 
    425427     
    426428    //No header to tag 
     
    442444    var srlData = ""; 
    443445 
    444     //There are attacments, map them 
     446    //There are attacments, map all them 
    445447    if(typeof(objAtt.attachment) != 'undefined'){ 
    446448        srlData = 's:12:"array_attach";a:' + objAtt.attachment.length + ':{'; 
    447449        for(var m=0; m<objAtt.attachment.length; m++){ 
    448             //TODO "download" parametr at webservice => var urllink = 'http://10.200.242.186:4333/part/'+objAtt.attachment[m]["@id"]+'/download'; 
    449             //var urllink = 'http://10.200.242.186:4333/part/'+objAtt.attachment[m]["@id"]; 
    450             //var urllink = mail_archive_protocol+'://'+mail_archive_host+':'+mail_archive_port+'/part/'+objAtt.attachment[m]["@id"]; 
    451450            var urllink = mail_archive_protocol+'://'+mail_archive_host+':'+mail_archive_port+'/part/download/'+objAtt.attachment[m]["@id"]; 
    452451            srlData += 's:1:"' + m + '";' 
     
    468467MAPattern.prototype.toExpressoMailURLExportFile = function(path, file){ 
    469468    var srlData = 's:15:"url_export_file";'; 
    470     //var urllink = 'http://10.200.242.186:4333/mail/'+path+'/'+file+'/download'; 
    471     //var urllink = 'http://10.200.242.186:4333/mail/'+path+'/'+file; 
    472469    var urllink = mail_archive_protocol+'://'+mail_archive_host+':'+mail_archive_port+'/mail/'+path+'/'+file; 
    473470    srlData += 's:' + urllink.length + ':"' + urllink + '";' 
     
    578575        retorno['msg_folder'] = "local_"+rs.field(7); //Now it's a local folder 
    579576        retorno['msg_number'] = rs.field(0)+plus_id; //the message number is the rowid 
    580  **/     
     577 **/  
     578} 
     579 
     580MAPattern.prototype.tagConfig = function(taglist, arcidmsg){ 
     581    if(taglist != null){ 
     582        var tagdata = ""; 
     583         
     584        //Draft folder, are "draft" 
     585        if(expresso_mail_archive.folder_destination == 'drafts'){ 
     586            tagdata += '<add value="draft"/>'; 
     587        } 
     588         
     589        //Trash folder, are "deleted"" 
     590        if(expresso_mail_archive.folder_destination == 'trash'){ 
     591            tagdata += '<add value="deleted"/>'; 
     592        } 
     593         
     594        for(var x in taglist[0]){ 
     595            if((taglist[0][x] != '') && (taglist[0][x] != ' ') && (taglist[0][x] != null) && (x != 'msgid')) 
     596                tagdata += '<add value="'+x+'"/>'; 
     597        } 
     598 
     599        if(tagdata != ""){ 
     600         
     601            var tobject = '<tag>' 
     602            +              '<message id="'+arcidmsg+'">' 
     603            +              tagdata 
     604            +              '</message>' 
     605            +             '</tag>'; 
     606            return(tobject); 
     607        } 
     608        return(null); 
     609    } 
     610    return(null); 
    581611} 
    582612--> 
Note: See TracChangeset for help on using the changeset viewer.