//Need to process this at the page level for the framework data
        //to process the presentation XML
        public void LoadRDFSearchResults()
        {
            XmlDocument xml           = new XmlDocument();
            Namespace   rdfnamespaces = new Namespace();

            Utilities.DataIO data = new Utilities.DataIO();

            string searchtype  = string.Empty;
            string lname       = string.Empty;
            string fname       = string.Empty;
            string institution = string.Empty;
            string department  = string.Empty;
            string division    = string.Empty;

            string searchfor            = string.Empty;
            string classgroupuri        = string.Empty;
            string classuri             = string.Empty;
            string perpage              = string.Empty;
            string offset               = string.Empty;
            string searchrequest        = string.Empty;
            string otherfilters         = string.Empty;
            string institutionallexcept = string.Empty;
            string departmentallexcept  = string.Empty;
            string divisionallexcept    = string.Empty;
            string exactphrase          = string.Empty;
            string nodeuri              = string.Empty;
            string nodeid               = string.Empty;


            string country = (Request.QueryString["country"].IsNullOrEmpty() ? "(All)" : Request.QueryString["country"]);

            department = country;

            if (Request.QueryString["new"] == "true")
            {
                Session["searchrequest"] = null;
                masterpage.SearchRequest = null;
            }

            if (this.SearchType.IsNullOrEmpty() == false)
            {
                searchtype = this.SearchType;
            }

            //else if (Request.Form["searchtype"] != null)
            //{
            //    searchtype = Request.Form["searchtype"];
            //}

            if (Request.QueryString["searchfor"].IsNullOrEmpty() == false)
            {
                searchfor = Request.QueryString["searchfor"];
            }

            if (Request.Form["txtSearchFor"].IsNullOrEmpty() == false)
            {
                searchfor = Request.Form["txtSearchFor"];
            }

            if (Request.QueryString["lname"].IsNullOrEmpty() == false)
            {
                lname = Request.QueryString["lname"];
            }

            if (Request.QueryString["institution"].IsNullOrEmpty() == false)
            {
                institution = Request.QueryString["institution"];
            }

            if (Request.QueryString["division"].IsNullOrEmpty() == false)
            {
                division = Request.QueryString["division"];
            }

            if (Request.QueryString["fname"].IsNullOrEmpty() == false)
            {
                fname = Request.QueryString["fname"];
            }

            if (Request.QueryString["classgroupuri"].IsNullOrEmpty() == false)
            {
                classgroupuri = HttpUtility.UrlDecode(Request.QueryString["classgroupuri"]);
            }
            else
            {
                classgroupuri = HttpUtility.UrlDecode(Request.Form["classgroupuri"]);
            }

            if (classgroupuri != null)
            {
                if (classgroupuri.Contains("!"))
                {
                    classgroupuri = classgroupuri.Replace('!', '#');
                }
            }

            if (Request.QueryString["classuri"].IsNullOrEmpty() == false)
            {
                classuri = HttpUtility.UrlDecode(Request.QueryString["classuri"]);
            }
            else
            {
                classuri = HttpUtility.UrlDecode(Request.Form["classuri"]);
            }

            if (classuri != null)
            {
                if (classuri.Contains("!"))
                {
                    classuri = classuri.Replace('!', '#');
                }
            }
            else
            {
                classuri = "";
            }

            if (Request.QueryString["perpage"].IsNullOrEmpty() == false)
            {
                perpage = Request.QueryString["perpage"];
            }
            else
            {
                perpage = Request.Form["perpage"];
            }

            //if (perpage == string.Empty || perpage == null)
            //{
            //    perpage = Request.QueryString["perpage"];
            //}

            if (perpage.IsNullOrEmpty())
            {
                perpage = "15";
            }

            if (Request.QueryString["offset"].IsNullOrEmpty() == false)
            {
                offset = Request.QueryString["offset"];
            }
            else
            {
                offset = Request.Form["offset"];
            }

            if (offset.IsNullOrEmpty())
            {
                offset = "0";
            }



            if (Request.QueryString["otherfilters"].IsNullOrEmpty() == false)
            {
                otherfilters = Request.QueryString["otherfilters"];
            }

            if (Request.QueryString["institutionallexcept"].IsNullOrEmpty() == false)
            {
                institutionallexcept = Request.QueryString["institutionallexcept"];
            }

            if (Request.QueryString["departmentallexcept"].IsNullOrEmpty() == false)
            {
                departmentallexcept = Request.QueryString["departmentallexcept"];
            }

            if (Request.QueryString["divisionallexcept"].IsNullOrEmpty() == false)
            {
                divisionallexcept = Request.QueryString["divisionallexcept"];
            }

            if (Request.QueryString["exactphrase"].IsNullOrEmpty() == false)
            {
                exactphrase = Request.QueryString["exactphrase"];
            }

            if (Request.QueryString["nodeuri"].IsNullOrEmpty() == false)
            {
                nodeuri = Request.QueryString["nodeuri"];
                nodeid  = nodeuri.Substring(nodeuri.LastIndexOf("/") + 1);
            }



            string keywordOrPerson = "keyword";

            //added this test for search type so we could split the person keyword search into a split to remove the why col for person
            keywordOrPerson = data.SearchType(searchfor);



            if (keywordOrPerson == "person")
            {
                xml = data.CovidPersonSearchRequest(searchfor, offset, perpage, country);
            }
            else
            {
                xml = data.SearchRequest(searchfor, exactphrase, fname, lname, institution, institutionallexcept, department, departmentallexcept, division, divisionallexcept, "http://xmlns.com/foaf/0.1/Person", perpage, offset, otherfilters, "", true, ref searchrequest);
            }

            searchrequest            = xml.OuterXml;
            Session["SearchRequest"] = searchrequest;

            if (nodeuri != string.Empty && nodeid != string.Empty)
            {
                masterpage.RDFData = data.WhySearch(xml, nodeuri, Convert.ToInt64(nodeid));
            }
            else
            {
                masterpage.RDFData = data.Search(xml, false, false);
            }

            Framework.Utilities.DebugLogging.Log(masterpage.RDFData.OuterXml);
            masterpage.RDFNamespaces = rdfnamespaces.LoadNamespaces(masterpage.RDFData);
            masterpage.SearchRequest = searchrequest;
        }
        //Need to process this at the page level for the framework data
        //to process the presentation XML
        public void LoadRDFSearchResults()
        {
            XmlDocument xml = new XmlDocument();
            Namespace rdfnamespaces = new Namespace();
            Utilities.DataIO data = new Utilities.DataIO();

            string searchtype = string.Empty;
            string lname = string.Empty;
            string fname = string.Empty;
            string institution = string.Empty;
            string department = string.Empty;
            string division = string.Empty;

            string searchfor = string.Empty;
            string classgroupuri = string.Empty;
            string classuri = string.Empty;
            string perpage = string.Empty;
            string offset = string.Empty;
            string sortby = string.Empty;
            string sortdirection = string.Empty;
            string searchrequest = string.Empty;
            string otherfilters = string.Empty;
            string institutionallexcept = string.Empty;
            string departmentallexcept = string.Empty;
            string divisionallexcept = string.Empty;
            string exactphrase = string.Empty;
            string nodeuri = string.Empty;
            string nodeid = string.Empty;

            if (this.SearchType.IsNullOrEmpty() == false)
                searchtype = this.SearchType;

            //else if (Request.Form["searchtype"] != null)
            //{
            //    searchtype = Request.Form["searchtype"];
            //}

            if (Request.QueryString["searchfor"].IsNullOrEmpty() == false)
                searchfor = Request.QueryString["searchfor"];

            if (Request.Form["txtSearchFor"].IsNullOrEmpty() == false)
                searchfor = Request.Form["txtSearchFor"];

            if (Request.QueryString["lname"].IsNullOrEmpty() == false)
                lname = Request.QueryString["lname"];

            if (Request.QueryString["institution"].IsNullOrEmpty() == false)
                institution = Request.QueryString["institution"];

            if (Request.QueryString["department"].IsNullOrEmpty() == false)
                department = Request.QueryString["department"];

            if (Request.QueryString["division"].IsNullOrEmpty() == false)
                division = Request.QueryString["division"];

            if (Request.QueryString["fname"].IsNullOrEmpty() == false)
                fname = Request.QueryString["fname"];

            if (Request.QueryString["classgroupuri"].IsNullOrEmpty() == false)
                classgroupuri = HttpUtility.UrlDecode(Request.QueryString["classgroupuri"]);
            else
                classgroupuri = HttpUtility.UrlDecode(Request.Form["classgroupuri"]);

            if (classgroupuri != null)
            {
                if (classgroupuri.Contains("!"))
                    classgroupuri = classgroupuri.Replace('!', '#');
            }

            if (Request.QueryString["classuri"].IsNullOrEmpty() == false)
                classuri = HttpUtility.UrlDecode(Request.QueryString["classuri"]);
            else
                classuri = HttpUtility.UrlDecode(Request.Form["classuri"]);

            if (classuri != null)
            {
                if (classuri.Contains("!"))
                    classuri = classuri.Replace('!', '#');
            }
            else
            {
                classuri = "";
            }

            if (Request.QueryString["perpage"].IsNullOrEmpty() == false)
                perpage = Request.QueryString["perpage"];
            else
                perpage = Request.Form["perpage"];

            //if (perpage == string.Empty || perpage == null)
            //{
            //    perpage = Request.QueryString["perpage"];
            //}

            if (perpage.IsNullOrEmpty())
                perpage = "15";

            if (Request.QueryString["offset"].IsNullOrEmpty() == false)
                offset = Request.QueryString["offset"];
            else
                offset = Request.Form["offset"];

            if (offset.IsNullOrEmpty())
                offset = "0";

            //if (offset == null)
            //    offset = "0";

            if (Request.QueryString["sortby"].IsNullOrEmpty() == false)
                sortby = Request.QueryString["sortby"];

            if (Request.QueryString["sortdirection"].IsNullOrEmpty() == false)
                sortdirection = Request.QueryString["sortdirection"];

            if (Request.QueryString["searchrequest"].IsNullOrEmpty() == false)
                searchrequest = Request.QueryString["searchrequest"];
            else if (masterpage.SearchRequest.IsNullOrEmpty() == false)
                searchrequest = masterpage.SearchRequest;

            if (Request.QueryString["otherfilters"].IsNullOrEmpty() == false)
                otherfilters = Request.QueryString["otherfilters"];

            if (Request.QueryString["institutionallexcept"].IsNullOrEmpty() == false)
                institutionallexcept = Request.QueryString["institutionallexcept"];

            if (Request.QueryString["departmentallexcept"].IsNullOrEmpty() == false)
                departmentallexcept = Request.QueryString["departmentallexcept"];

            if (Request.QueryString["divisionallexcept"].IsNullOrEmpty() == false)
                divisionallexcept = Request.QueryString["divisionallexcept"];

            if (Request.QueryString["exactphrase"].IsNullOrEmpty() == false)
                exactphrase = Request.QueryString["exactphrase"];

            if (Request.QueryString["nodeuri"].IsNullOrEmpty() == false)
            {
                nodeuri = Request.QueryString["nodeuri"];
                nodeid = nodeuri.Substring(nodeuri.LastIndexOf("/") + 1);
            }

            switch (searchtype.ToLower())
            {
                case "everything":

                    if (searchrequest != string.Empty)
                        xml.LoadXml(data.DecryptRequest(searchrequest));
                    else
                        xml = data.SearchRequest(searchfor, exactphrase, classgroupuri, classuri, perpage, offset);

                    break;
                default:                //Person is the default
                    if (searchrequest != string.Empty)
                        xml.LoadXml(data.DecryptRequest(searchrequest));
                    else
                        xml = data.SearchRequest(searchfor, exactphrase, fname, lname, institution, institutionallexcept, department, departmentallexcept, division, divisionallexcept, classuri, perpage, offset, sortby, sortdirection, otherfilters, "", ref searchrequest);
                    break;
            }

            if (nodeuri != string.Empty && nodeid != string.Empty)
                masterpage.RDFData = data.WhySearch(xml, nodeuri, Convert.ToInt64(nodeid));
            else
                masterpage.RDFData = data.Search(xml, false);

            Framework.Utilities.DebugLogging.Log(masterpage.RDFData.OuterXml);
            masterpage.RDFNamespaces = rdfnamespaces.LoadNamespaces(masterpage.RDFData);
            masterpage.SearchRequest = searchrequest;
        }
Example #3
0
        //Need to process this at the page level for the framework data
        //to process the presentation XML
        public void LoadRDFSearchResults()
        {
            XmlDocument xml           = new XmlDocument();
            Namespace   rdfnamespaces = new Namespace();

            Utilities.DataIO data = new Utilities.DataIO();

            string searchtype  = string.Empty;
            string lname       = string.Empty;
            string fname       = string.Empty;
            string institution = string.Empty;
            string department  = string.Empty;
            string division    = string.Empty;

            string searchfor            = string.Empty;
            string classgroupuri        = string.Empty;
            string classuri             = string.Empty;
            string perpage              = string.Empty;
            string offset               = string.Empty;
            string sortby               = string.Empty;
            string sortdirection        = string.Empty;
            string searchrequest        = string.Empty;
            string otherfilters         = string.Empty;
            string institutionallexcept = string.Empty;
            string departmentallexcept  = string.Empty;
            string divisionallexcept    = string.Empty;
            string exactphrase          = string.Empty;
            string nodeuri              = string.Empty;
            string nodeid               = string.Empty;


            if (this.SearchType.IsNullOrEmpty() == false)
            {
                searchtype = this.SearchType;
            }

            //else if (Request.Form["searchtype"] != null)
            //{
            //    searchtype = Request.Form["searchtype"];
            //}

            if (Request.QueryString["searchfor"].IsNullOrEmpty() == false)
            {
                searchfor = Request.QueryString["searchfor"];
            }

            if (Request.Form["txtSearchFor"].IsNullOrEmpty() == false)
            {
                searchfor = Request.Form["txtSearchFor"];
            }

            if (Request.QueryString["lname"].IsNullOrEmpty() == false)
            {
                lname = Request.QueryString["lname"];
            }

            if (Request.QueryString["institution"].IsNullOrEmpty() == false)
            {
                institution = Request.QueryString["institution"];
            }

            if (Request.QueryString["department"].IsNullOrEmpty() == false)
            {
                department = Request.QueryString["department"];
            }

            if (Request.QueryString["division"].IsNullOrEmpty() == false)
            {
                division = Request.QueryString["division"];
            }

            if (Request.QueryString["fname"].IsNullOrEmpty() == false)
            {
                fname = Request.QueryString["fname"];
            }

            if (Request.QueryString["classgroupuri"].IsNullOrEmpty() == false)
            {
                classgroupuri = HttpUtility.UrlDecode(Request.QueryString["classgroupuri"]);
            }
            else
            {
                classgroupuri = HttpUtility.UrlDecode(Request.Form["classgroupuri"]);
            }

            if (classgroupuri != null)
            {
                if (classgroupuri.Contains("!"))
                {
                    classgroupuri = classgroupuri.Replace('!', '#');
                }
            }

            if (Request.QueryString["classuri"].IsNullOrEmpty() == false)
            {
                classuri = HttpUtility.UrlDecode(Request.QueryString["classuri"]);
            }
            else
            {
                classuri = HttpUtility.UrlDecode(Request.Form["classuri"]);
            }

            if (classuri != null)
            {
                if (classuri.Contains("!"))
                {
                    classuri = classuri.Replace('!', '#');
                }
            }
            else
            {
                classuri = "";
            }

            if (Request.QueryString["perpage"].IsNullOrEmpty() == false)
            {
                perpage = Request.QueryString["perpage"];
            }
            else
            {
                perpage = Request.Form["perpage"];
            }

            //if (perpage == string.Empty || perpage == null)
            //{
            //    perpage = Request.QueryString["perpage"];
            //}

            if (perpage.IsNullOrEmpty())
            {
                perpage = "15";
            }

            if (Request.QueryString["offset"].IsNullOrEmpty() == false)
            {
                offset = Request.QueryString["offset"];
            }
            else
            {
                offset = Request.Form["offset"];
            }

            if (offset.IsNullOrEmpty())
            {
                offset = "0";
            }

            //if (offset == null)
            //    offset = "0";

            if (Request.QueryString["sortby"].IsNullOrEmpty() == false)
            {
                sortby = Request.QueryString["sortby"];
            }

            if (Request.QueryString["sortdirection"].IsNullOrEmpty() == false)
            {
                sortdirection = Request.QueryString["sortdirection"];
            }

            if (Request.QueryString["searchrequest"].IsNullOrEmpty() == false)
            {
                searchrequest = Request.QueryString["searchrequest"];
            }
            else if (masterpage.SearchRequest.IsNullOrEmpty() == false)
            {
                searchrequest = masterpage.SearchRequest;
            }

            if (Request.QueryString["otherfilters"].IsNullOrEmpty() == false)
            {
                otherfilters = Request.QueryString["otherfilters"];
            }

            if (Request.QueryString["institutionallexcept"].IsNullOrEmpty() == false)
            {
                institutionallexcept = Request.QueryString["institutionallexcept"];
            }

            if (Request.QueryString["departmentallexcept"].IsNullOrEmpty() == false)
            {
                departmentallexcept = Request.QueryString["departmentallexcept"];
            }

            if (Request.QueryString["divisionallexcept"].IsNullOrEmpty() == false)
            {
                divisionallexcept = Request.QueryString["divisionallexcept"];
            }

            if (Request.QueryString["exactphrase"].IsNullOrEmpty() == false)
            {
                exactphrase = Request.QueryString["exactphrase"];
            }

            if (Request.QueryString["nodeuri"].IsNullOrEmpty() == false)
            {
                nodeuri = Request.QueryString["nodeuri"];
                nodeid  = nodeuri.Substring(nodeuri.LastIndexOf("/") + 1);
            }

            switch (searchtype.ToLower())
            {
            case "everything":

                if (searchrequest != string.Empty)
                {
                    xml.LoadXml(data.DecryptRequest(searchrequest));
                }
                else
                {
                    xml = data.SearchRequest(searchfor, exactphrase, classgroupuri, classuri, perpage, offset);
                }

                break;

            default:                    //Person is the default
                if (searchrequest != string.Empty)
                {
                    xml.LoadXml(data.DecryptRequest(searchrequest));
                }
                else
                {
                    xml = data.SearchRequest(searchfor, exactphrase, fname, lname, institution, institutionallexcept, department, departmentallexcept, division, divisionallexcept, classuri, perpage, offset, sortby, sortdirection, otherfilters, "", ref searchrequest);
                }
                break;
            }


            if (nodeuri != string.Empty && nodeid != string.Empty)
            {
                masterpage.RDFData = data.WhySearch(xml, nodeuri, Convert.ToInt64(nodeid));
            }
            else
            {
                masterpage.RDFData = data.Search(xml, false);
            }

            Framework.Utilities.DebugLogging.Log(masterpage.RDFData.OuterXml);
            masterpage.RDFNamespaces = rdfnamespaces.LoadNamespaces(masterpage.RDFData);
            masterpage.SearchRequest = searchrequest;
        }