Beispiel #1
0
 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);
 }
Beispiel #2
0
        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);
        }
Beispiel #3
0
        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 String buildQuery(Query query)
        {
            //normal search (sort by citations)
            // sort by citations not implemented
            String queryURL, queryURLStat1, queryURLStat2;
            queryURL = null;
            String queryPart1 = "http://scholar.google.co.in/scholar?as_q=&as_occt=any&";
            String searchString = null;
            searchString = query.getqueryString();

            searchString = searchString.Replace(" ", "+");

            if (query.resultType == ResultType.AUTHOR)
            {
                queryPart1 = queryPart1 + "as_sauthors=" + "\"" + searchString + "\"";
            }

            else if (query.resultType == ResultType.JOURNAL)
            {
                queryPart1 = queryPart1 + "as_publication=" + "\"" + searchString + "\"";
            }

            int patentChoice;
            String queryPart2 = "&hl=en&as_sdt=";
            if (!query.getincludePatents())
                patentChoice = 0;
            else
                patentChoice = 1;
            queryPart2 += patentChoice;
            queryPart2 += "%2C5&as_vis=1";

            //sort by citations
            if (query.sortOrder == SortOrder.CITATIONS && (query.issetyhi() && query.issetylo()))
            {
                queryURL = queryPart1 + queryPart2;
                queryURLStat1 = queryURL;
            }

            //sort by date
            else if (query.sortOrder == SortOrder.CITATIONS && !(query.issetyhi() && query.issetylo()))
            {
                int year = 2013;
                queryURL = queryPart1 + "&as_ylo=&as_yhi=" + queryPart2;
                year--;


            }

            //search for custom year range and sorted by citations
            else if ((query.issetyhi() && query.issetylo()) && query.sortOrder == SortOrder.CITATIONS)
            {

                queryURL = queryPart1 + "&as_ylo=" + query.getylo() + "&as_yhi=" + query.getyhi() + queryPart2;
                queryURLStat2 = queryURL;
            }

            //search for custome year range and sorted by date
            else if (query.sortOrder == SortOrder.DATE && (query.issetyhi() && query.issetylo()))
            {
                queryURL = queryPart1 + "&as_ylo=" + query.getylo() + "&as_yhi=" + query.getyhi() + queryPart2;
            }

            else if (query.sortOrder == SortOrder.DATE && !(query.issetyhi() && query.issetylo()))
            {
                queryURL = queryPart1 + "&as_ylo=&as_yhi=" + queryPart2;
            }

            //TODO : Need to get the correct URL.
            // #Srikar


            return queryURL;
        }
Beispiel #6
0
 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;
 }
Beispiel #7
0
        public String buildQuery(Query query)
        {
            //normal search (sort by citations)
            // sort by citations not implemented
            String queryURL, queryURLStat1, queryURLStat2;

            queryURL = null;
            String queryPart1   = "http://scholar.google.co.in/scholar?as_q=&as_occt=any&";
            String searchString = null;

            searchString = query.getqueryString();

            searchString = searchString.Replace(" ", "+");

            if (query.resultType == ResultType.AUTHOR)
            {
                queryPart1 = queryPart1 + "as_sauthors=" + "\"" + searchString + "\"";
            }

            else if (query.resultType == ResultType.JOURNAL)
            {
                queryPart1 = queryPart1 + "as_publication=" + "\"" + searchString + "\"";
            }

            int    patentChoice;
            String queryPart2 = "&hl=en&as_sdt=";

            if (!query.getincludePatents())
            {
                patentChoice = 0;
            }
            else
            {
                patentChoice = 1;
            }
            queryPart2 += patentChoice;
            queryPart2 += "%2C5&as_vis=1";

            //sort by citations
            if (query.sortOrder == SortOrder.CITATIONS && (query.issetyhi() && query.issetylo()))
            {
                queryURL      = queryPart1 + queryPart2;
                queryURLStat1 = queryURL;
            }

            //sort by date
            else if (query.sortOrder == SortOrder.CITATIONS && !(query.issetyhi() && query.issetylo()))
            {
                int year = 2013;
                queryURL = queryPart1 + "&as_ylo=&as_yhi=" + queryPart2;
                year--;
            }

            //search for custom year range and sorted by citations
            else if ((query.issetyhi() && query.issetylo()) && query.sortOrder == SortOrder.CITATIONS)
            {
                queryURL      = queryPart1 + "&as_ylo=" + query.getylo() + "&as_yhi=" + query.getyhi() + queryPart2;
                queryURLStat2 = queryURL;
            }

            //search for custome year range and sorted by date
            else if (query.sortOrder == SortOrder.DATE && (query.issetyhi() && query.issetylo()))
            {
                queryURL = queryPart1 + "&as_ylo=" + query.getylo() + "&as_yhi=" + query.getyhi() + queryPart2;
            }

            else if (query.sortOrder == SortOrder.DATE && !(query.issetyhi() && query.issetylo()))
            {
                queryURL = queryPart1 + "&as_ylo=&as_yhi=" + queryPart2;
            }

            //TODO : Need to get the correct URL.
            // #Srikar


            return(queryURL);
        }
        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();

        }