diff --git a/c_adlib/FFEngine.cs b/c_adlib/FFEngine.cs index c3124e24..c6a6694f 100644 --- a/c_adlib/FFEngine.cs +++ b/c_adlib/FFEngine.cs @@ -70,7 +70,8 @@ namespace Novell.CASA.DataEngines //Uninitialize the profile if initialized earlier //FIXME:- CURRENTLY NOT IVOKED SINCE THERES IS A BUG WHICH NEEDS TO BE FIXED IN FF NATIVE //Console.WriteLine("FFEngine Destructor:UnInitializing the Profile "+defaultProfileName); - FireFox.UninitProfile(defaultProfileName); + if(defaultProfileName!=null) + FireFox.UninitProfile(defaultProfileName); } public XmlNode Aggregate() @@ -82,8 +83,36 @@ namespace Novell.CASA.DataEngines doc.AppendChild(rootElem); //Initialize & Aggregate DefaultProfile from Firefox - readProfileToCCF(doc,rootElem,defaultProfileName); + if(defaultProfileName == null) + { + defaultProfileName=FireFox.GetDefaultProfileName(); + initProfileStatus=FireFox.InitProfile(defaultProfileName); + if(initProfileStatus!=1) + return rootElem; + } + + /*Console.WriteLine("FFEngine.cs : Printing Doc to Console-BEFORE\n"); + doc.Save(Console.Out); + int temp = readProfileToCCF(doc,rootElem,defaultProfileName); + Console.WriteLine("FFEngine.cs : Printing Doc to Console-AFTER\n"); + doc.Save(Console.Out);*/ + int temp = readProfileToCCF(doc,rootElem,defaultProfileName); + + if(temp!=1) + { + //Console.WriteLine("FFEngine : Host List is null even when secrets are present"); + FireFox.UninitProfile(defaultProfileName); + defaultProfileName = FireFox.GetDefaultProfileName(); + //Console.WriteLine("FFEngine : Default Profile Name : " + defaultProfileName); + if(defaultProfileName==null) + return rootElem; + initProfileStatus = FireFox.InitProfile(defaultProfileName); + if(initProfileStatus!=1) + return rootElem; + readProfileToCCF(doc,rootElem,defaultProfileName); + } + //Initialize & Aggregate any other profiles here if required.... //Console.WriteLine("FFEngine:Returning Aggregated Node for FireFox:"); @@ -179,10 +208,11 @@ namespace Novell.CASA.DataEngines Host hostList = null; //Console.WriteLine("FireFox:Getting Data for profile "+profileName); - hostList=FireFox.GetProfileData(profileName); - + hostList = FireFox.GetProfileData(profileName); + if(hostList!=null) {// Something to Aggregate + //Console.WriteLine("\nFFEngine.cs : HostList is not null"); XmlElement xmlProfileElement; String hostName; @@ -279,8 +309,10 @@ namespace Novell.CASA.DataEngines { try { - System.Runtime.InteropServices.Marshal.PrelinkAll(typeof(FireFox)); - return true; + if(FireFox.IsStoreAvailable() == 1) + return true; + else + return false; } catch(DllNotFoundException d) {