public String buildQuery(Query query) { // sort by citations not implemented queryURL = String.Format("http://academic.research.microsoft.com/json.svc/search?AppId={0}&ResultObjects={1}&PublicationContent={2}", appId, "Publication", "AllInfo"); String searchString = null; searchString = query.getqueryString(); searchString = searchString.Replace(" ", "+"); if (query.resultType == ResultType.AUTHOR) { queryURL += "&AuthorQuery=" + searchString; } else if (query.resultType == ResultType.JOURNAL) { queryURL += "&JournalQuery=" + searchString; } //sort by citations if (query.sortOrder == SortOrder.CITATIONS) { queryURL += "&OrderBy=CitationCount"; } else if (query.sortOrder == SortOrder.DATE) { queryURL += "&OrderBy=Year"; } //search for custom year range and sorted by citations if (query.issetylo()) { queryURL += "&YearStart=" + query.getylo(); } if (query.issetyhi()) { queryURL += "&YearEnd=" + query.getyhi(); } String pageStart = ((query.getpageid() - 1) * 20 + 1).ToString(); queryURL += "&StartIdx=" + pageStart; String pageEnd = (query.getpageid() * 20).ToString(); queryURL += "&EndIdx=" + pageEnd; //search for custome year range and sorted by date //TODO : Need to get the correct URL. // #Srikar Console.WriteLine("::::::::" + queryURL); return(queryURL); }
public Boolean Equals(Query q) { if (!(queryString.Equals(q.getqueryString()))) { return(false); } if (!(ylo.Equals(q.getylo()))) { return(false); } if (!(yhi.Equals(q.getyhi()))) { return(false); } if (!(includePatents.Equals(q.getincludePatents()))) { return(false); } if (!(id.Equals(q.getpageid()))) { return(false); } if (!(sortOrder.Equals(q.sortOrder))) { return(false); } if (!(resultType.Equals(q.resultType))) { return(false); } return(true); }
public TabPage(MainWindow mw, Favourites f, Query q) { this.mw = mw; this.f = f; this.q = q; InitializeComponent(); this.Searcher = new System.ComponentModel.BackgroundWorker(); this.Searcher.WorkerReportsProgress = true; this.Searcher.WorkerSupportsCancellation = true; this.Searcher.DoWork += new System.ComponentModel.DoWorkEventHandler(this.Searcher_DoWork); this.Searcher.ProgressChanged += new System.ComponentModel.ProgressChangedEventHandler(this.Searcher_ProgressChanged); this.Searcher.RunWorkerCompleted += new System.ComponentModel.RunWorkerCompletedEventHandler(this.Searcher_RunWorkerCompleted); this.viewCitation = new System.ComponentModel.BackgroundWorker(); this.viewCitation.WorkerReportsProgress = true; this.viewCitation.WorkerSupportsCancellation = true; this.viewCitation.DoWork += new System.ComponentModel.DoWorkEventHandler(this.Citation_DoWork); this.viewCitation.ProgressChanged += new System.ComponentModel.ProgressChangedEventHandler(this.Citation_ProgressChanged); this.viewCitation.RunWorkerCompleted += new System.ComponentModel.RunWorkerCompletedEventHandler(this.Citation_RunWorkerCompleted); controllerList = new List <Controller>(); progressBar.Visibility = System.Windows.Visibility.Hidden; this.searchBox.Opacity = 1; this.UpdateStatusBar += updateStatusBar; // related to statusbar updateStatusBar("Ready To Search !!!"); this.searchBox.Text = q.getqueryString(); if (q.resultType == ResultType.AUTHOR) { this.radioAuthor.IsChecked = true; this.radioJournal.IsChecked = false; } else { this.radioJournal.IsChecked = true; this.radioAuthor.IsChecked = false; } if (q.sortOrder == SortOrder.CITATIONS) { this.radioCitations.IsChecked = true; this.radioDate.IsChecked = false; } else { this.radioDate.IsChecked = true; this.radioCitations.IsChecked = false; } int flag = 0; if (q.issetyhi()) { flag = 1; this.checkBoxCustomRange.IsChecked = true; this.checkBoxCustomRange.IsEnabled = true; this.yearEnd.IsEnabled = true; this.yearStart.IsEnabled = true; this.yearEnd.Text = q.getyhi() + ""; } if (q.issetylo()) { flag = 1; this.checkBoxCustomRange.IsChecked = true; this.checkBoxCustomRange.IsEnabled = true; this.yearEnd.IsEnabled = true; this.yearStart.IsEnabled = true; this.yearStart.Text = q.getylo() + ""; } if (flag == 0) { this.checkBoxCustomRange.IsChecked = false; } currentPageSelected = q.getpageid(); searchFav(); }
public String buildQuery(Query query) { // sort by citations not implemented queryURL = String.Format("http://academic.research.microsoft.com/json.svc/search?AppId={0}&ResultObjects={1}&PublicationContent={2}", appId,"Publication","AllInfo"); String searchString = null; searchString = query.getqueryString(); searchString = searchString.Replace(" ", "+"); if (query.resultType == ResultType.AUTHOR) { queryURL+="&AuthorQuery="+searchString; } else if (query.resultType == ResultType.JOURNAL) { queryURL += "&JournalQuery=" + searchString; } //sort by citations if (query.sortOrder == SortOrder.CITATIONS) { queryURL += "&OrderBy=CitationCount"; } else if(query.sortOrder==SortOrder.DATE) { queryURL += "&OrderBy=Year"; } //search for custom year range and sorted by citations if (query.issetylo()) { queryURL += "&YearStart=" + query.getylo(); } if (query.issetyhi()) { queryURL += "&YearEnd=" + query.getyhi(); } String pageStart = ((query.getpageid() -1)*20 + 1).ToString(); queryURL += "&StartIdx=" + pageStart; String pageEnd = (query.getpageid()*20).ToString(); queryURL += "&EndIdx=" + pageEnd; //search for custome year range and sorted by date //TODO : Need to get the correct URL. // #Srikar Console.WriteLine("::::::::"+queryURL); return queryURL; }
public Boolean Equals(Query q) { if (!(queryString.Equals(q.getqueryString()))) return false; if (!(ylo.Equals(q.getylo()))) return false; if (!(yhi.Equals(q.getyhi()))) return false; if (!(includePatents.Equals(q.getincludePatents()))) return false; if (!(id.Equals(q.getpageid()))) return false; if (!(sortOrder.Equals(q.sortOrder))) return false; if (!(resultType.Equals(q.resultType))) return false; return true; }
public TabPage(MainWindow mw, Favourites f, Query q) { this.mw = mw; this.f = f; this.q = q; InitializeComponent(); this.Searcher = new System.ComponentModel.BackgroundWorker(); this.Searcher.WorkerReportsProgress = true; this.Searcher.WorkerSupportsCancellation = true; this.Searcher.DoWork += new System.ComponentModel.DoWorkEventHandler(this.Searcher_DoWork); this.Searcher.ProgressChanged += new System.ComponentModel.ProgressChangedEventHandler(this.Searcher_ProgressChanged); this.Searcher.RunWorkerCompleted += new System.ComponentModel.RunWorkerCompletedEventHandler(this.Searcher_RunWorkerCompleted); this.viewCitation = new System.ComponentModel.BackgroundWorker(); this.viewCitation.WorkerReportsProgress = true; this.viewCitation.WorkerSupportsCancellation = true; this.viewCitation.DoWork += new System.ComponentModel.DoWorkEventHandler(this.Citation_DoWork); this.viewCitation.ProgressChanged += new System.ComponentModel.ProgressChangedEventHandler(this.Citation_ProgressChanged); this.viewCitation.RunWorkerCompleted += new System.ComponentModel.RunWorkerCompletedEventHandler(this.Citation_RunWorkerCompleted); controllerList = new List<Controller>(); progressBar.Visibility = System.Windows.Visibility.Hidden; this.searchBox.Opacity = 1; this.UpdateStatusBar += updateStatusBar; // related to statusbar updateStatusBar("Ready To Search !!!"); this.searchBox.Text = q.getqueryString(); if (q.resultType == ResultType.AUTHOR) { this.radioAuthor.IsChecked = true; this.radioJournal.IsChecked = false; } else { this.radioJournal.IsChecked = true; this.radioAuthor.IsChecked = false; } if (q.sortOrder == SortOrder.CITATIONS) { this.radioCitations.IsChecked = true; this.radioDate.IsChecked = false; } else { this.radioDate.IsChecked = true; this.radioCitations.IsChecked = false; } int flag = 0; if (q.issetyhi()) { flag = 1; this.checkBoxCustomRange.IsChecked = true; this.checkBoxCustomRange.IsEnabled = true; this.yearEnd.IsEnabled = true; this.yearStart.IsEnabled = true; this.yearEnd.Text = q.getyhi() + ""; } if (q.issetylo()) { flag = 1; this.checkBoxCustomRange.IsChecked = true; this.checkBoxCustomRange.IsEnabled = true; this.yearEnd.IsEnabled = true; this.yearStart.IsEnabled = true; this.yearStart.Text = q.getylo() + ""; } if (flag == 0) this.checkBoxCustomRange.IsChecked = false; currentPageSelected = q.getpageid(); searchFav(); }