Changeset c4e569


Ignore:
Timestamp:
Sep 21, 2010, 12:29:45 AM (10 years ago)
Author:
rene <just@…>
Branches:
ng_0.6, ng_0.8, ng_0.9
Children:
c65ba0
Parents:
2e8903
Message:

changed vI_rdfDatasource into class to allow multiple instances

Location:
chrome
Files:
12 edited

Legend:

Unmodified
Added
Removed
  • chrome/content/v_identity/vI_context.xul

    r2e8903 rc4e569  
    2929<!ENTITY % vIdentDTD SYSTEM "chrome://v_identity/locale/v_identity.dtd">
    3030%vIdentDTD;
     31<!ENTITY % abMainWindowDTD SYSTEM "chrome://messenger/locale/addressbook/abMainWindow.dtd" >
     32%abMainWindowDTD;
    3133]>
    3234
     
    5961                <menuitem label="&vident.vI_Menu.Settings.label;"
    6062                      oncommand="window.open('chrome://v_identity/content/vI_prefDialogOpener.xul', '', 'chrome, dialog, resizable=yes');" />
    61                 <menuitem label="&vident.vI_Menu.DataEditor.label;"
    62                       oncommand="window.open('chrome://v_identity/content/vI_rdfDataTree.xul', '', 'chrome, dialog, resizable=yes');" />
     63                <menu label="&vident.vI_Menu.DataStorage.label;">
     64                    <menupopup>                       
     65                        <menuitem label="&vident.vI_Menu.DataEditor.label;"
     66                            oncommand="window.open('chrome://v_identity/content/vI_rdfDataTree.xul', '', 'chrome, dialog, resizable=yes');" />
     67                        <menuitem label="&importCmd.label;" accesskey="&importCmd.accesskey;" oncommand="vI_rdfDatasource = new vI_rdfDatasource(); vI_rdfDatasource.import('virtualIdentity.rdf')"/>
     68                        <menuitem label="&exportCmd.label;" accesskey="&exportCmd.accesskey;" oncommand="vI_rdfDatasource = new vI_rdfDatasource(); vI_rdfDatasource.export('virtualIdentity.rdf')"/>
     69                    </menupopup>
     70                </menu>
    6371            </menupopup>
    6472        </menu>
  • chrome/content/v_identity/vI_prefDialog.xul

    r2e8903 rc4e569  
    5858<script type="application/x-javascript"
    5959            src="chrome://v_identity/content/vI_helper.js" />
     60<script type="application/x-javascript"
     61            src="chrome://v_identity/content/vI_rdfDatasource.js" />
     62<script type="application/x-javascript"
     63            src="chrome://v_identity/content/vI_notificationBar.js" />
    6064
    6165<stringbundleset id="stringbundleset">
     
    570574                <spacer class="paragraph"/>
    571575                <button id="VIdent_identity.storage.openEditor" label="&vI_prefDialog.storage.openEditor;" oncommand="openDialog('chrome://v_identity/content/vI_rdfDataTree.xul', '', 'chrome, dialog, resizable=yes');" />
     576                <button id="VIdent_identity.storage.import" label="&vI_prefDialog.storage.import;" oncommand="vI_rdfDatasource = new vI_rdfDatasource(); vI_rdfDatasource.import('virtualIdentity.rdf')" />
     577                <button id="VIdent_identity.storage.export" label="&vI_prefDialog.storage.export;" oncommand="vI_rdfDatasource = new vI_rdfDatasource(); vI_rdfDatasource.export('virtualIdentity.rdf')" />
    572578                </groupbox>
    573579            </tabpanel>
  • chrome/content/v_identity/vI_rdfDataTree.js

    r2e8903 rc4e569  
    3838
    3939
    40 function rdfDataTree(treeType) {
     40function rdfDataTree(treeType, vI_rdfDatasource) {
    4141    this.treeType = treeType;
     42    this._vI_rdfDatasource = vI_rdfDatasource;
    4243    this.filterText = "";
    4344    this.loadTable();
     
    4849    filterText : null,
    4950    treeType : null,
    50 
    51     get treeElem() { return document.getElementById("rdfDataTree_" + this.treeType); },
     51    _vI_rdfDatasource : null,
     52
     53    get treeElem() { return document.getElementById("rdfDataTree_" + this.treeType); },
    5254    get tabElem() { return document.getElementById(this.treeType + "Tab"); },
    5355   
    5456    //this function is called every time the tree is sorted, filtered, or reloaded
    5557    loadTable : function() {
     58//         if (vI_notificationBar) vI_notificationBar.dump("## rdfDataTree: loadTable.\n");
    5659        //remember scroll position. this is useful if this is an editable table
    5760        //to prevent the user from losing the row they edited
     
    6063        if (this.idData == null) {
    6164            this.idData = [];
    62             vI_rdfDatasource.readAllEntriesFromRDF(this.addNewDatum, this.treeType, this.idData);
     65            this._vI_rdfDatasource.readAllEntriesFromRDF(this.addNewDatum, this.treeType, this.idData);
    6366        }
    6467        if (this.filterText == "") {
     
    8992        // set Tab label
    9093        this.tabElem.setAttribute("label", this.treeType + " (" + this.idTable.length + ")");
     94//         if (vI_notificationBar) vI_notificationBar.dump("## rdfDataTree: loadTable done.\n");
    9195    },
    9296
     
    106110    },
    107111    sort : function(columnName) {
    108         vI_notificationBar.dump("## sort: " + columnName + ".\n");
     112//      vI_notificationBar.dump("## sort: " + columnName + ".\n");
    109113        var order = this.treeElem.getAttribute("sortDirection") == "ascending" ? 1 : -1;
    110114        //if the column is passed and it's already sorted by that column, reverse sort
     
    148152   
    149153    _strings : null,
     154    _vI_rdfDatasource : null,
    150155   
    151156    onselect : function () {
     
    180185        vI_rdfDataTree._strings = document.getElementById("vI_rdfDataTreeBundle");
    181186
    182         vI_rdfDatasource.init();
     187        vI_rdfDataTree._vI_rdfDatasource = new vI_rdfDatasource("virtualIdentity.rdf");
    183188       
    184189        for each (var treeType in vI_rdfDataTree.treeTypes)
    185             vI_rdfDataTree.trees[treeType] = new rdfDataTree(treeType);
    186     },
    187    
    188     get _braille() {
     190            vI_rdfDataTree.trees[treeType] = new rdfDataTree(treeType, vI_rdfDataTree._vI_rdfDatasource);
     191    },
     192   
     193    clean : function() {
     194        if (vI_rdfDataTree._vI_rdfDatasource) vI_rdfDataTree._vI_rdfDatasource.clean();
     195    },
     196
     197    get _braille() {
    189198        var prefRoot = Components.classes["@mozilla.org/preferences-service;1"]
    190199            .getService(Components.interfaces.nsIPrefService).getBranch(null);
     
    303312                    "chrome, dialog, modal, alwaysRaised, resizable=yes",
    304313                    tree.idTable[v], treeType,
    305                     vI_rdfDatasource, retVar).focus();
     314                    vI_rdfDataTree._vI_rdfDatasource, retVar).focus();
    306315        }
    307316       
     
    332341            tree.treeElem.view.selection.getRangeAt(t,start,end);
    333342            for (var v=start.value; v<=end.value; v++){
    334                 vI_rdfDatasource.removeVIdentityFromRDF(tree.idTable[v]["resource"], treeType)
     343                vI_rdfDataTree._vI_rdfDatasource.removeVIdentityFromRDF(tree.idTable[v]["resource"], treeType)
    335344            }
    336345        }
     
    378387        tree.treeElem.view.selection.getRangeAt(0,start,end);
    379388        for (var v=start.value; v<=end.value; v++){
    380             var resource = vI_rdfDatasource.filterContainer.RemoveElementAt(v+1, true);
    381             vI_rdfDatasource.filterContainer.InsertElementAt(resource,v,true);
     389            var resource = vI_rdfDataTree._vI_rdfDatasource.filterContainer.RemoveElementAt(v+1, true);
     390            vI_rdfDataTree._vI_rdfDatasource.filterContainer.InsertElementAt(resource,v,true);
    382391        }
    383392        tree.idData = null; tree.idTable = null;
     
    398407        tree.treeElem.view.selection.getRangeAt(0,start,end);
    399408        for (var v=end.value; v>=start.value; v--){
    400             var resource = vI_rdfDatasource.filterContainer.RemoveElementAt(v+1, true);
    401             vI_rdfDatasource.filterContainer.InsertElementAt(resource,v+2,true);
     409            var resource = vI_rdfDataTree._vI_rdfDatasource.filterContainer.RemoveElementAt(v+1, true);
     410            vI_rdfDataTree._vI_rdfDatasource.filterContainer.InsertElementAt(resource,v+2,true);
    402411        }
    403412        tree.idData = null; tree.idTable = null;
     
    437446            "chrome, dialog, modal, alwaysRaised, resizable=yes",
    438447            newItemPreset, treeType,
    439             vI_rdfDatasource, retVar).focus();
     448            vI_rdfDataTree._vI_rdfDatasource, retVar).focus();
    440449
    441450        // reload all trees (multiple types might have changed)
  • chrome/content/v_identity/vI_rdfDataTree.xul

    r2e8903 rc4e569  
    3838%messengercomposeDTD;
    3939<!ENTITY % filtersDTD SYSTEM "chrome://messenger/locale/FilterListDialog.dtd">%filtersDTD;
     40<!ENTITY % abMainWindowDTD SYSTEM "chrome://messenger/locale/addressbook/abMainWindow.dtd" >
     41%abMainWindowDTD;
    4042]>
    4143
     
    4446        width="750"
    4547        height="500"
    46     persist="width,height,screenX,screenY"
     48        persist="width,height,screenX,screenY"
    4749        onload="vI_rdfDataTree.init();"
    48     title="&vI_rdfDataTree.dlgTitle.label;">
     50        onunload="vI_rdfDataTree.clean();"
     51        title="&vI_rdfDataTree.dlgTitle.label;">
    4952
    5053<script type="application/x-javascript" src="chrome://v_identity/content/vI_rdfDataTree.js" />
     
    5255<script type="application/x-javascript" src="chrome://v_identity/content/vI_helper.js" />
    5356<script type="application/x-javascript" src="chrome://v_identity/content/vI_rdfDatasource.js" />
    54 <script type="application/x-javascript" src="chrome://v_identity/content/vI_storageExtras.js" />
    55 <script type="application/x-javascript" src="chrome://v_identity/content/vI_storage.js" />
    5657<script type="application/x-javascript" src="chrome://v_identity/content/vI_notificationBar.js"/>
    5758<script type="application/x-javascript" src="chrome://messenger/content/messengercompose/MsgComposeCommands.js"/>
    58 
    5959
    6060<stringbundleset id="stringbundleset">
     
    9696    <vbox><spacer flex="1"/>
    9797    <menubar>
    98         <menu id="editMenu" label="&vI_rdfDataTree.editMenu.label;"
    99             accesskey="&vI_rdfDataTree.editMenu.accesskey;">
    100         <menupopup onpopupshowing="if (event.target == this) vI_rdfDataTree.updateMenu();">
    101             <menuitem id="menu_modifySelected" label="&vI_rdfDataTree.modifySelected.label;"
    102                 accesskey="&vI_rdfDataTree.modifySelected.accesskey;"
    103                 oncommand="vI_rdfDataTree.modifySelected();"/>
    104             <menuitem id="menu_removeSelected" label="&vI_rdfDataTree.removeSelected.label;"
    105                 accesskey="&vI_rdfDataTree.removeSelected.accesskey;"
    106                 oncommand="vI_rdfDataTree.removeSelected();"/>
    107             <menuitem id="menu_newItem" label="&vI_rdfDataTree.newItem.label;"
    108                 accesskey="&vI_rdfDataTree.newItem.accesskey;"
    109                 oncommand="vI_rdfDataTree.newItem();"/>
    110             <menuseparator />
    111             <menuitem id="menu_menu_selectAll" label="&selectAllCmd.label;" accesskey="&selectAllCmd.accesskey;"
    112                 oncommand="vI_rdfDataTree.selectAll();"/>
     98        <menu id="editMenu" label="&vI_rdfDataTree.editMenu.label;"
     99            accesskey="&vI_rdfDataTree.editMenu.accesskey;">
     100        <menupopup onpopupshowing="if (event.target == this) vI_rdfDataTree.updateMenu();">
     101            <menuitem id="menu_modifySelected" label="&vI_rdfDataTree.modifySelected.label;"
     102                accesskey="&vI_rdfDataTree.modifySelected.accesskey;"
     103                oncommand="vI_rdfDataTree.modifySelected();"/>
     104            <menuitem id="menu_removeSelected" label="&vI_rdfDataTree.removeSelected.label;"
     105                accesskey="&vI_rdfDataTree.removeSelected.accesskey;"
     106                oncommand="vI_rdfDataTree.removeSelected();"/>
     107            <menuitem id="menu_newItem" label="&vI_rdfDataTree.newItem.label;"
     108                accesskey="&vI_rdfDataTree.newItem.accesskey;"
     109                oncommand="vI_rdfDataTree.newItem();"/>
     110            <menuseparator />
     111            <menuitem id="menu_menu_selectAll" label="&selectAllCmd.label;" accesskey="&selectAllCmd.accesskey;"
     112                oncommand="vI_rdfDataTree.selectAll();"/>
     113        </menupopup>
     114        </menu>
     115        <menu id="tasksMenu" label="&tasksMenu.label;" accesskey="&tasksMenu.accesskey;">
     116        <menupopup>
     117            <menuitem label="&importCmd.label;" accesskey="&importCmd.accesskey;" oncommand="vI_rdfDatasource = new vI_rdfDatasource(); vI_rdfDatasource.import('virtualIdentity.rdf')"/>
     118            <menuitem label="&exportCmd.label;" accesskey="&exportCmd.accesskey;" oncommand="vI_rdfDatasource = new vI_rdfDatasource(); vI_rdfDatasource.export('virtualIdentity.rdf')"/>
    113119        </menupopup>
    114120        </menu>
  • chrome/content/v_identity/vI_rdfDatasource.js

    r2e8903 rc4e569  
    2323 * ***** END LICENSE BLOCK ***** */
    2424
    25 
    26 var vI_rdfDatasource = {           
    27     rdfService : Components.classes["@mozilla.org/rdf/rdf-service;1"]
    28             .getService(Components.interfaces.nsIRDFService),
    29    
    30     rdfDataSource : null,
    31     rdfFileName : "virtualIdentity.rdf",
    32     rdfNS : "http://virtual-id.absorb.it/",
    33     rdfNSStorage : "vIStorage",
    34     rdfNSEmail : "vIStorage/email",
    35     rdfNSMaillist : "vIStorage/maillist",
    36     rdfNSNewsgroup : "vIStorage/newsgroup",
    37     rdfNSFilter : "vIStorage/filter",
    38     rdfNSAccounts : "vIAccounts",
    39     rdfNSIdentities : "vIAccounts/id",
    40     rdfNSSMTPservers : "vIAccounts/smtp",
    41 
    42    
    43     // seamonkey doesn't have a extensionmanager, so read version of extension from hidden version-label
    44     // extensionManager : Components.classes["@mozilla.org/extensions/manager;1"]
    45     //      .getService(Components.interfaces.nsIExtensionManager),
    46    
    47     rdfVersion : "0.0.5",   // version of current implemented RDF-schema, internal only to trigger updates
    48    
    49     virtualIdentityID : "{dddd428e-5ac8-4a81-9f78-276c734f75b8}",
    50    
    51     unicodeConverter : Components.classes["@mozilla.org/intl/scriptableunicodeconverter"]
    52         .createInstance(Components.interfaces.nsIScriptableUnicodeConverter),
    53    
    54     emailContainer : Components.classes["@mozilla.org/rdf/container;1"]
     25function vI_rdfDatasource(rdfFileName, dontRegisterObserver) {
     26    this._rdfFileName = rdfFileName;
     27    if (this._rdfFileName) this.init();
     28    if (!dontRegisterObserver) this.AccountManagerObserver.register();
     29}
     30
     31vI_rdfDatasource.prototype = {         
     32    _rdfService :       Components.classes["@mozilla.org/rdf/rdf-service;1"]
     33                            .getService(Components.interfaces.nsIRDFService),
     34    _rdfDataSource :    null,
     35    _rdfFileName :      null,
     36    _rdfNS :            "http://virtual-id.absorb.it/",
     37    _rdfNSStorage :     "vIStorage",
     38    _rdfNSEmail :       "vIStorage/email",
     39    _rdfNSMaillist :    "vIStorage/maillist",
     40    _rdfNSNewsgroup :   "vIStorage/newsgroup",
     41    _rdfNSFilter :      "vIStorage/filter",
     42    _rdfNSAccounts :    "vIAccounts",
     43    _rdfNSIdentities :  "vIAccounts/id",
     44    _rdfNSSMTPservers : "vIAccounts/smtp",
     45
     46    _virtualIdentityID : "{dddd428e-5ac8-4a81-9f78-276c734f75b8}",
     47   
     48    _emailContainer : Components.classes["@mozilla.org/rdf/container;1"]
    5549            .createInstance(Components.interfaces.nsIRDFContainer),
    5650
    57     maillistContainer : Components.classes["@mozilla.org/rdf/container;1"]
     51    _maillistContainer : Components.classes["@mozilla.org/rdf/container;1"]
    5852            .createInstance(Components.interfaces.nsIRDFContainer),
    5953
    60     newsgroupContainer : Components.classes["@mozilla.org/rdf/container;1"]
     54    _newsgroupContainer : Components.classes["@mozilla.org/rdf/container;1"]
    6155            .createInstance(Components.interfaces.nsIRDFContainer),
    6256
    63     filterContainer : Components.classes["@mozilla.org/rdf/container;1"]
     57    _filterContainer : Components.classes["@mozilla.org/rdf/container;1"]
    6458            .createInstance(Components.interfaces.nsIRDFContainer),
    6559
    66     identityContainer : Components.classes["@mozilla.org/rdf/container;1"]
     60    _identityContainer : Components.classes["@mozilla.org/rdf/container;1"]
    6761            .createInstance(Components.interfaces.nsIRDFContainer),
    6862
    69     smtpContainer : Components.classes["@mozilla.org/rdf/container;1"]
     63    _smtpContainer : Components.classes["@mozilla.org/rdf/container;1"]
    7064            .createInstance(Components.interfaces.nsIRDFContainer),
    7165   
    7266    getContainer : function (type) {
    7367        switch (type) {
    74             case "email": return vI_rdfDatasource.emailContainer;
    75             case "maillist": return vI_rdfDatasource.maillistContainer;
    76             case "newsgroup": return vI_rdfDatasource.newsgroupContainer;
    77             case "filter": return vI_rdfDatasource.filterContainer;
    78             case "identity": return vI_rdfDatasource.identityContainer;
    79             case "smtp": return vI_rdfDatasource.smtpContainer;
     68            case "email": return this._emailContainer;
     69            case "maillist": return this._maillistContainer;
     70            case "newsgroup": return this._newsgroupContainer;
     71            case "filter": return this._filterContainer;
     72            case "identity": return this._identityContainer;
     73            case "smtp": return this._smtpContainer;
    8074        }
    8175        return null;
     
    8377
    8478    init: function() {
    85         if (vI_rdfDatasource.rdfDataSource) return;     
    86         var protoHandler = Components.classes["@mozilla.org/network/protocol;1?name=file"]
    87             .getService(Components.interfaces.nsIFileProtocolHandler)
    88         var newFile = Components.classes["@mozilla.org/file/local;1"]
    89                     .createInstance(Components.interfaces.nsILocalFile);
    90        
    91         var file = Components.classes["@mozilla.org/file/directory_service;1"]
    92             .getService(Components.interfaces.nsIProperties)
    93             .get("ProfD", Components.interfaces.nsIFile);
    94         var delimiter = (file.path.match(/\\/))?"\\":"/";
    95 
    96         newFile.initWithPath(file.path + delimiter + vI_rdfDatasource.rdfFileName);
    97         var fileURI = protoHandler.newFileURI(newFile);
    98 
    99         vI_notificationBar.dump("## vI_rdfDatasource read rdf from '" + fileURI.spec + "'\n");
    100 
    101         vI_rdfDatasource.rdfDataSource =
    102             vI_rdfDatasource.rdfService.GetDataSourceBlocking(fileURI.spec);
    103         vI_rdfDatasource.__initContainers();
    104         vI_rdfDatasource.refreshAccountInfo();
    105        
    106         vI_rdfDatasource.AccountManagerObserver.register();
    107     },
    108    
    109     __initContainers: function() {
     79        if (vI_notificationBar) vI_notificationBar.dump("## vI_rdfDatasource init.\n");
     80
     81        this._openRdfDataSource();
     82        if (!this._rdfDataSource) return;
     83        this._initContainers();
     84        if (this.rdfUpgradeRequired()) this.rdfUpgrade();
     85       
     86        // store version everytime to recognize downgrades later
     87        this.storeRDFVersion();
     88           
     89        this.refreshAccountInfo();
     90        if (vI_notificationBar) vI_notificationBar.dump("## vI_rdfDatasource init done.\n");
     91    },
     92   
     93    _openRdfDataSource: function() {
     94        if (!this._rdfFileName || this._rdfDataSource);
     95        var protoHandler = Components.classes["@mozilla.org/network/protocol;1?name=file"]
     96            .getService(Components.interfaces.nsIFileProtocolHandler)
     97        var newFile = Components.classes["@mozilla.org/file/local;1"]
     98                    .createInstance(Components.interfaces.nsILocalFile);
     99       
     100        var file = Components.classes["@mozilla.org/file/directory_service;1"]
     101            .getService(Components.interfaces.nsIProperties)
     102            .get("ProfD", Components.interfaces.nsIFile);
     103        var delimiter = (file.path.match(/\\/))?"\\":"/";
     104
     105        newFile.initWithPath(file.path + delimiter + this._rdfFileName);
     106        var fileURI = protoHandler.newFileURI(newFile);
     107
     108        if (vI_notificationBar) vI_notificationBar.dump("## vI_rdfDatasource read rdf from '" + fileURI.spec + "'\n");
     109
     110        this._rdfDataSource =
     111            this._rdfService.GetDataSourceBlocking(fileURI.spec);
     112           
     113        if (vI_notificationBar) vI_notificationBar.dump("## vI_rdfDatasource read rdf from '" + fileURI.spec + "' done." + this._rdfService + "\n");
     114    },
     115   
     116    _initContainers: function() {
    110117        try {   // will possibly fail before upgrade
    111             var storageRes = vI_rdfDatasource.rdfService
    112                 .GetResource(vI_rdfDatasource.rdfNS + vI_rdfDatasource.rdfNSEmail);
    113             vI_rdfDatasource.emailContainer.Init(vI_rdfDatasource.rdfDataSource, storageRes);
    114             storageRes = vI_rdfDatasource.rdfService
    115                 .GetResource(vI_rdfDatasource.rdfNS + vI_rdfDatasource.rdfNSMaillist);
    116             vI_rdfDatasource.maillistContainer.Init(vI_rdfDatasource.rdfDataSource, storageRes);
    117             storageRes = vI_rdfDatasource.rdfService
    118                 .GetResource(vI_rdfDatasource.rdfNS + vI_rdfDatasource.rdfNSNewsgroup);
    119             vI_rdfDatasource.newsgroupContainer.Init(vI_rdfDatasource.rdfDataSource, storageRes);
    120             storageRes = vI_rdfDatasource.rdfService
    121                 .GetResource(vI_rdfDatasource.rdfNS + vI_rdfDatasource.rdfNSFilter);
    122             vI_rdfDatasource.filterContainer.Init(vI_rdfDatasource.rdfDataSource, storageRes);
    123             storageRes = vI_rdfDatasource.rdfService
    124                 .GetResource(vI_rdfDatasource.rdfNS + vI_rdfDatasource.rdfNSIdentities);
    125             vI_rdfDatasource.identityContainer.Init(vI_rdfDatasource.rdfDataSource, storageRes);
    126             storageRes = vI_rdfDatasource.rdfService
    127                 .GetResource(vI_rdfDatasource.rdfNS + vI_rdfDatasource.rdfNSSMTPservers);
    128             vI_rdfDatasource.smtpContainer.Init(vI_rdfDatasource.rdfDataSource, storageRes);
     118            var storageRes = this._rdfService
     119                .GetResource(this._rdfNS + this._rdfNSEmail);
     120            this._emailContainer.Init(this._rdfDataSource, storageRes);
     121            storageRes = this._rdfService
     122                .GetResource(this._rdfNS + this._rdfNSMaillist);
     123            this._maillistContainer.Init(this._rdfDataSource, storageRes);
     124            storageRes = this._rdfService
     125                .GetResource(this._rdfNS + this._rdfNSNewsgroup);
     126            this._newsgroupContainer.Init(this._rdfDataSource, storageRes);
     127            storageRes = this._rdfService
     128                .GetResource(this._rdfNS + this._rdfNSFilter);
     129            this._filterContainer.Init(this._rdfDataSource, storageRes);
     130            storageRes = this._rdfService
     131                .GetResource(this._rdfNS + this._rdfNSIdentities);
     132            this._identityContainer.Init(this._rdfDataSource, storageRes);
     133            storageRes = this._rdfService
     134                .GetResource(this._rdfNS + this._rdfNSSMTPservers);
     135            this._smtpContainer.Init(this._rdfDataSource, storageRes);
    129136        } catch (e) { };
    130137    },
    131138
     139    // ******************************************************************************************
     140    // **************    BEGIN RDF UPGRADE CODE    **********************************************
    132141    rdfUpgradeRequired: function() {
    133         var oldRdfVersion = vI_rdfDatasource.getCurrentRDFFileVersion();
     142        var oldRdfVersion = this.getCurrentRDFFileVersion();
    134143        var versionChecker = Components.classes["@mozilla.org/xpcom/version-comparator;1"]
    135144            .getService(Components.interfaces.nsIVersionComparator);
    136         return (!oldRdfVersion || versionChecker.compare(oldRdfVersion, vI_rdfDatasource.rdfVersion) < 0)
    137     },
    138    
     145        return (!oldRdfVersion || versionChecker.compare(oldRdfVersion, this.rdfVersion) < 0)
     146    },
     147    // **************    RDF UPGRADE CODE    ****************************************************
    139148    extUpgradeRequired: function() {
    140         var oldExtVersion = vI_rdfDatasource.getCurrentExtFileVersion()
     149        var oldExtVersion = this.getCurrentExtFileVersion()
    141150        var versionChecker = Components.classes["@mozilla.org/xpcom/version-comparator;1"]
    142151            .getService(Components.interfaces.nsIVersionComparator);
    143152        // seamonkey doesn't have a extensionmanager, so read version of extension from hidden version-label
    144         // var extVersion = vI_rdfDatasource.extensionManager.getItemForID(vI_rdfDatasource.virtualIdentityID).version
     153        // var extVersion = this.extensionManager.getItemForID(this._virtualIdentityID).version
    145154        var extVersion = document.getElementById("extVersion").getAttribute("value");
    146155        return (!oldExtVersion || versionChecker.compare(oldExtVersion, extVersion) < 0)   
    147156    },
    148    
    149     getCurrentRDFFileVersion: function() {
    150         return vI_rdfDatasource.__getRDFValue(
    151             vI_rdfDatasource.rdfService.GetResource(vI_rdfDatasource.rdfNS + "virtualIdentity"), "rdfVersion");
    152     },
    153    
    154     getCurrentExtFileVersion: function() {
    155         return vI_rdfDatasource.__getRDFValue(
    156             vI_rdfDatasource.rdfService.GetResource(vI_rdfDatasource.rdfNS + "virtualIdentity"), "version");
    157     },
    158    
    159     storeRDFVersion: function() {
    160         vI_rdfDatasource.__setRDFValue(
    161             vI_rdfDatasource.rdfService.GetResource(vI_rdfDatasource.rdfNS + "virtualIdentity"), "rdfVersion",
    162             vI_rdfDatasource.rdfVersion);
    163         vI_rdfDatasource.flush();
    164     },
    165    
    166     storeExtVersion: function() {
    167         // seamonkey doesn't have a extensionmanager, so read version of extension from hidden version-label
    168         // var extVersion = vI_rdfDatasource.extensionManager.getItemForID(vI_rdfDatasource.virtualIdentityID).version
    169         var extVersion = document.getElementById("extVersion").getAttribute("value");
    170         vI_rdfDatasource.__setRDFValue(
    171             vI_rdfDatasource.rdfService.GetResource(vI_rdfDatasource.rdfNS + "virtualIdentity"), "version", extVersion)
    172         vI_rdfDatasource.flush();
    173     },
    174 
    175     clean : function() {
    176         vI_rdfDatasource.AccountManagerObserver.unregister();
    177         vI_rdfDatasource.flush();
    178     },
    179 
    180     flush : function() {
    181         vI_rdfDatasource.rdfDataSource.QueryInterface(Components.interfaces.nsIRDFRemoteDataSource);
    182         vI_rdfDatasource.rdfDataSource.Flush();
    183     },
    184    
    185     refreshAccountInfo : function() {
    186         try {   // will possibly fail before upgrade
    187             vI_rdfDatasource.cleanAccountInfo();
    188             vI_rdfDatasource.storeAccountInfo();
    189         } catch (e) {};
    190     },
    191    
    192     cleanAccountInfo : function() {
    193         vI_notificationBar.dump("## vI_rdfDatasource: cleanAccountInfo\n");
    194        
    195         var enumerator = vI_rdfDatasource.identityContainer.GetElements();
     157    // **************    RDF UPGRADE CODE    ****************************************************
     158    rdfUpgrade : function() {
     159        var currentVersion = this.getCurrentRDFFileVersion();
     160        if (vI_notificationBar) vI_notificationBar.dump("checking for previous version of rdf, found " +
     161            currentVersion + "\nrdf-upgrade required.\n")
     162        switch (currentVersion) {
     163            case null:
     164            case "0.0.1":
     165            case "0.0.2":
     166                this._createRDFContainers(); // no break
     167            case "0.0.3":
     168                this._tagDefaultSMTP();
     169            case "0.0.4":
     170            default:
     171                this._createAccountInfoContainersTP();
     172        }
     173        this.storeRDFVersion();
     174        if (vI_notificationBar) vI_notificationBar.dump("rdf-upgrade to " + this.getCurrentRDFFileVersion() + " done.\n\n");
     175    },
     176    // **************    RDF UPGRADE CODE    ****************************************************
     177    // only used for upgrade to 0.0.3 - loop through all ressources.
     178    _transferAllResources : function () {
     179        if (vI_notificationBar) vI_notificationBar.dump("upgrade: transferAllResources ");
     180        var enumerator = this.rdfDataSource.GetAllResources();
    196181        while (enumerator && enumerator.hasMoreElements()) {
    197182            var resource = enumerator.getNext();
    198183            resource.QueryInterface(Components.interfaces.nsIRDFResource);
    199             vI_rdfDatasource.__unsetRDFValue(resource, "identityName", vI_rdfDatasource.__getRDFValue(resource, "identityName"))
    200             vI_rdfDatasource.__unsetRDFValue(resource, "fullName", vI_rdfDatasource.__getRDFValue(resource, "fullName"))
    201             vI_rdfDatasource.__unsetRDFValue(resource, "email", vI_rdfDatasource.__getRDFValue(resource, "email"))
    202             vI_rdfDatasource.identityContainer.RemoveElement(resource, true);
    203         }
    204 
    205         enumerator = vI_rdfDatasource.smtpContainer.GetElements();
     184           
     185            var type; var name;
     186            if (resource.ValueUTF8.match(new RegExp(this.rdfNS + this.rdfNSEmail + "/", "i")))
     187                { type = "email"; name = RegExp.rightContext }
     188            else if (resource.ValueUTF8.match(new RegExp(this.rdfNS + this.rdfNSNewsgroup + "/", "i")))
     189                { type = "newsgroup"; name = RegExp.rightContext }
     190            else if (resource.ValueUTF8.match(new RegExp(this.rdfNS + this.rdfNSMaillist + "/", "i")))
     191                { type = "maillist"; name = RegExp.rightContext }
     192            else continue;
     193           
     194            var container = this.getContainer(type);
     195            this._setRDFValue(resource, "name", name);
     196           
     197            if (container.IndexOf(resource) == -1) container.AppendElement(resource);
     198       
     199            if (vI_notificationBar) vI_notificationBar.dump(".");
     200        }
     201        if (vI_notificationBar) vI_notificationBar.dump("\n");
     202    },
     203    // **************    RDF UPGRADE CODE    ****************************************************
     204    _tagDefaultSMTP: function() {
     205        if (vI_notificationBar) vI_notificationBar.dump("upgrade: tagDefaultSMTP ");
     206        for each (treeType in Array("email", "maillist", "newsgroup", "filter")) {
     207            var enumerator = this.getContainer(treeType).GetElements();
     208            while (enumerator && enumerator.hasMoreElements()) {
     209                var resource = enumerator.getNext();
     210                resource.QueryInterface(Components.interfaces.nsIRDFResource);
     211                var smtp = this._getRDFValue(resource, "smtp")
     212                if (!smtp || smtp == "") this._setRDFValue(resource, "smtp", DEFAULT_SMTP_TAG);
     213                if (vI_notificationBar) vI_notificationBar.dump(".");
     214            }
     215        }
     216        if (vI_notificationBar) vI_notificationBar.dump("\n");
     217    },
     218    // **************    RDF UPGRADE CODE    ****************************************************
     219    _createAccountInfoContainersTP: function() {
     220        if (vI_notificationBar) vI_notificationBar.dump("upgrade: createAccountInfoContainers \n");
     221        var rdfContainerUtils = Components.classes["@mozilla.org/rdf/container-utils;1"].
     222            getService(Components.interfaces.nsIRDFContainerUtils);
     223       
     224        var accountRes = this.rdfService
     225            .GetResource(this.rdfNS + this.rdfNSAccounts);
     226        var identityRes = this.rdfService
     227            .GetResource(this.rdfNS + this.rdfNSIdentities);
     228        var smtpRes = this.rdfService
     229            .GetResource(this.rdfNS + this.rdfNSSMTPservers);
     230        this._setRDFValue(accountRes, "name", "Accounts");
     231        this._setRDFValue(identityRes, "name", "Identities");
     232        this._setRDFValue(smtpRes, "name", "SMTP-Server");
     233       
     234        rdfContainerUtils.MakeBag(this.rdfDataSource, accountRes);
     235        rdfContainerUtils.MakeBag(this.rdfDataSource, identityRes);
     236        rdfContainerUtils.MakeBag(this.rdfDataSource, smtpRes);
     237
     238        var accountContainer = Components.classes["@mozilla.org/rdf/container;1"].
     239            createInstance(Components.interfaces.nsIRDFContainer);
     240       
     241        // initialize container with accountRes
     242        accountContainer.Init(this.rdfDataSource, accountRes);
     243        // append all new containers to accountRes
     244        if (accountContainer.IndexOf(identityRes) == -1) accountContainer.AppendElement(identityRes);
     245        if (accountContainer.IndexOf(smtpRes) == -1) accountContainer.AppendElement(smtpRes);
     246       
     247        this._initContainers();
     248        this.refreshAccountInfo();
     249    },
     250    // **************    RDF UPGRADE CODE    ****************************************************
     251    _createRDFContainers: function() {
     252        if (vI_notificationBar) vI_notificationBar.dump("upgrade: createRDFContainers ");
     253        var rdfContainerUtils = Components.classes["@mozilla.org/rdf/container-utils;1"].
     254            getService(Components.interfaces.nsIRDFContainerUtils);
     255
     256        var storageRes = this.rdfService
     257            .GetResource(this.rdfNS + this.rdfNSStorage);
     258        var emailRes = this.rdfService
     259            .GetResource(this.rdfNS + this.rdfNSEmail);
     260        var maillistRes = this.rdfService
     261            .GetResource(this.rdfNS + this.rdfNSMaillist);
     262        var newsgroupRes = this.rdfService
     263            .GetResource(this.rdfNS + this.rdfNSNewsgroup);
     264        var filterRes = this.rdfService
     265            .GetResource(this.rdfNS + this.rdfNSFilter);
     266        this._setRDFValue(emailRes, "name", "E-Mail");
     267        this._setRDFValue(maillistRes, "name", "Mailing-List");
     268        this._setRDFValue(newsgroupRes, "name", "Newsgroup");
     269        this._setRDFValue(filterRes, "name", "Filter");
     270
     271        rdfContainerUtils.MakeBag(this.rdfDataSource, storageRes);
     272        rdfContainerUtils.MakeBag(this.rdfDataSource, emailRes);
     273        rdfContainerUtils.MakeBag(this.rdfDataSource, maillistRes);
     274        rdfContainerUtils.MakeBag(this.rdfDataSource, newsgroupRes);
     275        // use a sequence for the filters, order does matter
     276        rdfContainerUtils.MakeSeq(this.rdfDataSource, filterRes);
     277       
     278        var container = Components.classes["@mozilla.org/rdf/container;1"].
     279            createInstance(Components.interfaces.nsIRDFContainer);
     280       
     281        // initialize container with storageRes
     282        container.Init(this.rdfDataSource, storageRes);
     283        // append all new containers to storageRes
     284        if (container.IndexOf(emailRes) == -1) container.AppendElement(emailRes);
     285        if (container.IndexOf(maillistRes) == -1) container.AppendElement(maillistRes);
     286        if (container.IndexOf(newsgroupRes) == -1) container.AppendElement(newsgroupRes);
     287        if (container.IndexOf(filterRes) == -1) container.AppendElement(filterRes);
     288       
     289        this._initContainers();
     290       
     291        this._transferAllResources();
     292    },
     293    // **************    END RDF UPGRADE CODE    ************************************************
     294    // ******************************************************************************************
     295       
     296    getCurrentRDFFileVersion: function() {
     297        return this._getRDFValue(
     298            this._rdfService.GetResource(this._rdfNS + "virtualIdentity"), "rdfVersion");
     299    },
     300   
     301    getCurrentExtFileVersion: function() {
     302        return this._getRDFValue(
     303            this._rdfService.GetResource(this._rdfNS + "virtualIdentity"), "version");
     304    },
     305   
     306    storeRDFVersion: function() {
     307        this._setRDFValue(
     308            this._rdfService.GetResource(this._rdfNS + "virtualIdentity"), "rdfVersion",
     309            this.rdfVersion);
     310        this._flush();
     311    },
     312   
     313    storeExtVersion: function() {
     314        // seamonkey doesn't have a extensionmanager, so read version of extension from hidden version-label
     315        // var extVersion = this.extensionManager.getItemForID(this._virtualIdentityID).version
     316        var extVersion = document.getElementById("extVersion").getAttribute("value");
     317        this._setRDFValue(
     318            this._rdfService.GetResource(this._rdfNS + "virtualIdentity"), "version", extVersion)
     319        this._flush();
     320    },
     321
     322    clean : function() {
     323        this.AccountManagerObserver.unregister();
     324        this._flush();
     325    },
     326
     327    _flush : function() {
     328        this._rdfDataSource.QueryInterface(Components.interfaces.nsIRDFRemoteDataSource);
     329        this._rdfDataSource.Flush();
     330    },
     331   
     332    refreshAccountInfo : function() {
     333        try {   // will possibly fail before upgrade
     334            this.cleanAccountInfo(); this.storeAccountInfo();
     335        } catch (e) {};
     336    },
     337   
     338    cleanAccountInfo : function() {
     339        if (vI_notificationBar) vI_notificationBar.dump("## vI_rdfDatasource: cleanAccountInfo\n");
     340       
     341        var enumerator = this._identityContainer.GetElements();
    206342        while (enumerator && enumerator.hasMoreElements()) {
    207343            var resource = enumerator.getNext();
    208344            resource.QueryInterface(Components.interfaces.nsIRDFResource);
    209             vI_rdfDatasource.__unsetRDFValue(resource, "label", vI_rdfDatasource.__getRDFValue(resource, "label"))
    210             vI_rdfDatasource.__unsetRDFValue(resource, "hostname", vI_rdfDatasource.__getRDFValue(resource, "hostname"))
    211             vI_rdfDatasource.__unsetRDFValue(resource, "username", vI_rdfDatasource.__getRDFValue(resource, "username"))
    212             vI_rdfDatasource.smtpContainer.RemoveElement(resource, true);
     345            this._unsetRDFValue(resource, "identityName", this._getRDFValue(resource, "identityName"))
     346            this._unsetRDFValue(resource, "fullName", this._getRDFValue(resource, "fullName"))
     347            this._unsetRDFValue(resource, "email", this._getRDFValue(resource, "email"))
     348            this._identityContainer.RemoveElement(resource, true);
     349        }
     350
     351        enumerator = this._smtpContainer.GetElements();
     352        while (enumerator && enumerator.hasMoreElements()) {
     353            var resource = enumerator.getNext();
     354            resource.QueryInterface(Components.interfaces.nsIRDFResource);
     355            this._unsetRDFValue(resource, "label", this._getRDFValue(resource, "label"))
     356            this._unsetRDFValue(resource, "hostname", this._getRDFValue(resource, "hostname"))
     357            this._unsetRDFValue(resource, "username", this._getRDFValue(resource, "username"))
     358            this._smtpContainer.RemoveElement(resource, true);
    213359        }   
    214360    },
    215361   
    216362    searchIdentityMismatch : function() {
    217         vI_notificationBar.dump("## vI_rdfDatasource: searchIdentityMismatch\n");
     363        if (vI_notificationBar) vI_notificationBar.dump("## vI_rdfDatasource: searchIdentityMismatch\n");
    218364
    219365        var relevantIDs = new Object();
     
    222368        // search relevant Identities
    223369        for each (treeType in Array("email", "maillist", "newsgroup", "filter")) {
    224             var enumerator = vI_rdfDatasource.getContainer(treeType).GetElements();
     370            var enumerator = this.getContainer(treeType).GetElements();
    225371            while (enumerator && enumerator.hasMoreElements()) {
    226372                var resource = enumerator.getNext();
    227373                resource.QueryInterface(Components.interfaces.nsIRDFResource);
    228                 var id = vI_rdfDatasource.__getRDFValue(resource, "id")
     374                var id = this._getRDFValue(resource, "id")
    229375                if (id) {
    230376                    if (!relevantIDs[id]) relevantIDs[id] = 1; else relevantIDs[id] += 1;
     
    237383        for (var id in relevantIDs) {
    238384            var identity = AccountManager.getIdentity(id)
    239             var resource = vI_rdfDatasource.rdfService.GetResource(vI_rdfDatasource.rdfNS + vI_rdfDatasource.rdfNSIdentities + "/" + id);
    240             var rdfIdentityName = vI_rdfDatasource.__getRDFValue(resource, "identityName");
    241             var rdfEmail = vI_rdfDatasource.__getRDFValue(resource, "email");
    242             var rdfFullName = vI_rdfDatasource.__getRDFValue(resource, "fullName")
     385            var resource = this._rdfService.GetResource(this._rdfNS + this._rdfNSIdentities + "/" + id);
     386            var rdfIdentityName = this._getRDFValue(resource, "identityName");
     387            var rdfEmail = this._getRDFValue(resource, "email");
     388            var rdfFullName = this._getRDFValue(resource, "fullName")
    243389            if ( !identity || rdfIdentityName != identity.identityName && rdfEmail != identity.email)
    244390                    mismatchIDs.push( { oldkey: id, label : rdfIdentityName, ext1: rdfEmail, ext2: rdfFullName, count: relevantIDs[id], key: "" } )
    245391        }
    246392        if (mismatchIDs.length > 0) {
    247             vI_notificationBar.dump("## vI_rdfDatasource: searchIdentityMismatch found mismatches on id(s).\n");
     393            if (vI_notificationBar) vI_notificationBar.dump("## vI_rdfDatasource: searchIdentityMismatch found mismatches on id(s).\n");
    248394           
    249395            window.openDialog("chrome://v_identity/content/vI_rdfAccountMismatchDialog.xul",0,
    250396                    "chrome, dialog, modal, alwaysRaised, resizable=yes", "identity", mismatchIDs,
    251                     /* callback: */ vI_rdfDatasource.repairAccountMismatch).focus();
     397                    /* callback: */ this.repairAccountMismatch).focus();
    252398            return true;
    253399        }
    254400        else {
    255             vI_notificationBar.dump("## vI_rdfDatasource: searchIdentityMismatch found no mismatch\n");
     401            if (vI_notificationBar) vI_notificationBar.dump("## vI_rdfDatasource: searchIdentityMismatch found no mismatch\n");
    256402            return false;
    257403        }
     
    259405   
    260406    repairAccountMismatch : function(type, mismatchItems) {
    261         vI_notificationBar.dump("## vI_rdfDatasource: repairAccountMismatch\n");
     407        if (vI_notificationBar) vI_notificationBar.dump("## vI_rdfDatasource: repairAccountMismatch\n");
    262408        var keyField = (type == "identity")?"id":"smtp" // field to change is 'id' or 'smtp' dependent on type
    263409        for (var i = 0; i < mismatchItems.length; i++) {
    264             vI_notificationBar.dump("## vI_rdfDatasource: repairAccountMismatch change " + mismatchItems[i].oldkey + " into " + mismatchItems[i].key + ": ");
     410            if (vI_notificationBar) vI_notificationBar.dump("## vI_rdfDatasource: repairAccountMismatch change " + mismatchItems[i].oldkey + " into " + mismatchItems[i].key + ": ");
    265411            // search relevant Identities
    266412            for each (treeType in Array("email", "maillist", "newsgroup", "filter")) {
    267                 var enumerator = vI_rdfDatasource.getContainer(treeType).GetElements();
     413                var enumerator = this.getContainer(treeType).GetElements();
    268414                while (enumerator && enumerator.hasMoreElements()) {
    269415                    var resource = enumerator.getNext();
    270416                    resource.QueryInterface(Components.interfaces.nsIRDFResource);
    271                     if (vI_rdfDatasource.__getRDFValue(resource, keyField) == mismatchItems[i].oldkey) {
    272                         if (mismatchItems[i].key == "") vI_rdfDatasource.__unsetRDFValue(resource, keyField, mismatchItems[i].oldkey)
    273                         else vI_rdfDatasource.__setRDFValue(resource, keyField, mismatchItems[i].key)
    274                         vI_notificationBar.dump(".");
     417                    if (this._getRDFValue(resource, keyField) == mismatchItems[i].oldkey) {
     418                        if (mismatchItems[i].key == "") this._unsetRDFValue(resource, keyField, mismatchItems[i].oldkey)
     419                        else this._setRDFValue(resource, keyField, mismatchItems[i].key)
     420                        if (vI_notificationBar) vI_notificationBar.dump(".");
    275421                    }
    276422                }
    277423            }
    278             vI_notificationBar.dump("\n");
     424            if (vI_notificationBar) vI_notificationBar.dump("\n");
    279425        }
    280426    },
    281427   
    282428    searchSmtpMismatch : function() {
    283         vI_notificationBar.dump("## vI_rdfDatasource: searchSmtpMismatch\n");
     429        if (vI_notificationBar) vI_notificationBar.dump("## vI_rdfDatasource: searchSmtpMismatch\n");
    284430
    285431        var relevantSMTPs = new Object();
     
    288434        // search relevant SMTPs
    289435        for each (treeType in Array("email", "maillist", "newsgroup", "filter")) {
    290             var enumerator = vI_rdfDatasource.getContainer(treeType).GetElements();
     436            var enumerator = this.getContainer(treeType).GetElements();
    291437            while (enumerator && enumerator.hasMoreElements()) {
    292438                var resource = enumerator.getNext();
    293439                resource.QueryInterface(Components.interfaces.nsIRDFResource);
    294                 var smtp = vI_rdfDatasource.__getRDFValue(resource, "smtp")
     440                var smtp = this._getRDFValue(resource, "smtp")
    295441                if (smtp && smtp != DEFAULT_SMTP_TAG) {
    296442                    if (!relevantSMTPs[smtp]) relevantSMTPs[smtp] = 1; else relevantSMTPs[smtp] += 1;
     
    303449        for (var smtp in relevantSMTPs) {
    304450            var server = SmtpService.getServerByKey(smtp)
    305             var resource = vI_rdfDatasource.rdfService.GetResource(vI_rdfDatasource.rdfNS + vI_rdfDatasource.rdfNSSMTPservers + "/" + smtp);
    306             var rdfSMTPlabel = vI_rdfDatasource.__getRDFValue(resource, "label");
    307             var rdfHostname = vI_rdfDatasource.__getRDFValue(resource, "hostname");
    308             var rdfUsername = vI_rdfDatasource.__getRDFValue(resource, "username")
     451            var resource = this._rdfService.GetResource(this._rdfNS + this._rdfNSSMTPservers + "/" + smtp);
     452            var rdfSMTPlabel = this._getRDFValue(resource, "label");
     453            var rdfHostname = this._getRDFValue(resource, "hostname");
     454            var rdfUsername = this._getRDFValue(resource, "username")
    309455            if (!server || rdfSMTPlabel != (server.description?server.description:server.hostname) && rdfHostname != server.hostname)
    310456                    mismatchSMTPs.push( { oldkey: smtp, label : rdfSMTPlabel, ext1: rdfHostname, ext2: rdfUsername, count: relevantSMTPs[smtp], key: "" } )
    311457        }
    312458        if (mismatchSMTPs.length > 0) {
    313             vI_notificationBar.dump("## vI_rdfDatasource: searchSmtpMismatch found mismatches on smtp(s).\n");
     459            if (vI_notificationBar) vI_notificationBar.dump("## vI_rdfDatasource: searchSmtpMismatch found mismatches on smtp(s).\n");
    314460            window.openDialog("chrome://v_identity/content/vI_rdfAccountMismatchDialog.xul",0,
    315461                    "chrome, dialog, modal, alwaysRaised, resizable=yes", "smtp", mismatchSMTPs,
    316                     /* callback: */ vI_rdfDatasource.repairAccountMismatch).focus();
     462                    /* callback: */ this.repairAccountMismatch).focus();
    317463            return true;
    318464        }
    319465        else {
    320             vI_notificationBar.dump("## vI_rdfDatasource: searchSmtpMismatch found no mismatch\n");
     466            if (vI_notificationBar) vI_notificationBar.dump("## vI_rdfDatasource: searchSmtpMismatch found no mismatch\n");
    321467            return false;
    322468        }
     
    324470
    325471    storeAccountInfo : function() {
    326         vI_notificationBar.dump("## vI_rdfDatasource: storeAccounts\n");
     472        if (vI_notificationBar) vI_notificationBar.dump("## vI_rdfDatasource: storeAccounts\n");
    327473
    328474        var AccountManager = Components.classes["@mozilla.org/messenger/account-manager;1"]
     
    332478            for (let j = 0; j < account.identities.Count(); j++) {
    333479                var identity = account.identities.QueryElementAt(j, Components.interfaces.nsIMsgIdentity);
    334 //                 vI_notificationBar.dump("## vI_rdfDatasource: storeAccounts identity store id " + identity.key + "\n");
    335 
    336                 var resource = vI_rdfDatasource.rdfService.GetResource(vI_rdfDatasource.rdfNS + vI_rdfDatasource.rdfNSIdentities + "/" + identity.key);
    337                 vI_rdfDatasource.__setRDFValue(resource, "identityName", identity.identityName);
    338                 vI_rdfDatasource.__setRDFValue(resource, "fullName", identity.fullName);
    339                 vI_rdfDatasource.__setRDFValue(resource, "email", identity.email);
     480//                 if (vI_notificationBar) vI_notificationBar.dump("## vI_rdfDatasource: storeAccounts identity store id " + identity.key + "\n");
     481
     482                var resource = this._rdfService.GetResource(this._rdfNS + this._rdfNSIdentities + "/" + identity.key);
     483                this._setRDFValue(resource, "identityName", identity.identityName);
     484                this._setRDFValue(resource, "fullName", identity.fullName);
     485                this._setRDFValue(resource, "email", identity.email);
    340486               
    341                 var position = vI_rdfDatasource.identityContainer.IndexOf(resource); // check for index in new recType
    342                 if (position != -1) vI_rdfDatasource.identityContainer.InsertElementAt(resource, position, false);
    343                 else vI_rdfDatasource.identityContainer.AppendElement(resource);
     487                var position = this._identityContainer.IndexOf(resource); // check for index in new recType
     488                if (position != -1) this._identityContainer.InsertElementAt(resource, position, false);
     489                else this._identityContainer.AppendElement(resource);
    344490            }
    345491        }
    346492       
    347         function storeSmtp(server) {
    348 //             vI_notificationBar.dump("## vI_rdfDatasource: storeAccounts smtp store id " + server.key + "\n");
    349             var resource = vI_rdfDatasource.rdfService.GetResource(vI_rdfDatasource.rdfNS + vI_rdfDatasource.rdfNSSMTPservers + "/" + server.key);
    350             vI_rdfDatasource.__setRDFValue(resource, "label", (server.description?server.description:server.hostname));
    351             vI_rdfDatasource.__setRDFValue(resource, "hostname", server.hostname);
    352             vI_rdfDatasource.__setRDFValue(resource, "username", server.username);
    353             var position = vI_rdfDatasource.smtpContainer.IndexOf(resource); // check for index in new recType
    354             if (position != -1) vI_rdfDatasource.smtpContainer.InsertElementAt(resource, position, false);
    355             else vI_rdfDatasource.smtpContainer.AppendElement(resource);
     493        function storeSmtp(server, parent) {
     494//             if (vI_notificationBar) vI_notificationBar.dump("## vI_rdfDatasource: storeAccounts smtp store id " + server.key + "\n");
     495            var resource = parent._rdfService.GetResource(this._rdfNS + this._rdfNSSMTPservers + "/" + server.key);
     496            parent._setRDFValue(resource, "label", (server.description?server.description:server.hostname));
     497            parent._setRDFValue(resource, "hostname", server.hostname);
     498            parent._setRDFValue(resource, "username", server.username);
     499            var position = parent._smtpContainer.IndexOf(resource); // check for index in new recType
     500            if (position != -1) parent._smtpContainer.InsertElementAt(resource, position, false);
     501            else parent._smtpContainer.AppendElement(resource);
    356502        }
    357503       
     
    361507            while (servers && servers.hasMoreElements()) {
    362508                var server = servers.getNext();
    363                 if (server instanceof Components.interfaces.nsISmtpServer && !server.redirectorType) storeSmtp(server);
     509                if (server instanceof Components.interfaces.nsISmtpServer && !server.redirectorType) storeSmtp(server, this);
    364510            }
    365511        else                            // TB 2.x
    366             for (var i=0 ; i<servers.Count(); i++) storeSmtp(servers.QueryElementAt(i, Components.interfaces.nsISmtpServer));
    367 
    368 //         vI_notificationBar.dump("## vI_rdfDatasource: storeAccounts done\n");
    369     },
    370 
    371     __getRDFResourceForVIdentity : function (recDescription, recType) {
    372         if (!vI_rdfDatasource.rdfDataSource) return null;
     512            for (var i=0 ; i<servers.Count(); i++) storeSmtp(servers.QueryElementAt(i, Components.interfaces.nsISmtpServer), this);
     513
     514//         if (vI_notificationBar) vI_notificationBar.dump("## vI_rdfDatasource: storeAccounts done\n");
     515    },
     516
     517    export : function(rdfFileName) {
     518        var filePicker = Components.classes["@mozilla.org/filepicker;1"]
     519            .createInstance(Components.interfaces.nsIFilePicker);
     520        filePicker.init(window, "", Components.interfaces.nsIFilePicker.modeSave);
     521        filePicker.appendFilters(Components.interfaces.nsIFilePicker.filterAll | Components.interfaces.nsIFilePicker.filterText );
     522        filePicker.appendFilter("RDF Files","*.rdf");
     523       
     524        if (filePicker.show() == Components.interfaces.nsIFilePicker.returnOK) {
     525            var rdfDataFile = Components.classes["@mozilla.org/file/local;1"]
     526                .createInstance(Components.interfaces.nsILocalFile);
     527            var file = Components.classes["@mozilla.org/file/directory_service;1"]
     528                .getService(Components.interfaces.nsIProperties).get("ProfD", Components.interfaces.nsIFile);
     529            var delimiter = (file.path.match(/\\/))?"\\":"/";
     530            rdfDataFile.initWithPath(file.path + delimiter + rdfFileName);
     531
     532            rdfDataFile.copyTo(filePicker.file.parent,filePicker.file.leafName);
     533        }
     534    },
     535   
     536    import : function(rdfFileName) {
     537        var filePicker = Components.classes["@mozilla.org/filepicker;1"]
     538            .createInstance(Components.interfaces.nsIFilePicker);
     539
     540        filePicker.init(window, "", Components.interfaces.nsIFilePicker.modeOpen);
     541        filePicker.appendFilter("RDF Files","*.rdf");
     542        filePicker.appendFilters(Components.interfaces.nsIFilePicker.filterText | Components.interfaces.nsIFilePicker.filterAll );
     543       
     544        if (filePicker.show() == Components.interfaces.nsIFilePicker.returnOK) {
     545            // init local Datasource
     546            this._rdfFileName = rdfFileName; this.init();
     547           
     548            var importRdfDataFile = Components.classes["@mozilla.org/file/local;1"]
     549                .createInstance(Components.interfaces.nsILocalFile);
     550            var file = Components.classes["@mozilla.org/file/directory_service;1"]
     551                .getService(Components.interfaces.nsIProperties).get("ProfD", Components.interfaces.nsIFile);
     552            var delimiter = (file.path.match(/\\/))?"\\":"/";
     553            rdfDataFile.initWithPath(file.path + delimiter + this._rdfFileName + "_import");
     554           
     555            filePicker.file.copyTo(importRdfDataFile.parent,importRdfDataFile.leafName);
     556            if (vI_notificationBar) vI_notificationBar.dump("## vI_rdfDatasource import: copied file from " + filePicker.path + " to " + importRdfDataFile.path + "'\n");
     557           
     558            import_rdfDatasource = new vI_rdfDatasource(importRdfDataFile.leafName);
     559            // --- do something with the file here ---
     560        } 
     561    },
     562
     563    _getRDFResourceForVIdentity : function (recDescription, recType) {
     564        if (!this._rdfDataSource) return null;
    373565        if (!recDescription) {
    374             vI_notificationBar.dump("## vI_rdfDatasource: __getRDFResourceForVIdentity: no Recipient given.\n");
     566            if (vI_notificationBar) vI_notificationBar.dump("## vI_rdfDatasource: _getRDFResourceForVIdentity: no Recipient given.\n");
    375567            return null;
    376568        }
    377         var rdfNSRecType = null
     569        var _rdfNSRecType = null
    378570        switch (recType) {
    379             case "email": rdfNSRecType = vI_rdfDatasource.rdfNSEmail; break;
    380             case "newsgroup" : rdfNSRecType = vI_rdfDatasource.rdfNSNewsgroup; break;
    381             case "maillist" : rdfNSRecType = vI_rdfDatasource.rdfNSMaillist; break;
    382             case "filter" : rdfNSRecType = vI_rdfDatasource.rdfNSFilter; break;
     571            case "email": _rdfNSRecType = this._rdfNSEmail; break;
     572            case "newsgroup" : _rdfNSRecType = this._rdfNSNewsgroup; break;
     573            case "maillist" : _rdfNSRecType = this._rdfNSMaillist; break;
     574            case "filter" : _rdfNSRecType = this._rdfNSFilter; break;
    383575        }
    384         return vI_rdfDatasource.rdfService.GetResource(vI_rdfDatasource.rdfNS + rdfNSRecType + "/" + recDescription);
     576        return this._rdfService.GetResource(this._rdfNS + _rdfNSRecType + "/" + recDescription);
    385577    },
    386578   
    387579    removeVIdentityFromRDF : function (resource, recType) {
    388         vI_notificationBar.dump("## vI_rdfDatasource: removeVIdentityFromRDF " + resource.ValueUTF8 + ".\n");
    389         vI_rdfDatasource.__unsetRDFValue(resource, "email", vI_rdfDatasource.__getRDFValue(resource, "email"))
    390         vI_rdfDatasource.__unsetRDFValue(resource, "fullName", vI_rdfDatasource.__getRDFValue(resource, "fullName"))
    391         vI_rdfDatasource.__unsetRDFValue(resource, "id", vI_rdfDatasource.__getRDFValue(resource, "id"))
    392         vI_rdfDatasource.__unsetRDFValue(resource, "smtp", vI_rdfDatasource.__getRDFValue(resource, "smtp"))
    393         vI_rdfDatasource.__unsetRDFValue(resource, "name", vI_rdfDatasource.__getRDFValue(resource, "name"))
    394        
    395         var extras = new vI_storageExtras(vI_rdfDatasource.__getRDFValue, resource);
    396         extras.loopForRDF(vI_rdfDatasource.__unsetRDFValue, resource);
    397         vI_rdfDatasource.getContainer(recType).RemoveElement(resource, true);
    398     },
    399    
    400     __unsetRDFValue : function (resource, field, value) {
    401         var predicate = vI_rdfDatasource.rdfService.GetResource(vI_rdfDatasource.rdfNS + "rdf#" + field);
    402         var name = vI_rdfDatasource.rdfService.GetLiteral(value?value:"");
    403         var target = vI_rdfDatasource.rdfDataSource.GetTarget(resource, predicate, true);
     580        if (vI_notificationBar) vI_notificationBar.dump("## vI_rdfDatasource: removeVIdentityFromRDF " + resource.ValueUTF8 + ".\n");
     581        this._unsetRDFValue(resource, "email", this._getRDFValue(resource, "email"))
     582        this._unsetRDFValue(resource, "fullName", this._getRDFValue(resource, "fullName"))
     583        this._unsetRDFValue(resource, "id", this._getRDFValue(resource, "id"))
     584        this._unsetRDFValue(resource, "smtp", this._getRDFValue(resource, "smtp"))
     585        this._unsetRDFValue(resource, "name", this._getRDFValue(resource, "name"))
     586       
     587        var extras = new vI_storageExtras(this, resource);
     588        extras.loopForRDF(this._unsetRDFValue, resource);
     589        this.getContainer(recType).RemoveElement(resource, true);
     590    },
     591   
     592    _unsetRDFValue : function (resource, field, value) {
     593//      if (vI_notificationBar) vI_notificationBar.dump("## vI_rdfDatasource _unsetRDFValue " + this._rdfService  + " " + this._rdfDataSource + "\n");
     594        var predicate = this._rdfService.GetResource(this._rdfNS + "rdf#" + field);
     595        var name = this._rdfService.GetLiteral(value?value:"");
     596        var target = this._rdfDataSource.GetTarget(resource, predicate, true);
    404597        if (target instanceof Components.interfaces.nsIRDFLiteral)
    405             vI_rdfDatasource.rdfDataSource.Unassert(resource, predicate, name, true);
     598            this._rdfDataSource.Unassert(resource, predicate, name, true);
    406599    },
    407600   
    408601    // this will be used from rdfDataTree to get all RDF values, callFunction is vI_rdfDataTree.__addNewDatum
    409602    readAllEntriesFromRDF : function (addNewDatum, treeType, idData) {
    410 //      vI_notificationBar.dump("## vI_rdfDatasource: readAllEntriesFromRDF.\n");
    411         var enumerator = vI_rdfDatasource.getContainer(treeType).GetElements();
     603//      if (vI_notificationBar) vI_notificationBar.dump("## vI_rdfDatasource: readAllEntriesFromRDF " + this._rdfService  + " " + this._rdfDataSource + " " + this + "\n");
     604        var enumerator = this.getContainer(treeType).GetElements();
    412605        while (enumerator && enumerator.hasMoreElements()) {
    413606            var resource = enumerator.getNext();
    414607            resource.QueryInterface(Components.interfaces.nsIRDFResource);
    415             var name = vI_rdfDatasource.__getRDFValue(resource, "name")
    416             var email = vI_rdfDatasource.__getRDFValue(resource, "email")
    417             var fullName = vI_rdfDatasource.__getRDFValue(resource, "fullName")
    418             var id = vI_rdfDatasource.__getRDFValue(resource, "id")
    419             var smtp = vI_rdfDatasource.__getRDFValue(resource, "smtp")
     608            var name = this._getRDFValue(resource, "name")
     609            var email = this._getRDFValue(resource, "email")
     610            var fullName = this._getRDFValue(resource, "fullName")
     611            var id = this._getRDFValue(resource, "id")
     612            var smtp = this._getRDFValue(resource, "smtp")
    420613            if (!smtp) smtp = NO_SMTP_TAG;
    421             var extras = new vI_storageExtras(vI_rdfDatasource.__getRDFValue, resource);
     614            var extras = new vI_storageExtras(this, resource);
    422615           
    423616            var localIdentityData = new vI_identityData(email, fullName, id, smtp, extras)
     
    427620   
    428621    findMatchingFilter : function (recDescription) {
    429         vI_notificationBar.dump("## vI_rdfDatasource: findMatchingFilter for " + recDescription + ".\n");
    430         var enumerator = vI_rdfDatasource.filterContainer.GetElements();
     622        if (vI_notificationBar) vI_notificationBar.dump("## vI_rdfDatasource: findMatchingFilter for " + recDescription + ".\n");
     623        var enumerator = this._filterContainer.GetElements();
    431624        while (enumerator && enumerator.hasMoreElements()) {
    432625            var resource = enumerator.getNext();
    433626            resource.QueryInterface(Components.interfaces.nsIRDFResource);
    434             var filter = vI_rdfDatasource.__getRDFValue(resource, "name");
     627            var filter = this._getRDFValue(resource, "name");
    435628           
    436629            const filterType = { None : 0, RegExp : 1, StrCmp : 2 }
     
    439632            if (filter == "") continue;
    440633            if (/^\/(.*)\/$/.exec(filter))
    441                 { vI_notificationBar.dump("## vI_rdfDatasource: findMatchingFilter with RegExp '"
     634                { if (vI_notificationBar) vI_notificationBar.dump("## vI_rdfDatasource: findMatchingFilter with RegExp '"
    442635                    + filter.replace(/\\/g,"\\\\") + "'\n"); recentfilterType = filterType.RegExp; }
    443             else    { vI_notificationBar.dump("## vI_rdfDatasource: findMatchingFilter, compare with '"
     636            else    { if (vI_notificationBar) vI_notificationBar.dump("## vI_rdfDatasource: findMatchingFilter, compare with '"
    444637                    + filter + "'\n"); recentfilterType = filterType.StrCmp; }
    445638           
     
    448641                    try {   /^\/(.*)\/$/.exec(filter);
    449642                        if (recDescription.match(new RegExp(RegExp.$1,"i"))) {
    450                             vI_notificationBar.dump("## vI_rdfDatasource: findMatchingFilter found stored data.\n");
    451                             return vI_rdfDatasource.__readVIdentityFromRDF(resource);
     643                            if (vI_notificationBar) vI_notificationBar.dump("## vI_rdfDatasource: findMatchingFilter found stored data.\n");
     644                            return this._readVIdentityFromRDF(resource);
    452645                        }
    453646                    }
     
    455648                case filterType.StrCmp:
    456649                    if (recDescription.toLowerCase().indexOf(filter.toLowerCase()) != -1) {
    457                         vI_notificationBar.dump("## vI_rdfDatasource: findMatchingFilter found stored data.\n");
    458                         return vI_rdfDatasource.__readVIdentityFromRDF(resource);
     650                        if (vI_notificationBar) vI_notificationBar.dump("## vI_rdfDatasource: findMatchingFilter found stored data.\n");
     651                        return this._readVIdentityFromRDF(resource);
    459652                    }
    460653                    break;
    461654            }
    462655        }
    463         vI_notificationBar.dump("## vI_rdfDatasource: findMatchingFilter no match found.\n");
     656        if (vI_notificationBar) vI_notificationBar.dump("## vI_rdfDatasource: findMatchingFilter no match found.\n");
    464657        return null;
    465658    },
    466659   
    467660    readVIdentityFromRDF : function (recDescription, recType) {
    468         var email = vI_rdfDatasource.rdfService.GetResource(vI_rdfDatasource.rdfNS + "rdf#email");
    469         var resource = vI_rdfDatasource.__getRDFResourceForVIdentity(recDescription, recType);
     661        var email = this._rdfService.GetResource(this._rdfNS + "rdf#email");
     662        var resource = this._getRDFResourceForVIdentity(recDescription, recType);
    470663        if (!resource) return null;
    471         if (!vI_rdfDatasource.rdfDataSource.hasArcOut(resource, email)) {
     664        if (!this._rdfDataSource.hasArcOut(resource, email)) {
    472665            // no data available --> give up.
    473             vI_notificationBar.dump("## vI_rdfDatasource: readVIdentityFromRDF no data found.\n");
     666            if (vI_notificationBar) vI_notificationBar.dump("## vI_rdfDatasource: readVIdentityFromRDF no data found.\n");
    474667            return null;
    475668        }
    476         vI_notificationBar.dump("## vI_rdfDatasource: readVIdentityFromRDF found stored data.\n");
    477        
    478         return vI_rdfDatasource.__readVIdentityFromRDF(resource);
    479     },
    480    
    481     __readVIdentityFromRDF : function (resource) {
    482         var email = vI_rdfDatasource.__getRDFValue(resource, "email")
    483         var fullName = vI_rdfDatasource.__getRDFValue(resource, "fullName")
    484         var id = vI_rdfDatasource.__getRDFValue(resource, "id")
    485         var smtp = vI_rdfDatasource.__getRDFValue(resource, "smtp")
     669        if (vI_notificationBar) vI_notificationBar.dump("## vI_rdfDatasource: readVIdentityFromRDF found stored data.\n");
     670       
     671        return this._readVIdentityFromRDF(resource);
     672    },
     673   
     674    _readVIdentityFromRDF : function (resource) {
     675        var email = this._getRDFValue(resource, "email")
     676        var fullName = this._getRDFValue(resource, "fullName")
     677        var id = this._getRDFValue(resource, "id")
     678        var smtp = this._getRDFValue(resource, "smtp")
    486679        if (!smtp) smtp = NO_SMTP_TAG;
    487680       
    488         vI_notificationBar.dump("## vI_rdfDatasource: email='" + email +
     681        if (vI_notificationBar) vI_notificationBar.dump("## vI_rdfDatasource: email='" + email +
    489682            "' fullName='" + fullName + "' id='" + id + "' smtp='" + smtp + "'\n");
    490683       
    491         var extras = new vI_storageExtras(vI_rdfDatasource.__getRDFValue, resource);
    492         vI_notificationBar.dump("## vI_rdfDatasource: extras:" + extras.status() + "\n");
     684        var extras = new vI_storageExtras(this, resource);
     685        if (vI_notificationBar) vI_notificationBar.dump("## vI_rdfDatasource: extras:" + extras.status() + "\n");
    493686       
    494687        var localIdentityData = new vI_identityData(email, fullName, id, smtp, extras)
     
    496689    },
    497690
    498     __getRDFValue : function (resource, field) {
    499         var predicate = vI_rdfDatasource.rdfService.GetResource(vI_rdfDatasource.rdfNS + "rdf#" + field);
    500         var target = vI_rdfDatasource.rdfDataSource.GetTarget(resource, predicate, true);
     691    _getRDFValue : function (resource, field) {
     692//         if (vI_notificationBar) vI_notificationBar.dump("## vI_rdfDatasource _getRDFValue " + this._rdfService  + " " + this._rdfDataSource + " " + this + "\n");
     693        var predicate = this._rdfService.GetResource(this._rdfNS + "rdf#" + field);
     694        var target = this._rdfDataSource.GetTarget(resource, predicate, true);
    501695        if (target instanceof Components.interfaces.nsIRDFLiteral) return target.Value
    502696        else return null;
     
    504698   
    505699    updateRDFFromVIdentity : function(recDescription, recType) {
    506         vI_rdfDatasource.updateRDF(recDescription, recType,
     700        this.updateRDF(recDescription, recType,
    507701            document.getElementById("msgIdentity_clone").identityData,
    508702            (vI_statusmenu.objSaveBaseIDMenuItem.getAttribute("checked") == "true"),
     
    512706   
    513707    removeRDF : function (recDescription, recType) {
    514         var resource = vI_rdfDatasource.__getRDFResourceForVIdentity(recDescription, recType);
     708        var resource = this._getRDFResourceForVIdentity(recDescription, recType);
    515709        if (!resource) return null;
    516         vI_rdfDatasource.removeVIdentityFromRDF(resource, recType);
     710        this.removeVIdentityFromRDF(resource, recType);
    517711        return resource;
    518712    },
     
    520714    updateRDF : function (recDescription, recType, localIdentityData, storeBaseID, storeSMTP, prevRecDescription, prevRecType) {
    521715//      if (!localIdentityData.email) {
    522 //          vI_notificationBar.dump("## vI_rdfDatasource: updateRDF: no Sender-email for Recipient, aborting.\n");
     716//          if (vI_notificationBar) vI_notificationBar.dump("## vI_rdfDatasource: updateRDF: no Sender-email for Recipient, aborting.\n");
    523717//          return;
    524718//      }
     
    528722        if (!prevRecType) prevRecType = recType;
    529723
    530         var resource = vI_rdfDatasource.__getRDFResourceForVIdentity(prevRecDescription, prevRecType);
     724        var resource = this._getRDFResourceForVIdentity(prevRecDescription, prevRecType);
    531725        if (!resource) return;
    532         vI_notificationBar.dump("## vI_rdfDatasource: updateRDF " + resource.ValueUTF8 + ".\n");
    533        
    534         var position = vI_rdfDatasource.getContainer(recType).IndexOf(resource); // check for index in new recType
    535         vI_rdfDatasource.removeVIdentityFromRDF(resource, prevRecType);
    536        
    537         resource = vI_rdfDatasource.__getRDFResourceForVIdentity(recDescription, recType);
    538 
    539         vI_rdfDatasource.__setRDFValue(resource, "email", localIdentityData.email);
    540         vI_rdfDatasource.__setRDFValue(resource, "fullName", localIdentityData.fullName);
     726        if (vI_notificationBar) vI_notificationBar.dump("## vI_rdfDatasource: updateRDF " + resource.ValueUTF8 + ".\n");
     727       
     728        var position = this.getContainer(recType).IndexOf(resource); // check for index in new recType
     729        this.removeVIdentityFromRDF(resource, prevRecType);
     730       
     731        resource = this._getRDFResourceForVIdentity(recDescription, recType);
     732
     733        this._setRDFValue(resource, "email", localIdentityData.email);
     734        this._setRDFValue(resource, "fullName", localIdentityData.fullName);
    541735        if (storeBaseID)
    542             vI_rdfDatasource.__setRDFValue(resource, "id", localIdentityData.id.key);
    543         else    vI_rdfDatasource.__unsetRDFValue(resource, "id", vI_rdfDatasource.__getRDFValue(resource, "id"))
     736            this._setRDFValue(resource, "id", localIdentityData.id.key);
     737        else    this._unsetRDFValue(resource, "id", this._getRDFValue(resource, "id"))
    544738        if (storeSMTP && localIdentityData.smtp.key != NO_SMTP_TAG)
    545             vI_rdfDatasource.__setRDFValue(resource, "smtp", localIdentityData.smtp.key);
    546         else    vI_rdfDatasource.__unsetRDFValue(resource, "smtp", vI_rdfDatasource.__getRDFValue(resource, "smtp"))
    547         vI_rdfDatasource.__setRDFValue(resource, "name", recDescription);
    548 
    549         localIdentityData.extras.loopForRDF(vI_rdfDatasource.__setRDFValue, resource);
    550        
    551         vI_notificationBar.dump("## vI_rdfDatasource: updateRDF " + resource.ValueUTF8  + " added.\n");
    552         if (position != -1) vI_rdfDatasource.getContainer(recType).InsertElementAt(resource, position, false);
    553         else vI_rdfDatasource.getContainer(recType).AppendElement(resource);
    554     },
    555 
    556     __setRDFValue : function (resource, field, value) {
    557 //      vI_notificationBar.dump("## vI_rdfDatasource: __setRDFValue " + resource.ValueUTF8 + " " + field + " " + value + ".\n");
     739            this._setRDFValue(resource, "smtp", localIdentityData.smtp.key);
     740        else    this._unsetRDFValue(resource, "smtp", this._getRDFValue(resource, "smtp"))
     741        this._setRDFValue(resource, "name", recDescription);
     742
     743        localIdentityData.extras.loopForRDF(this._setRDFValue, resource);
     744       
     745        if (vI_notificationBar) vI_notificationBar.dump("## vI_rdfDatasource: updateRDF " + resource.ValueUTF8  + " added.\n");
     746        if (position != -1) this.getContainer(recType).InsertElementAt(resource, position, false);
     747        else this.getContainer(recType).AppendElement(resource);
     748    },
     749
     750    _setRDFValue : function (resource, field, value) {
     751//      if (vI_notificationBar) vI_notificationBar.dump("## vI_rdfDatasource: _setRDFValue " + resource.ValueUTF8 + " " + field + " " + value + ".\n");
    558752        if (!value) return; // return if some value was not set.
    559         var predicate = vI_rdfDatasource.rdfService.GetResource(vI_rdfDatasource.rdfNS + "rdf#" + field);
    560         var name = vI_rdfDatasource.rdfService.GetLiteral(value);
    561         var target = vI_rdfDatasource.rdfDataSource.GetTarget(resource, predicate, true);
     753//      if (vI_notificationBar) vI_notificationBar.dump("## vI_rdfDatasource _setRDFValue " + this._rdfService + " " + this._rdfDataSource + "\n");
     754        var predicate = this._rdfService.GetResource(this._rdfNS + "rdf#" + field);
     755        var name = this._rdfService.GetLiteral(value);
     756        var target = this._rdfDataSource.GetTarget(resource, predicate, true);
    562757       
    563758        if (target instanceof Components.interfaces.nsIRDFLiteral)
    564             vI_rdfDatasource.rdfDataSource.Change(resource, predicate, target, name);
    565         else    vI_rdfDatasource.rdfDataSource.Assert(resource, predicate, name, true);
     759            this._rdfDataSource.Change(resource, predicate, target, name);
     760        else    this._rdfDataSource.Assert(resource, predicate, name, true);
    566761    },
    567762   
     
    571766        observe : function(subject, topic, data) {
    572767            if (topic == "am-smtpChanges" || topic == "am-acceptChanges") {
    573                 vI_notificationBar.dump("## vI_rdfDatasource: account/smtp changes observed\n");
    574                 if (vI_rdfDatasource.searchIdentityMismatch()) {
    575                     vI_notificationBar.dump("## vI_rdfDatasource: identity mismatch detected\n");
    576                 }
    577                 if (vI_rdfDatasource.searchSmtpMismatch()) {
    578                     vI_notificationBar.dump("## vI_rdfDatasource: smtp mismatch detected\n");
    579                 }
    580                 vI_rdfDatasource.refreshAccountInfo();
     768                if (vI_notificationBar) vI_notificationBar.dump("## vI_rdfDatasource: account/smtp changes observed\n");
     769                this.searchIdentityMismatch();
     770                this.searchSmtpMismatch();
     771                this.refreshAccountInfo();
    581772            }
    582773        },
    583774        register : function() {
     775            if (vI_notificationBar) vI_notificationBar.dump("## vI_rdfDatasource: register AccountManagerObserver\n");
    584776            var obsService = Components.classes["@mozilla.org/observer-service;1"].
    585777                getService(Components.interfaces.nsIObserverService)
     
    590782            var obsService = Components.classes["@mozilla.org/observer-service;1"].
    591783                getService(Components.interfaces.nsIObserverService)
    592             obsService.removeObserver(this, "am-smtpChanges");
    593             obsService.removeObserver(this, "am-acceptChanges");
     784            try {
     785                obsService.removeObserver(this, "am-smtpChanges");
     786                obsService.removeObserver(this, "am-acceptChanges");
     787            } catch(e) { };
    594788        }
    595789    }
    596790}
    597 window.addEventListener("load", vI_rdfDatasource.init, false);
    598 window.addEventListener("unload", vI_rdfDatasource.clean, false);
  • chrome/content/v_identity/vI_storage.js

    r2e8903 rc4e569  
    4242            .getBranch(null).QueryInterface(Components.interfaces.nsIPrefBranch2),
    4343   
     44    vI_rdfDatasource : null,    // local storage
     45
    4446    clean: function() {
    4547        vI_notificationBar.dump("## vI_storage: clean.\n");
     
    4850        vI_storage.firstUsedInputElement = null;
    4951        awSetInputAndPopupValue = vI_storage.original_functions.awSetInputAndPopupValue;
     52        if (vI_storage.vI_rdfDatasource) vI_storage.vI_rdfDatasource.clean();
    5053    },
    5154   
     
    8386    },
    8487   
    85     initialized : null,
     88    initialized : null,
    8689    init: function() {
    8790        if (!vI_storage.initialized) {
     91            vI_storage.vI_rdfDatasource = new vI_rdfDatasource("virtualIdentity.rdf");
     92
    8893            // better approach would be to use te onchange event, but this one is not fired in any change case
    8994            // see https://bugzilla.mozilla.org/show_bug.cgi?id=355367
     
    152157
    153158        var matchResults = { storageData : {}, menuItem : {} };
    154         matchResults.storageData[0] = vI_rdfDatasource.readVIdentityFromRDF(recipient.recDesc, recipient.recType);
    155         matchResults.storageData[1] = vI_rdfDatasource.findMatchingFilter(recipient.recDesc);
     159        matchResults.storageData[0] = vI_storage.vI_rdfDatasource.readVIdentityFromRDF(recipient.recDesc, recipient.recType);
     160        matchResults.storageData[1] = vI_storage.vI_rdfDatasource.findMatchingFilter(recipient.recDesc);
    156161
    157162        vI_notificationBar.dump("## vI_storage: updateVIdentityFromStorage add found Identities to CloneMenu.\n");
     
    287292        recipient = vI_storage.__getDescriptionAndType(recipient, recipientType);
    288293
    289         var storageDataByType = vI_rdfDatasource.readVIdentityFromRDF(recipient.recDesc, recipient.recType);
    290         var storageDataByFilter = vI_rdfDatasource.findMatchingFilter(recipient.recDesc);
     294        var storageDataByType = vI_storage.vI_rdfDatasource.readVIdentityFromRDF(recipient.recDesc, recipient.recType);
     295        var storageDataByFilter = vI_storage.vI_rdfDatasource.findMatchingFilter(recipient.recDesc);
    291296       
    292297        // update (storing) of data by type is required if there is
     
    312317            }
    313318        }
    314         if (doUpdate == "accept") vI_rdfDatasource.updateRDFFromVIdentity(recipient.recDesc, recipient.recType);
     319        if (doUpdate == "accept") vI_storage.vI_rdfDatasource.updateRDFFromVIdentity(recipient.recDesc, recipient.recType);
    315320        return true;
    316321    },
     
    409414            vI_storage.lastCheckedEmail[row] = awGetInputElement(row).value;
    410415            var recipient = vI_storage.__getDescriptionAndType(awGetInputElement(row).value, recipientType);
    411             var storageData = vI_rdfDatasource.readVIdentityFromRDF(recipient.recDesc, recipient.recType);
     416            var storageData = vI_storage.vI_rdfDatasource.readVIdentityFromRDF(recipient.recDesc, recipient.recType);
    412417            if (storageData) allIdentities.addWithoutDuplicates(storageData);
    413             storageData = vI_rdfDatasource.findMatchingFilter(recipient.recDesc);
     418            storageData = vI_storage.vI_rdfDatasource.findMatchingFilter(recipient.recDesc);
    414419            if (storageData) allIdentities.addWithoutDuplicates(storageData);
    415420        }
  • chrome/content/v_identity/vI_storageExtras.js

    r2e8903 rc4e569  
    6060}
    6161
    62 function vI_storageExtras(callFunction, resource) {
     62function vI_storageExtras(rdfDatasource, resource) {
    6363// function vI_storageExtras_checkbox(field, option, composeDialogElementID, updateFunction, identityValue) {
    6464    this.extras = [
     
    9393        this.extras[4] = new vI_storageExtras_sMime_messageEncryption()
    9494
    95     if (callFunction) this.loopForRDF(callFunction, resource)
     95    if (rdfDatasource) this.loopForRDF(rdfDatasource, resource)
    9696}
    9797
    9898vI_storageExtras.prototype = {
    99     loopForRDF : function(callFunction, resource) {
    100         for( var i = 0; i < this.extras.length; i++ ) {
    101             // only if pref set and feature(element available) or for dataEditor
     99    loopForRDF : function(rdfDatasource, resource) {
     100        for( var i = 0; i < this.extras.length; i++ ) {
     101//          if (vI_notificationBar) vI_notificationBar.dump("## vI_rdfDatasource: loopForRDF " + rdfDatasource + "\n");
     102            // only if pref set and feature(element available) or for dataEditor
    102103            if (typeof(gMsgCompose) == "undefined" || !gMsgCompose || this.extras[i].active)
    103                 this.extras[i].value = callFunction(resource, this.extras[i].field, this.extras[i].value)
     104                this.extras[i].value = rdfDatasource._getRDFValue(resource, this.extras[i].field, this.extras[i].value)
    104105        }
    105106    },
  • chrome/content/v_identity/vI_upgrade.js

    r2e8903 rc4e569  
    3030    versionChecker : Components.classes["@mozilla.org/xpcom/version-comparator;1"]
    3131            .getService(Components.interfaces.nsIVersionComparator),
     32   
     33    vI_rdfDatasource : null,
    3234
    3335    init : function() {
     
    3638    },
    3739
    38     __initRequirements : function() {
     40    clean : function() {
     41        if (vI_upgrade.vI_rdfDatasource) vI_upgrade.vI_rdfDatasource.clean();
     42    },
     43
     44    __initRequirements : function() {
    3945        vI_notificationBar.dump("") // this initialises the debug-area
    40         vI_rdfDatasource.init(); // just to be sure that Datasource is initialised
     46        vI_upgrade.vI_rdfDatasource = new vI_rdfDatasource("virtualIdentity.rdf", true);
    4147    },
    4248   
     
    4450    // if so, perform the upgrade and return true
    4551    // by default the wizard is not shown if it is a one-version-forward upgrade
    46     quick_upgrade : function() {
     52    quick_upgrade : function(currentVersion) {
    4753        // seamonkey doesn't have a extensionmanager, so read version of extension from hidden version-label
    48         var currentVersion = vI_rdfDatasource.getCurrentExtFileVersion()
    4954        if (!currentVersion) return false;
    5055        currentVersion = currentVersion.split(/\./);
     
    7681   
    7782    __upgrade : function() {
    78         if (vI_rdfDatasource.extUpgradeRequired()) vI_upgrade.extUpgrade();
    79         if (vI_rdfDatasource.rdfUpgradeRequired()) vI_upgrade.rdfUpgrade();
     83        if (vI_upgrade.vI_rdfDatasource.extUpgradeRequired()) vI_upgrade.extUpgrade();
    8084       
    8185        vI_account.cleanupSystem();
     
    9599    },
    96100   
    97     rdfUpgrade : function() {
    98         var currentVersion = vI_rdfDatasource.getCurrentRDFFileVersion();
    99         vI_notificationBar.dump("checking for previous version of rdf, found " +
    100             currentVersion + "\nrdf-upgrade required.\n")
    101         switch (currentVersion) {
    102             case null:
    103             case "0.0.1":
    104             case "0.0.2":
    105                 vI_upgrade.__createRDFContainers(); // no break
    106             case "0.0.3":
    107                 vI_upgrade.__tagDefaultSMTP();
    108             case "0.0.4":
    109             default:
    110                 vI_upgrade.__createAccountInfoContainers();
    111         }
    112         vI_rdfDatasource.storeRDFVersion();
    113         vI_notificationBar.dump("rdf-upgrade to " + vI_rdfDatasource.getCurrentRDFFileVersion() + " done.\n\n");
    114     },
    115    
    116     // only used for upgrade to 0.0.3 - loop through all ressources.
    117     __transferAllResources : function () {
    118         vI_notificationBar.dump("upgrade: transferAllResources ");
    119         var enumerator = vI_rdfDatasource.rdfDataSource.GetAllResources();
    120         while (enumerator && enumerator.hasMoreElements()) {
    121             var resource = enumerator.getNext();
    122             resource.QueryInterface(Components.interfaces.nsIRDFResource);
    123            
    124             var type; var name;
    125             if (resource.ValueUTF8.match(new RegExp(vI_rdfDatasource.rdfNS + vI_rdfDatasource.rdfNSEmail + "/", "i")))
    126                 { type = "email"; name = RegExp.rightContext }
    127             else if (resource.ValueUTF8.match(new RegExp(vI_rdfDatasource.rdfNS + vI_rdfDatasource.rdfNSNewsgroup + "/", "i")))
    128                 { type = "newsgroup"; name = RegExp.rightContext }
    129             else if (resource.ValueUTF8.match(new RegExp(vI_rdfDatasource.rdfNS + vI_rdfDatasource.rdfNSMaillist + "/", "i")))
    130                 { type = "maillist"; name = RegExp.rightContext }
    131             else continue;
    132            
    133             var container = vI_rdfDatasource.getContainer(type);
    134             vI_rdfDatasource.__setRDFValue(resource, "name", name);
    135            
    136             if (container.IndexOf(resource) == -1) container.AppendElement(resource);
    137        
    138             vI_notificationBar.dump(".");
    139         }
    140         vI_notificationBar.dump("\n");
    141     },
    142 
    143     __tagDefaultSMTP: function() {
    144         vI_notificationBar.dump("upgrade: tagDefaultSMTP ");
    145         for each (treeType in Array("email", "maillist", "newsgroup", "filter")) {
    146             var enumerator = vI_rdfDatasource.getContainer(treeType).GetElements();
    147             while (enumerator && enumerator.hasMoreElements()) {
    148                 var resource = enumerator.getNext();
    149                 resource.QueryInterface(Components.interfaces.nsIRDFResource);
    150                 var smtp = vI_rdfDatasource.__getRDFValue(resource, "smtp")
    151                 if (!smtp || smtp == "") vI_rdfDatasource.__setRDFValue(resource, "smtp", DEFAULT_SMTP_TAG);
    152                 vI_notificationBar.dump(".");
    153             }
    154         }
    155         vI_notificationBar.dump("\n");
    156     },
    157 
    158     __createAccountInfoContainers: function() {
    159         vI_notificationBar.dump("upgrade: createAccountInfoContainers \n");
    160         var rdfContainerUtils = Components.classes["@mozilla.org/rdf/container-utils;1"].
    161             getService(Components.interfaces.nsIRDFContainerUtils);
    162        
    163         var accountRes = vI_rdfDatasource.rdfService
    164             .GetResource(vI_rdfDatasource.rdfNS + vI_rdfDatasource.rdfNSAccounts);
    165         var identityRes = vI_rdfDatasource.rdfService
    166             .GetResource(vI_rdfDatasource.rdfNS + vI_rdfDatasource.rdfNSIdentities);
    167         var smtpRes = vI_rdfDatasource.rdfService
    168             .GetResource(vI_rdfDatasource.rdfNS + vI_rdfDatasource.rdfNSSMTPservers);
    169         vI_rdfDatasource.__setRDFValue(accountRes, "name", "Accounts");
    170         vI_rdfDatasource.__setRDFValue(identityRes, "name", "Identities");
    171         vI_rdfDatasource.__setRDFValue(smtpRes, "name", "SMTP-Server");
    172        
    173         rdfContainerUtils.MakeBag(vI_rdfDatasource.rdfDataSource, accountRes);
    174         rdfContainerUtils.MakeBag(vI_rdfDatasource.rdfDataSource, identityRes);
    175         rdfContainerUtils.MakeBag(vI_rdfDatasource.rdfDataSource, smtpRes);
    176 
    177         var accountContainer = Components.classes["@mozilla.org/rdf/container;1"].
    178             createInstance(Components.interfaces.nsIRDFContainer);
    179        
    180         // initialize container with accountRes
    181         accountContainer.Init(vI_rdfDatasource.rdfDataSource, accountRes);
    182         // append all new containers to accountRes
    183         if (accountContainer.IndexOf(identityRes) == -1) accountContainer.AppendElement(identityRes);
    184         if (accountContainer.IndexOf(smtpRes) == -1) accountContainer.AppendElement(smtpRes);
    185        
    186         vI_rdfDatasource.__initContainers();
    187         vI_rdfDatasource.refreshAccountInfo();
    188     },
    189 
    190     __createRDFContainers: function() {
    191         vI_notificationBar.dump("upgrade: createRDFContainers ");
    192         var rdfContainerUtils = Components.classes["@mozilla.org/rdf/container-utils;1"].
    193             getService(Components.interfaces.nsIRDFContainerUtils);
    194 
    195         var storageRes = vI_rdfDatasource.rdfService
    196             .GetResource(vI_rdfDatasource.rdfNS + vI_rdfDatasource.rdfNSStorage);
    197         var emailRes = vI_rdfDatasource.rdfService
    198             .GetResource(vI_rdfDatasource.rdfNS + vI_rdfDatasource.rdfNSEmail);
    199         var maillistRes = vI_rdfDatasource.rdfService
    200             .GetResource(vI_rdfDatasource.rdfNS + vI_rdfDatasource.rdfNSMaillist);
    201         var newsgroupRes = vI_rdfDatasource.rdfService
    202             .GetResource(vI_rdfDatasource.rdfNS + vI_rdfDatasource.rdfNSNewsgroup);
    203         var filterRes = vI_rdfDatasource.rdfService
    204             .GetResource(vI_rdfDatasource.rdfNS + vI_rdfDatasource.rdfNSFilter);
    205         vI_rdfDatasource.__setRDFValue(emailRes, "name", "E-Mail");
    206         vI_rdfDatasource.__setRDFValue(maillistRes, "name", "Mailing-List");
    207         vI_rdfDatasource.__setRDFValue(newsgroupRes, "name", "Newsgroup");
    208         vI_rdfDatasource.__setRDFValue(filterRes, "name", "Filter");
    209 
    210         rdfContainerUtils.MakeBag(vI_rdfDatasource.rdfDataSource, storageRes);
    211         rdfContainerUtils.MakeBag(vI_rdfDatasource.rdfDataSource, emailRes);
    212         rdfContainerUtils.MakeBag(vI_rdfDatasource.rdfDataSource, maillistRes);
    213         rdfContainerUtils.MakeBag(vI_rdfDatasource.rdfDataSource, newsgroupRes);
    214         // use a sequence for the filters, order does matter
    215         rdfContainerUtils.MakeSeq(vI_rdfDatasource.rdfDataSource, filterRes);
    216        
    217         var container = Components.classes["@mozilla.org/rdf/container;1"].
    218             createInstance(Components.interfaces.nsIRDFContainer);
    219        
    220         // initialize container with storageRes
    221         container.Init(vI_rdfDatasource.rdfDataSource, storageRes);
    222         // append all new containers to storageRes
    223         if (container.IndexOf(emailRes) == -1) container.AppendElement(emailRes);
    224         if (container.IndexOf(maillistRes) == -1) container.AppendElement(maillistRes);
    225         if (container.IndexOf(newsgroupRes) == -1) container.AppendElement(newsgroupRes);
    226         if (container.IndexOf(filterRes) == -1) container.AppendElement(filterRes);
    227        
    228         vI_rdfDatasource.__initContainers();
    229        
    230         vI_upgrade.__transferAllResources();
    231     },
    232    
    233101    extUpgrade : function() {
    234         var currentVersion = vI_rdfDatasource.getCurrentExtFileVersion();
     102        var currentVersion = vI_upgrade.vI_rdfDatasource.getCurrentExtFileVersion();
    235103        vI_notificationBar.dump("checking for previous version, found " +
    236104            currentVersion + "\nextension-upgrade required.\n")
     
    243111                vI_upgrade.__removeExtraAddedHeaders(currentVersion);
    244112        }
    245         vI_rdfDatasource.storeExtVersion();
    246         vI_notificationBar.dump("extension-upgrade to " + vI_rdfDatasource.getCurrentExtFileVersion() + " done.\n\n");
     113        vI_upgrade.vI_rdfDatasource.storeExtVersion();
     114        vI_notificationBar.dump("extension-upgrade to " + vI_upgrade.vI_rdfDatasource.getCurrentExtFileVersion() + " done.\n\n");
    247115    },
    248116   
     
    342210        var localIdentityData = new vI_identityData(newFullEmail, null, id, smtp, null)
    343211       
    344         vI_rdfDatasource.updateRDF(localIdentityData.combinedName,
     212        vI_upgrade.vI_rdfDatasource.updateRDF(localIdentityData.combinedName,
    345213                        "email", localIdentityData, true, true, null, null)
    346214        if (Card.secondEmail.replace(/^\s+|\s+$/g,""))
    347             vI_rdfDatasource.updateRDF(localIdentityData.combinedName,
     215            vI_upgrade.vI_rdfDatasource.updateRDF(localIdentityData.combinedName,
    348216                    "email", localIdentityData, true, true, null, null)
    349217       
  • chrome/content/v_identity/vI_upgrade.xul

    r2e8903 rc4e569  
    3838<wizard id="upgradeWizard" xmlns="http://www.mozilla.org/keymaster/gatekeeper/there.is.only.xul"
    3939        title="&vident.upgrade.dlgTitle.label;"
    40     zlevel="6" onload="vI_upgrade.init(); vI_upgrade.prepare(document.getElementById('introPage'));" >
     40    zlevel="6" onload="vI_upgrade.init(); vI_upgrade.prepare(document.getElementById('introPage'));" onunload="vI_upgrade.clean();" >
    4141
    4242<script type="application/x-javascript" src="chrome://v_identity/content/vI_upgrade.js" />
  • chrome/content/v_identity/vI_upgradeOverlay.js

    r2e8903 rc4e569  
    2525var vI_upgradeOverlay = {
    2626    init: function() {
    27         vI_rdfDatasource.init() // just to be sure that Datasource is available
    28         if (vI_rdfDatasource.rdfUpgradeRequired() || vI_rdfDatasource.extUpgradeRequired()) {
    29             if (!vI_upgrade.quick_upgrade())
     27        var rdfDatasource = new vI_rdfDatasource("virtualIdentity.rdf", true);
     28        if (rdfDatasource.extUpgradeRequired()) {
     29            if (!vI_upgrade.quick_upgrade(rdfDatasource.getCurrentExtFileVersion()))
    3030                window.open("chrome://v_identity/content/vI_upgrade.xul",0,
    3131                    "chrome, dialog, modal, alwaysRaised, resizable=yes").focus();
     
    3333        else {
    3434            vI_account.cleanupSystem(); // always clean leftover accounts and directories
    35            
    36             // just to recognize downgrades later
    37             vI_rdfDatasource.storeRDFVersion();
    38             vI_rdfDatasource.storeExtVersion();
     35            rdfDatasource.storeExtVersion();
    3936        }
     37        rdfDatasource.clean();
     38       
    4039        // show error-Console if required
    4140        var prefroot = Components.classes["@mozilla.org/preferences-service;1"]
  • chrome/locale/en-US/v_identity/vI_prefDialog.dtd

    r2e8903 rc4e569  
    133133<!ENTITY vI_prefDialog.storage.tooltiptext "Used Identities might be stored related to the recipients of your email. If you write again to the same recipient, the same virtual or non-virtual Identity will be used">
    134134<!ENTITY vI_prefDialog.storage.openEditor "edit stored data">
     135<!ENTITY vI_prefDialog.storage.export "export stored data">
     136<!ENTITY vI_prefDialog.storage.import "import data">
    135137
    136138<!ENTITY vI_prefDialog.storageTab.reading.header "Identity Reading">
  • chrome/locale/en-US/v_identity/v_identity.dtd

    r2e8903 rc4e569  
    1111<!ENTITY vident.vI_Menu.label "Virtual Identity">
    1212<!ENTITY vident.vI_Menu.Settings.label "Settings">
    13 <!ENTITY vident.vI_Menu.DataEditor.label "Data-Storage Editor">
     13<!ENTITY vident.vI_Menu.DataStorage.label "Data-Storage">
     14<!ENTITY vident.vI_Menu.DataEditor.label "Editor">
    1415<!ENTITY vident.vI_Menu.storageSave.label "save Identity while sending">
    1516<!ENTITY vident.vI_Menu.saveBaseID.label "store underlying base Identity">
Note: See TracChangeset for help on using the changeset viewer.