示例#1
0
        public string GetKeyword()
        {
            string searchfor = string.Empty;

            if (Request.QueryString["searchfor"] != null)
            {
                searchfor = Request.QueryString["searchfor"];
            }
            else if (Request.Form["txtSearchFor"] != null)
            {
                searchfor = Request.Form["txtSearchFor"];
            }
            else
            {
                Search.Utilities.DataIO data             = new Profiles.Search.Utilities.DataIO();
                XmlDocument             xmlsearchrequest = new XmlDocument();
                if (String.IsNullOrEmpty(Request.QueryString["searchrequest"]) == false)
                {
                    xmlsearchrequest.LoadXml(data.DecryptRequest(Request.QueryString["searchrequest"]));
                }
                else if (string.IsNullOrEmpty(base.MasterPage.SearchRequest) == false)
                {
                    xmlsearchrequest.LoadXml(data.DecryptRequest(base.MasterPage.SearchRequest));
                }

                if (xmlsearchrequest.ChildNodes.Count > 0)
                {
                    try
                    {
                        searchfor = xmlsearchrequest.SelectSingleNode("SearchOptions/MatchOptions/SearchString").InnerText;
                    }
                    catch (Exception)
                    {
                        // Do nothing, leave searchfor = null
                    }
                }
            }
            return(searchfor);
        }
        public string GetKeyword()
        {
            string searchfor = string.Empty;
            if (Request.QueryString["searchfor"] != null)
            {
                searchfor = Request.QueryString["searchfor"];
            }
            else if (Request.Form["txtSearchFor"] != null)
            {
                searchfor = Request.Form["txtSearchFor"];
            }
            else {
                Search.Utilities.DataIO data = new Profiles.Search.Utilities.DataIO();
                XmlDocument xmlsearchrequest = new XmlDocument();
                if (String.IsNullOrEmpty(Request.QueryString["searchrequest"]) == false)
                {
                    xmlsearchrequest.LoadXml(data.DecryptRequest(Request.QueryString["searchrequest"]));
                }
                else if (string.IsNullOrEmpty(base.MasterPage.SearchRequest) == false)
                {
                    xmlsearchrequest.LoadXml(data.DecryptRequest(base.MasterPage.SearchRequest));
                }

                if (xmlsearchrequest.ChildNodes.Count > 0)
                {
                    try
                    {
                        searchfor = xmlsearchrequest.SelectSingleNode("SearchOptions/MatchOptions/SearchString").InnerText;
                    }
                    catch (Exception)
                    {
                        // Do nothing, leave searchfor = null
                    }
                }
            }
            return searchfor;
        }
示例#3
0
        private void BuildLinks()
        {
            string tab           = string.Empty;
            string searchfor     = string.Empty;
            string searchrequest = string.Empty;

            tab = Request.QueryString["tab"];

            if (Request.QueryString["searchtype"] == "everything")
            {
                tab = "all";
            }

            litModifySearch.Text = "<a href=\"javascript:modify('" + Root.Domain + "','" + tab + "','" + base.MasterPage.SearchRequest + "');\">" + "Modify Search" + "</a>";

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

            if (searchfor.IsNullOrEmpty())
            {
                Utilities.DataIO data = new Profiles.Search.Utilities.DataIO();

                XmlDocument xmlsearchrequest = new XmlDocument();
                searchrequest = data.DecryptRequest(base.MasterPage.SearchRequest);
                xmlsearchrequest.LoadXml(searchrequest);

                if (xmlsearchrequest.SelectSingleNode("SearchOptions/MatchOptions/SearchString") != null)
                {
                    searchfor = xmlsearchrequest.SelectSingleNode("SearchOptions/MatchOptions/SearchString").InnerText;
                }
            }

            litSearchOtherInstitutions.Text = "<a href='" + Root.Domain + "/direct/default.aspx?keyword=" + searchfor + "&searchrequest=" + base.MasterPage.SearchRequest + "&searchtype=" + Request.QueryString["searchtype"] + "'>" + "Search Other Institutions" + "</a>";
        }
示例#4
0
        private void ModifySearch()
        {
            Search.Utilities.DataIO data = new Profiles.Search.Utilities.DataIO();
            string searchrequest         = string.Empty;

            XmlDocument request = new XmlDocument();

            if (base.MasterPage.SearchRequest != null && Request.QueryString["searchrequest"] == null)
            {
                searchrequest = base.MasterPage.SearchRequest;
            }
            else if (Request.QueryString["searchrequest"].IsNullOrEmpty() == false)
            {
                searchrequest = Request.QueryString["searchrequest"];
            }

            request.LoadXml(data.DecryptRequest(searchrequest));


            if (request.SelectSingleNode("SearchOptions/MatchOptions/SearchString") != null)
            {
                searchfor.Text = request.SelectSingleNode("SearchOptions/MatchOptions/SearchString").InnerText;
            }


            if (request.SelectSingleNode("SearchOptions/MatchOptions/SearchString/@ExactMatch") != null)
            {
                switch (request.SelectSingleNode("SearchOptions/MatchOptions/SearchString/@ExactMatch").Value.ToLower())
                {
                case "true":
                    chkExactPhrase.Checked = true;
                    break;

                case "false":
                    chkExactPhrase.Checked = false;
                    break;
                }
            }
        }
        private void ModifySearch()
        {
            Search.Utilities.DataIO data = new Profiles.Search.Utilities.DataIO();
            string searchrequest = string.Empty;

            XmlDocument request = new XmlDocument();

            if (base.MasterPage.SearchRequest != null && Request.QueryString["searchrequest"]==null)
            {
                searchrequest = base.MasterPage.SearchRequest;
            }
            else if (Request.QueryString["searchrequest"].IsNullOrEmpty() == false)
            {
                searchrequest = Request.QueryString["searchrequest"];
            }

            request.LoadXml(data.DecryptRequest(searchrequest));

            if (request.SelectSingleNode("SearchOptions/MatchOptions/SearchString") != null)
            {
                searchfor.Text = request.SelectSingleNode("SearchOptions/MatchOptions/SearchString").InnerText;
            }

            if (request.SelectSingleNode("SearchOptions/MatchOptions/SearchString/@ExactMatch") != null)
            {
                switch (request.SelectSingleNode("SearchOptions/MatchOptions/SearchString/@ExactMatch").Value.ToLower())
                {
                    case "true":
                        chkExactPhrase.Checked = true;
                        break;
                    case "false":
                        chkExactPhrase.Checked = false;
                        break;
                }
            }
        }
        private void DrawProfilesModule()
        {
            XsltArgumentList args = new XsltArgumentList();

            string searchfor     = string.Empty;
            string classgroupuri = string.Empty;
            string classuri      = string.Empty;
            string searchrequest = string.Empty;
            string exactphrase   = string.Empty;

            XmlDocument xmlsearchrequest;



            if (Request.QueryString["searchfor"] != null)
            {
                searchfor = Request.QueryString["searchfor"];
            }
            else
            {
                searchfor = Request.Form["txtSearchFor"];
            }



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

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

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

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


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


            if (Request.QueryString["searchrequest"] != null)
            {
                searchrequest = Request.QueryString["searchrequest"];

                if (searchfor == null)
                {
                    xmlsearchrequest = new XmlDocument();

                    xmlsearchrequest.LoadXml(data.DecryptRequest(searchrequest));

                    searchfor = xmlsearchrequest.SelectSingleNode("SearchOptions/MatchOptions/SearchString").InnerText;
                }
            }

            if (Request.QueryString["exactphrase"] != null)
            {
                exactphrase = Request.QueryString["exactphrase"];
            }
            else
            {
                exactphrase = "false";
            }

            //Grab the full results so I can get the counts, this comes from the cache cloud.
            this.SearchResults = data.Search(data.SearchRequest(searchfor, exactphrase, "", "", "0", "100"), false);



            Int64 total = 0;

            foreach (XmlNode x in this.SearchResults.SelectNodes("rdf:RDF/rdf:Description/vivo:overview/prns:matchesClassGroupsList/prns:matchesClassGroup", this.Namespaces))
            {
                total += Convert.ToInt64(x.SelectSingleNode("prns:numberOfConnections", this.Namespaces).InnerText);
            }

            args.AddParam("total", "", total);
            args.AddParam("searchfor", "", searchfor);
            args.AddParam("exactphrase", "", exactphrase);
            args.AddParam("root", "", Root.Domain);
            args.AddParam("classGrpURIpassedin", "", classgroupuri);
            args.AddParam("classURIpassedin", "", classuri);



            XslCompiledTransform xslt = new XslCompiledTransform();

            litEverythingPassiveResults.Text = XslHelper.TransformInMemory(Server.MapPath("~/Search/Modules/SearchEverythingFacets/SearchEverythingFacets.xslt"), args, this.SearchResults.OuterXml);
        }