public override string getCallbackResponse() { try { searchRequest.SelectSingleNode("/SearchOptions/OutputOptions/Offset").InnerText = "0"; searchRequest.SelectSingleNode("/SearchOptions/OutputOptions/Limit").InnerText = "500"; XmlDocument searchData = new Profiles.Search.Utilities.DataIO().Search(searchRequest, false, false); DebugLogging.Log("SeachCallbackResponse :" + searchRequest.ToString()); List <string> peopleURIs = new List <string>(); XmlNodeList people = searchData.GetElementsByTagName("rdf:object"); for (int i = 0; i < people.Count; i++) { peopleURIs.Add(people[i].Attributes["rdf:resource"].Value); } if (peopleURIs.Count > 0) { return(BuildJSONPersonIds(peopleURIs, "" + peopleURIs.Count + " people found")); } } catch (Exception e) { DebugLogging.Log(e.Message); } return(null); }
public override List <string> getPeople() { try { List <string> peopleURIs = new List <string>(); int offSet = 0; Boolean hasMorePeople = true; while (peopleURIs.Count < searchLimit && hasMorePeople) { searchRequest.SelectSingleNode("/SearchOptions/OutputOptions/Offset").InnerText = "" + offSet; searchRequest.SelectSingleNode("/SearchOptions/OutputOptions/Limit").InnerText = "" + searchLimit; XmlDocument searchData = new Profiles.Search.Utilities.DataIO().Search(searchRequest, false, false); DebugLogging.Log("SeachCallbackResponse :" + searchRequest.ToString()); XmlNodeList people = searchData.GetElementsByTagName("rdf:object"); for (int i = 0; i < people.Count; i++) { peopleURIs.Add(people[i].Attributes["rdf:resource"].Value); } // increase offset by amount found XmlNode node = searchData.SelectSingleNode("rdf:RDF/rdf:Description/prns:numberOfConnections", namespaceManager); offSet += people.Count; hasMorePeople = Convert.ToInt32(node.InnerText) > peopleURIs.Count; } if (peopleURIs.Count > 0) { return(peopleURIs); } } catch (Exception e) { DebugLogging.Log(e.Message); } return(null); }
public override List<string> getPeople() { try { List<string> peopleURIs = new List<string>(); int offSet = 0; Boolean hasMorePeople = true; while (peopleURIs.Count < searchLimit && hasMorePeople) { searchRequest.SelectSingleNode("/SearchOptions/OutputOptions/Offset").InnerText = "" + offSet; searchRequest.SelectSingleNode("/SearchOptions/OutputOptions/Limit").InnerText = "" + searchLimit; XmlDocument searchData = new Profiles.Search.Utilities.DataIO().Search(searchRequest, false, false); DebugLogging.Log("SeachCallbackResponse :" + searchRequest.ToString()); XmlNodeList people = searchData.GetElementsByTagName("rdf:object"); for (int i = 0; i < people.Count; i++) { peopleURIs.Add(people[i].Attributes["rdf:resource"].Value); } // increase offset by amount found XmlNode node = searchData.SelectSingleNode("rdf:RDF/rdf:Description/prns:numberOfConnections", namespaceManager); offSet += people.Count; hasMorePeople = Convert.ToInt32(node.InnerText) > peopleURIs.Count; } if (peopleURIs.Count > 0) { return peopleURIs; } } catch (Exception e) { DebugLogging.Log(e.Message); } return null; }
public override string getCallbackResponse() { try { searchRequest.SelectSingleNode("/SearchOptions/OutputOptions/Offset").InnerText = "0"; searchRequest.SelectSingleNode("/SearchOptions/OutputOptions/Limit").InnerText = "500"; XmlDocument searchData = new Profiles.Search.Utilities.DataIO().Search(searchRequest, false, false); DebugLogging.Log("SeachCallbackResponse :" + searchRequest.ToString()); List<string> peopleURIs = new List<string>(); XmlNodeList people = searchData.GetElementsByTagName("rdf:object"); for (int i = 0; i < people.Count; i++) { peopleURIs.Add(people[i].Attributes["rdf:resource"].Value); } if (peopleURIs.Count > 0) { return BuildJSONPersonIds(peopleURIs, "" + peopleURIs.Count + " people found"); } } catch (Exception e) { DebugLogging.Log(e.Message); } return null; }