Example #1
0
        protected void ProcessUpload(object sender, AjaxControlToolkit.AsyncFileUploadEventArgs e)
        {
            System.IO.Stream      stream;
            Edit.Utilities.DataIO data = new Profiles.Edit.Utilities.DataIO();
            stream = AsyncFileUpload1.PostedFile.InputStream;


            byte[] imageBytes = new byte[AsyncFileUpload1.PostedFile.InputStream.Length + 1];
            AsyncFileUpload1.PostedFile.InputStream.Read(imageBytes, 0, imageBytes.Length);
            Framework.Utilities.Namespace xmlnamespace = new Profiles.Framework.Utilities.Namespace();
            XmlNamespaceManager           namespaces   = xmlnamespace.LoadNamespaces(BaseData);

            if (BaseData.SelectSingleNode("rdf:RDF/rdf:Description[1]/rdf:type[@rdf:resource='http://xmlns.com/foaf/0.1/Person']", namespaces) != null)
            {
                data.SaveImage(this.SubjectID, imageBytes, this.PropertyListXML);
            }
            if (BaseData.SelectSingleNode("rdf:RDF/rdf:Description[1]/rdf:type[@rdf:resource='http://xmlns.com/foaf/0.1/Group']", namespaces) != null)
            {
                data.SaveGroupImage(this.SubjectID, imageBytes, this.PropertyListXML);
            }

            base.GetSubjectProfile();
            this.PropertyListXML = propdata.GetPropertyList(this.BaseData, base.PresentationXML, this.PredicateURI, false, true, false);
            this.DrawProfilesModule();

            InitLinks();
            pnlUpload.Visible = false;
            upnlEditSection.Update();
        }
Example #2
0
        private void DrawProfilesModule()
        {
            Utilities.DataIO.ClassType    type         = Utilities.DataIO.ClassType.Unknown;
            Framework.Utilities.Namespace xmlnamespace = new Profiles.Framework.Utilities.Namespace();
            XmlNamespaceManager           namespaces   = xmlnamespace.LoadNamespaces(BaseData);

            if (BaseData.SelectSingleNode("rdf:RDF/rdf:Description[1]/rdf:type[@rdf:resource='http://xmlns.com/foaf/0.1/Person']", namespaces) != null)
            {
                type = Utilities.DataIO.ClassType.Person;
            }
            if (BaseData.SelectSingleNode("rdf:RDF/rdf:Description[1]/rdf:type[@rdf:resource='http://xmlns.com/foaf/0.1/Group']", namespaces) != null)
            {
                type = Utilities.DataIO.ClassType.Group;
            }

            DateTime d = DateTime.Now;

            Profiles.Profile.Modules.CustomViewAuthorInAuthorshipTimeline.DataIO data = new Profiles.Profile.Modules.CustomViewAuthorInAuthorshipTimeline.DataIO();

            // Get timeline bar chart
            string storedproc = "[Profile.Module].[NetworkAuthorshipTimeline.Person.GetCovidData]";

            if (type == Utilities.DataIO.ClassType.Group)
            {
                storedproc = "[Profile.Module].[NetworkAuthorshipTimeline.Group.GetData]";
            }
            Profiles.Profile.Modules.CustomViewAuthorInAuthorshipTimeline.DataIO.VisualizationImageLink vil;
            try
            {
                vil = data.GetGoogleTimeline(base.RDFTriple, storedproc);
                covidTimelineBar.Src  = vil.src;
                covidTimelineBar.Alt  = vil.alt;
                litTimelineTable.Text = vil.asText;
            }
            catch (Exception)
            {
                covidTimelineGraph.Visible = false;
            }

            storedproc = "[Profile.Module].[NetworkAuthorshipTimeline.Person.GetData]";
            if (type == Utilities.DataIO.ClassType.Group)
            {
                storedproc = "[Profile.Module].[NetworkAuthorshipTimeline.Group.GetData]";
            }
            vil = data.GetGoogleTimeline(base.RDFTriple, storedproc);

            timelineBar.Src       = vil.src;
            timelineBar.Alt       = vil.alt;
            litTimelineTable.Text = vil.asText;

            if (timelineBar.Src == "")
            {
                timelineBar.Visible = false;
            }

            Framework.Utilities.DebugLogging.Log("PUBLICATION MODULE end Milliseconds:" + (DateTime.Now - d).TotalSeconds);
        }
Example #3
0
        private void DrawProfilesModule()
        {
            DateTime d = DateTime.Now;

            Profiles.Profile.Modules.CustomViewAuthorInAuthorshipTimeline.DataIO data = new Profiles.Profile.Modules.CustomViewAuthorInAuthorshipTimeline.DataIO();
            List <Publication> publication = new List <Publication>();

            Utilities.DataIO.ClassType    type         = Utilities.DataIO.ClassType.Unknown;
            Framework.Utilities.Namespace xmlnamespace = new Profiles.Framework.Utilities.Namespace();
            XmlNamespaceManager           namespaces   = xmlnamespace.LoadNamespaces(BaseData);

            //if (BaseData.SelectSingleNode("rdf:RDF/rdf:Description[1]/rdf:type[@rdf:resource='http://xmlns.com/foaf/0.1/Person']", namespaces) != null)
            //    type = Utilities.DataIO.ClassType.Person;
            //if (BaseData.SelectSingleNode("rdf:RDF/rdf:Description[1]/rdf:type[@rdf:resource='http://xmlns.com/foaf/0.1/Group']", namespaces) != null)
            type = Utilities.DataIO.ClassType.Group;

            using (SqlDataReader reader = data.GetPublications(base.RDFTriple, type))
            {
                while (reader.Read())
                {
                    publication.Add(new Publication(reader["bibo_pmid"].ToString(), reader["vivo_pmcid"].ToString(),
                                                    reader["prns_informationResourceReference"].ToString(), reader["vivo_webpage"].ToString(), Convert.ToInt32(reader["PMCCitations"]),
                                                    reader["Fields"].ToString(), Convert.ToInt32(reader["TranslationHumans"]), Convert.ToInt32(reader["TranslationAnimals"]),
                                                    Convert.ToInt32(reader["TranslationCells"]), Convert.ToInt32(reader["TranslationPublicHealth"]), Convert.ToInt32(reader["TranslationClinicalTrial"])));
                }

                rpPublication.DataSource = publication;
                rpPublication.DataBind();
            }

            // Get timeline bar chart
            string storedproc = "[Profile.Module].[NetworkAuthorshipTimeline.Person.GetData]";

            if (type == Utilities.DataIO.ClassType.Group)
            {
                storedproc = "[Profile.Module].[NetworkAuthorshipTimeline.Group.GetData]";
            }

            Profiles.Profile.Modules.CustomViewAuthorInAuthorshipTimeline.DataIO.VisualizationImageLink vil = data.GetGoogleTimeline(new RDFTriple(Convert.ToInt64(System.Configuration.ConfigurationManager.AppSettings["Search.PublicationsNodeID2"].ToString())), storedproc);
            timelineBar.Src       = vil.src;
            timelineBar.Alt       = vil.alt;
            litTimelineTable.Text = vil.asText;

            if (timelineBar.Src == "")
            {
                timelineBar.Visible = false;
            }


            // Login link
            //loginLiteral.Text = String.Format("<a href='{0}'>login</a>", Root.Domain + "/login/default.aspx?pin=send&method=login&edit=true");

            //if (type == Utilities.DataIO.ClassType.Group) divPubHeaderText.Visible = false;

            Framework.Utilities.DebugLogging.Log("PUBLICATION MODULE end Milliseconds:" + (DateTime.Now - d).TotalSeconds);
        }
Example #4
0
        public void GetSubjectProfile()
        {
            Profile.Utilities.DataIO dataio = new Profile.Utilities.DataIO();

            Namespace rdfnamespaces = new Namespace();

            try
            {
                this.RDFTriple = new RDFTriple(Convert.ToInt64(HttpContext.Current.Request.QueryString["subject"]));

                this.RDFTriple.ShowDetails = true;
                this.RDFTriple.Expand      = true;
                //This method is used during the edit process.
                this.RDFTriple.Edit = true;

                this.BaseData   = dataio.GetRDFData(this.RDFTriple);
                this.Namespaces = rdfnamespaces.LoadNamespaces(this.BaseData);
            }
            catch (Exception ex) { Framework.Utilities.DebugLogging.Log(ex.Message + " ++ " + ex.StackTrace); }
        }
Example #5
0
        public void GetNetworkProfile(Int64 subject, Int64 predicate)
        {
            Profile.Utilities.DataIO dataio = new Profile.Utilities.DataIO();

            Namespace rdfnamespaces = new Namespace();

            try
            {
                this.RDFTriple = new RDFTriple(subject, predicate);

                this.RDFTriple.ShowDetails = true;
                this.RDFTriple.Expand      = true;
                //This method is used during the edit process.
                this.RDFTriple.Edit = true;

                this.BaseData   = dataio.GetRDFData(this.RDFTriple);
                this.Namespaces = rdfnamespaces.LoadNamespaces(this.BaseData);
            }
            catch (Exception ex) { Framework.Utilities.DebugLogging.Log(ex.Message + " ++ " + ex.StackTrace); }
        }
        //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 #7
0
        public void GetDataByURI()
        {
            Profile.Utilities.DataIO dataio = new Profile.Utilities.DataIO();

            Namespace rdfnamespaces = new Namespace();

            try
            {
                if (this.RDFTriple == null)
                {
                    if (this.BaseData.SelectSingleNode(this.GetModuleParamString("DataURI"), this.Namespaces).InnerText.Contains(Root.Domain))
                    {
                        string[] vars = this.BaseData.SelectSingleNode(this.GetModuleParamString("DataURI"), this.Namespaces).InnerText.Split('/');

                        //SPO
                        Int64 subject   = 0;
                        Int64 predicate = 0;
                        Int64 _object   = 0;
                        Int64 result;

                        for (int i = 0; i < vars.Length; i++)
                        {
                            if (Int64.TryParse(vars[i], out result))
                            {
                                if (subject != 0 && predicate != 0 && _object == 0)
                                {
                                    _object = Convert.ToInt64(vars[i]);
                                }

                                if (subject != 0 && predicate == 0)
                                {
                                    predicate = Convert.ToInt64(vars[i]);
                                }

                                if (subject == 0)
                                {
                                    subject = Convert.ToInt64(vars[i]);
                                }
                            }
                        }

                        this.RDFTriple = new RDFTriple(subject, predicate, _object);
                    }
                    else
                    {
                        this.RDFTriple = new RDFTriple(this.BaseData.SelectSingleNode(this.GetModuleParamString("DataURI"), this.Namespaces).InnerText);
                    }
                }
                if (this.GetModuleParamString("Offset") != string.Empty)
                {
                    this.RDFTriple.Offset = this.GetModuleParamString("Offset");
                }
                else
                {
                    this.RDFTriple.Offset = string.Empty;
                }


                if (this.GetModuleParamString("Limit") != string.Empty)
                {
                    this.RDFTriple.Limit = this.GetModuleParamString("Limit");
                }
                else
                {
                    this.RDFTriple.Limit = string.Empty;
                }


                if (this.GetModuleParamString("Edit") == "true")
                {
                    this.RDFTriple.Edit = true;
                }

                if (this.GetModuleParamXml("ExpandRDFList") != null)
                {
                    XmlNode x = this.GetModuleParamXml("ExpandRDFList");

                    if (x != null)
                    {
                        this.RDFTriple.ExpandRDFList = x.InnerXml;
                    }
                }

                this.RDFTriple.ShowDetails = true;
                this.RDFTriple.Expand      = true;
                this.BaseData   = dataio.GetRDFData(this.RDFTriple);
                this.Namespaces = rdfnamespaces.LoadNamespaces(this.BaseData);
            }
            catch (Exception ex) { Framework.Utilities.DebugLogging.Log(ex.Message + " ++ " + ex.StackTrace); }
        }
        protected void cmdSaveByURI_onclick(object sender, ImageClickEventArgs e)
        {
            Edit.Utilities.DataIO data = new Profiles.Edit.Utilities.DataIO();

            if (txtURI.Text.ToLower().Trim() != string.Empty)
            {
                string uri = string.Empty;
                bool validuri = false;
                bool urifound = false;
                XmlNamespaceManager nmsmanager = null;

                pnlAddByURI.Visible = false;

                    //you need to get back the actual URI that is discovered during the post.
                    //The post might be to an HTML document where I have to look for an alt link to RDF data.
                    //Plus the URI we get back from this method needs to be used to create a triple in our Database so dont lose it.
                    XmlDocument rtndata = data.GetURIRelLink(txtURI.Text.Trim(), ref uri);

                    if (rtndata.InnerXml != string.Empty)
                        urifound = true;

                    if (urifound)
                    {
                        Framework.Utilities.Namespace namespaces = new Namespace();
                        nmsmanager = namespaces.LoadNamespaces(rtndata);

                        if (rtndata.SelectSingleNode("rdf:RDF/rdf:Description/rdf:type[@rdf:resource='" + PropertyList[0].Value + "']", nmsmanager) != null)
                            validuri = true;
                    }

                    if (uri.Trim() != string.Empty)
                    {
                        litAddByURIConfirmLabel.Text = rtndata.SelectSingleNode("rdf:RDF/rdf:Description[@rdf:about='" + uri + "']/rdfs:label", nmsmanager).InnerText;
                        hdnURI.Value = uri;
                    }
                    else
                    {
                        litAddByURIConfirmLabel.Text = txtURI.Text.Trim();
                        hdnURI.Value = txtURI.Text.Trim();

                    }

                    if (validuri)
                        litAddByURIConfirmType.Text = PropertyList[0].Text;
                    else if (!urifound)
                        litAddByURIConfirmType.Text = "The item could not be found. Do you still want to add this URL?";
                    else if (!validuri)
                        litAddByURIConfirmType.Text = "The item type is invalid. Do you want to add this item anyway?";

                    pnlAddByURIConfirm.Visible = true;
                    pnlAddBySearch.Visible = false;
                    pnlAddNew.Visible = false;
                    pnlAddByURI.Visible = false;
                    phAddBySearch.Visible = false;
                    phAddNew.Visible = false;
                    phAddByURL.Visible = true;
                    imgAddArror.ImageUrl = "~/Framework/Images/icon_squareDownArrow.gif";
                    Session["pnlAddByURI.Visible"] = true;

                }
        }
Example #9
0
        private void DrawProfilesModule()
        {
            DateTime d = DateTime.Now;

            Profiles.Profile.Utilities.DataIO data = new Profiles.Profile.Utilities.DataIO();
            List <Publication> publication         = new List <Publication>();

            Utilities.DataIO.ClassType    type         = Utilities.DataIO.ClassType.Unknown;
            Framework.Utilities.Namespace xmlnamespace = new Profiles.Framework.Utilities.Namespace();
            XmlNamespaceManager           namespaces   = xmlnamespace.LoadNamespaces(BaseData);

            if (BaseData.SelectSingleNode("rdf:RDF/rdf:Description[1]/rdf:type[@rdf:resource='http://xmlns.com/foaf/0.1/Person']", namespaces) != null)
            {
                type = Utilities.DataIO.ClassType.Person;
            }
            if (BaseData.SelectSingleNode("rdf:RDF/rdf:Description[1]/rdf:type[@rdf:resource='http://xmlns.com/foaf/0.1/Group']", namespaces) != null)
            {
                type = Utilities.DataIO.ClassType.Grant;
            }

            using (SqlDataReader reader = data.GetPublications(base.RDFTriple, type))
            {
                while (reader.Read())
                {
                    publication.Add(new Publication(reader["bibo_pmid"].ToString(), reader["vivo_pmcid"].ToString(), reader["prns_informationResourceReference"].ToString(), reader["vivo_webpage"].ToString()));
                }

                rpPublication.DataSource = publication;
                rpPublication.DataBind();
            }

            // Get timeline bar chart
            string storedproc = "[Profile.Module].[NetworkAuthorshipTimeline.Person.GetData]";

            if (type == Utilities.DataIO.ClassType.Grant)
            {
                storedproc = "[Profile.Module].[NetworkAuthorshipTimeline.Group.GetData]";
            }
            using (SqlDataReader reader = data.GetGoogleTimeline(base.RDFTriple, storedproc))
            {
                while (reader.Read())
                {
                    timelineBar.Src       = reader["gc"].ToString();
                    timelineBar.Alt       = reader["alt"].ToString();
                    litTimelineTable.Text = reader["asText"].ToString();
                }
                reader.Close();
            }

            if (timelineBar.Src == "")
            {
                timelineBar.Visible = false;
            }


            // Login link
            loginLiteral.Text = String.Format("<a href='{0}'>login</a>", Root.Domain + "/login/default.aspx?pin=send&method=login&edit=true");

            if (type == Utilities.DataIO.ClassType.Grant)
            {
                divPubHeaderText.Visible = false;
            }

            Framework.Utilities.DebugLogging.Log("PUBLICATION MODULE end Milliseconds:" + (DateTime.Now - d).TotalSeconds);
        }
Example #10
0
        public void GetSubjectProfile()
        {
            Profile.Utilities.DataIO dataio = new Profile.Utilities.DataIO();

            Namespace rdfnamespaces = new Namespace();
            try
            {
                this.RDFTriple = new RDFTriple(Convert.ToInt64(HttpContext.Current.Request.QueryString["subject"]));

                this.RDFTriple.ShowDetails = true;
                this.RDFTriple.Expand = true;
                //This method is used during the edit process.
                this.RDFTriple.Edit = true;

                this.BaseData = dataio.GetRDFData(this.RDFTriple);
                this.Namespaces = rdfnamespaces.LoadNamespaces(this.BaseData);

            }
            catch (Exception ex) { Framework.Utilities.DebugLogging.Log(ex.Message + " ++ " + ex.StackTrace); }
        }
        protected void DrawUIOnLoad()
        {
            oDataIO = new DIRECT.Utilities.DataIO();

            Profiles.DIRECT.Utilities.DataIO searchDataIO;

            string DirectServiceURL = Root.Domain + "/DIRECT/Modules/DirectSearch/directservice.aspx";// Request.Url.AbsoluteUri.Replace("&", "&amp;");
            string ProfilesURL = Root.Domain;
            string PopulationTypeText = oDataIO.GetDirectConfig().PopulationType;
            int QueryTimeout = oDataIO.GetDirectConfig().Timeout;
            XmlDocument query = new XmlDocument();
            XmlDocument result;

            Framework.Utilities.Namespace rdfnamespaces = new Namespace();
            XmlNamespaceManager namespaces = null;

            string sql = string.Empty;
            string ResultDetailsURL = string.Empty;
            string strResult = "";

            SqlDataReader dr;

            if (Request["Request"] == null) { return; }

            string task = Request["Request"].ToLower();
            switch (task)
            {
                case "getsites":
                    string ResultStr = "<?xml version=\"1.0\" encoding=\"UTF-8\" ?>" + "<site-list>";

                    dr = oDataIO.GetSitesOrderBySortOrder();
                    while (dr.Read())
                    {
                        Int64 SiteID = Convert.ToInt64(dr["SiteID"]);
                        string SiteName = dr["SiteName"].ToString();
                        string QueryURL = dr["QueryURL"].ToString();
                        if (SiteName == null) SiteName = "";
                        if (QueryURL == null) QueryURL = "";
                        ResultStr = ResultStr + "<site-description><site-id>" + SiteID + "</site-id><name>" + cx(SiteName) + "</name><aggregate-query>" + cx(QueryURL) + "</aggregate-query></site-description>";
                    }

                    if (!dr.IsClosed)
                        dr.Close();

                    ResultStr += "</site-list>";
                    Response.ContentType = "text/xml";
                    Response.AddHeader("Content-Type", "text/xml;charset=UTF-8");
                    //Response.ContentEncoding.CodePage = 65001;
                    Response.Charset = "UTF-8";

                    Response.Write(ResultStr);

                    break;
                case "incomingcount":

                    string q = Request["SearchPhrase"].Trim();
                    // Enter log record
                    sql = "insert into [Direct.].LogIncoming(Details,ReceivedDate,RequestIP,QueryString) " +
                         " values (0,GetDate()," + cs(Request.ServerVariables["REMOTE_ADDR"]) + "," + cs(q) + ")";

                    oDataIO.ExecuteSQLDataCommand(sql);

                    // Execute query
                    string x = "<SearchOptions>" +
                              "<MatchOptions>" +
                              "<SearchString ExactMatch=\"false\">" + cx(q) + "</SearchString> " +
                              "<SearchFiltersList /> " +
                              "<ClassURI>http://xmlns.com/foaf/0.1/Person</ClassURI> " +
                              "</MatchOptions>" +
                              "<OutputOptions>" +
                              "<Offset>0</Offset>" +
                              "<Limit>1</Limit> " +
                              "<SortByList>" +
                              "</SortByList>" +
                              "</OutputOptions>" +
                              "</SearchOptions>";
                    query.LoadXml(x);

                    searchDataIO = new Profiles.DIRECT.Utilities.DataIO();
                    result = searchDataIO.Search(query);
                    namespaces = rdfnamespaces.LoadNamespaces(result);

                    string ResultCount = result.SelectSingleNode("rdf:RDF/rdf:Description/prns:numberOfConnections", namespaces).InnerText;

                    // Form result message
                    ResultStr = "<?xml version=\"1.0\" encoding=\"UTF-8\" ?>";
                    ResultStr += "<aggregation-result>";
                    ResultStr += "<count>" + ResultCount + "</count>";
                    ResultStr += "<population-type>" + PopulationTypeText + "</population-type>";
                    ResultStr += "<preview-URL>" + DirectServiceURL + "?Request=IncomingPreview&amp;SearchPhrase=" + cx(q) + "</preview-URL>";
                    ResultStr += "<search-results-URL>" + DirectServiceURL + "?Request=IncomingDetails&amp;SearchPhrase=" + cx(q) + "</search-results-URL>";
                    ResultStr += "</aggregation-result>";

                    // Send result
                    Response.ContentType = "text/xml";
                    Response.AddHeader("Content-Type", "text/xml;charset=UTF-8");
                    //Response.ContentEncoding.CodePage = 65001;
                    Response.Charset = "UTF-8";
                    Response.Write(ResultStr);
                    break;

                case "incomingdetails":

                    q = Request["SearchPhrase"].Trim();

                    // Enter log record
                    sql = "insert into [Direct.].LogIncoming(Details,ReceivedDate,RequestIP,QueryString) ";
                    sql += " values (1,GetDate()," + cs(Request.ServerVariables["REMOTE_ADDR"]) + "," +
                            cs(q) + ")";

                    oDataIO.ExecuteSQLDataCommand(sql);

                    // Execute query

                    query.LoadXml("<SearchOptions>" +
                           "<MatchOptions>" +
                           "<SearchString ExactMatch=\"false\">" + cx(q) + "</SearchString> " +
                           "<SearchFiltersList /> " +
                           "<ClassURI>http://xmlns.com/foaf/0.1/Person</ClassURI> " +
                           "</MatchOptions>" +
                           "<OutputOptions>" +
                           "<Offset>0</Offset>" +
                           "<Limit>1</Limit> " +
                           "<SortByList>" +
                           "</SortByList>" +
                           "</OutputOptions>" +
                           "</SearchOptions>");

                    searchDataIO = new Profiles.DIRECT.Utilities.DataIO();
                    result = searchDataIO.Search(query);

                    strResult = result.InnerXml;

                    // Parse results
                    XmlDocument objDoc = new XmlDocument();
                    objDoc = new XmlDocument();
                    objDoc.LoadXml(strResult);

                    namespaces = rdfnamespaces.LoadNamespaces(result);

                    ResultCount = result.SelectSingleNode("rdf:RDF/rdf:Description/prns:numberOfConnections", namespaces).InnerText;

                    if (ProfilesURL.Substring(ProfilesURL.Length - 1) != "/") { ProfilesURL += "/"; }
                    Response.Redirect(ProfilesURL + "search/default.aspx?searchtype=people&classuri=http://xmlns.com/foaf/0.1/Person&searchfor=" + q);

                    break;
                case "incomingpreview":

                    q = Request["SearchPhrase"].Trim();

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

                    string searchphrase = Request["SearchPhrase"].Trim();
                    Response.Write(data.Search(searchphrase));

                    break;

                case "outgoingcount":

                    if (Request["blank"] == "y")
                    {
                        Response.Write("<html><body></body></html>");
                        Response.End();
                    }

                    string SearchPhrase = Request["SearchPhrase"];

                    Response.Write("<script>parent.dsLoading=1;</script>" + Environment.NewLine);

                    dr = oDataIO.GetSitesOrderBySiteID();

                    SiteIDs = new int[1000];
                    URLs = new string[1000];
                    FSIDs = new string[1000];

                    Site site;
                    ListOfSites = new List<Site>();
                    Int64 sites = 0;

                    List<AsyncProcessing> ListOfThreads = new List<AsyncProcessing>();
                    AsyncProcessing async;
                    while (dr.Read())
                    {
                        SiteIDs[sites] = Convert.ToInt32(dr["SiteID"].ToString());
                        URLs[sites] = dr["QueryURL"] + SearchPhrase;
                        FSIDs[sites] = dr["FSID"].ToString();
                        site = new Site(URLs[sites], SiteIDs[sites], FSIDs[sites], SearchPhrase, HttpContext.Current);
                        ListOfSites.Add(site);
                        async = new AsyncProcessing();
                        async.BeginProcessRequest(site);
                        ListOfThreads.Add(async);
                        sites++;
                    }

                    if (!dr.IsClosed)
                        dr.Close();

                    //eat up the CPU for x number of seconds :) so all the requests can come back.  This is set in the web.config file
                    DateTime end = DateTime.Now.AddSeconds(QueryTimeout);
                    while (DateTime.Now < end)
                    { }

                    //close out anything that did not complete in 5 seconds
                    for (int loop = 0; loop < ListOfThreads.Count; loop++)
                    {

                        if (!ListOfThreads[loop].Site.IsDone)
                        {
                            sql = "update [Direct.].LogOutgoing set ResponseTime = datediff(ms,SentDate,GetDate()), "
                                    + " ResponseState = " + 1
                                    + " where FSID = " + cs(ListOfThreads[loop].Site.FSID);

                            oDataIO.ExecuteSQLDataCommand(sql);
                            Response.Write("<script>parent.siteResult(" + ListOfThreads[loop].Site.SiteID + ",1,0,'','','','');</script>");
                            ListOfThreads.Remove(ListOfThreads[loop]);
                        }
                    }

                    try
                    {
                        Response.Flush();
                    }
                    catch { }

                    break;
                case "outgoingdetails":

                    string FSID = Request["fsid"].Trim();
                    string SiteId = string.Empty;
                    if (FSID != "")
                    {
                        dr = oDataIO.GetFsID(cs(FSID));

                        if (dr.Read())
                        {
                            SiteId = dr["SiteID"].ToString();
                            ResultDetailsURL = dr["ResultDetailsURL"].ToString().Replace("\n\t", "");
                        }

                        if (!dr.IsClosed)
                            dr.Close();
                    }
                    if ((FSID != "") && (SiteId != "") && (ResultDetailsURL != ""))
                    {
                        // Enter log record
                        oDataIO.ExecuteSQLDataCommand("insert into [Direct.].LogOutgoing(FSID,SiteID,Details,SentDate) "
                            + " values ('" + FSID + "'," + SiteId + ",1,GetDate())");

                        Response.Redirect(ResultDetailsURL);

                    }
                    else
                        Response.Redirect(ProfilesURL);
                    break;
            }

            Response.End();
        }
        protected void Page_Load(object sender, EventArgs e)
        {
            masterpage = (Framework.Template)base.Master;
            masterpage.Tab = "";

            string method = string.Empty;

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

            this.LoadPresentationXML(method);
            this.LoadAssets();
            BaseModule bm = new BaseModule();
            XmlNamespaceManager xnm;
            Framework.Utilities.Namespace name = new Namespace();
            bm.GetSubjectProfile();
            xnm = name.LoadNamespaces(bm.BaseData);
            masterpage.RDFData = bm.BaseData;
            masterpage.RDFNamespaces = xnm;
            bm = null;
            masterpage.PresentationXML = this.PresentationXML;
        }
Example #13
0
        private void DrawProfilesModule()
        {
            DataIO.PublicationsType pt;
            if (base.Context.Request.RawUrl.Contains("Publications=All"))
            {
                pt            = DataIO.PublicationsType.All;
                aAllPubs.HRef = "";
                aAllPubs.Attributes.Add("class", "selected");
                aCoronaPubs.HRef = base.Context.Request.Path + "";
                aCovidPubs.HRef  = base.Context.Request.Path + "?Publications=Covid-19";
            }
            else if (base.Context.Request.RawUrl.Contains("Publications=Covid-19"))
            {
                pt = DataIO.PublicationsType.Covid;
                aCovidPubs.HRef = "";
                aCovidPubs.Attributes.Add("class", "selected");
                aCoronaPubs.HRef = base.Context.Request.Path + "";
                aAllPubs.HRef    = base.Context.Request.Path + "?Publications=All";
            }
            else
            {
                pt = DataIO.PublicationsType.Coronavirus;
                aCoronaPubs.HRef = "";
                aCoronaPubs.Attributes.Add("class", "selected");
                aAllPubs.HRef   = base.Context.Request.Path + "?Publications=All";
                aCovidPubs.HRef = base.Context.Request.Path + "?Publications=Covid-19";
            }
            DateTime d = DateTime.Now;

            Profiles.Profile.Modules.CustomViewAuthorInAuthorship.DataIO data = new Profiles.Profile.Modules.CustomViewAuthorInAuthorship.DataIO();
            List <Publication> publication = new List <Publication>();

            Utilities.DataIO.ClassType    type         = Utilities.DataIO.ClassType.Unknown;
            Framework.Utilities.Namespace xmlnamespace = new Profiles.Framework.Utilities.Namespace();
            XmlNamespaceManager           namespaces   = xmlnamespace.LoadNamespaces(BaseData);

            if (BaseData.SelectSingleNode("rdf:RDF/rdf:Description[1]/rdf:type[@rdf:resource='http://xmlns.com/foaf/0.1/Person']", namespaces) != null)
            {
                type = Utilities.DataIO.ClassType.Person;
            }
            if (BaseData.SelectSingleNode("rdf:RDF/rdf:Description[1]/rdf:type[@rdf:resource='http://xmlns.com/foaf/0.1/Group']", namespaces) != null)
            {
                type = Utilities.DataIO.ClassType.Group;
            }

            using (SqlDataReader reader = data.GetPublications(base.RDFTriple, type, pt))
            {
                while (reader.Read())
                {
                    publication.Add(new Publication(reader["bibo_pmid"].ToString(), reader["vivo_pmcid"].ToString(),
                                                    reader["prns_informationResourceReference"].ToString(), reader["vivo_webpage"].ToString(), Convert.ToInt32(reader["PMCCitations"]),
                                                    reader["Fields"].ToString(), Convert.ToInt32(reader["TranslationHumans"]), Convert.ToInt32(reader["TranslationAnimals"]),
                                                    Convert.ToInt32(reader["TranslationCells"]), Convert.ToInt32(reader["TranslationPublicHealth"]), Convert.ToInt32(reader["TranslationClinicalTrial"])));
                }

                rpPublication.DataSource = publication;
                rpPublication.DataBind();
            }

            if (type == Utilities.DataIO.ClassType.Group)
            {
                divPubHeaderText.Visible = false;
            }

            Framework.Utilities.DebugLogging.Log("PUBLICATION MODULE end Milliseconds:" + (DateTime.Now - d).TotalSeconds);
        }
        public void GetDataByURI()
        {
            Profile.Utilities.DataIO dataio = new Profile.Utilities.DataIO();

            Namespace rdfnamespaces = new Namespace();
            try
            {
                if (this.RDFTriple == null)
                    this.RDFTriple = new RDFTriple(this.BaseData.SelectSingleNode(this.GetModuleParamString("DataURI"), this.Namespaces).InnerText);

                if (this.GetModuleParamString("Offset") != string.Empty)
                    this.RDFTriple.Offset = this.GetModuleParamString("Offset");
                else
                    this.RDFTriple.Offset = string.Empty;

                if (this.GetModuleParamString("Limit") != string.Empty)
                    this.RDFTriple.Limit = this.GetModuleParamString("Limit");
                else
                    this.RDFTriple.Limit = string.Empty;

                if (this.GetModuleParamString("Edit") == "true")
                    this.RDFTriple.Edit = true;

                this.RDFTriple.ShowDetails = true;
                this.RDFTriple.Expand = true;
                this.BaseData = dataio.GetRDFData(this.RDFTriple);
                this.Namespaces = rdfnamespaces.LoadNamespaces(this.BaseData);

            }
            catch (Exception ex) { Framework.Utilities.DebugLogging.Log(ex.Message + " ++ " + ex.StackTrace); }
        }
Example #15
0
        public void GetDataByURI()
        {
            Profile.Utilities.DataIO dataio = new Profile.Utilities.DataIO();

            Namespace rdfnamespaces = new Namespace();
            try
            {
                if (this.RDFTriple == null)
                {
                    if (this.BaseData.SelectSingleNode(this.GetModuleParamString("DataURI"), this.Namespaces).InnerText.Contains(Root.Domain))
                    {
                        string[] vars = this.BaseData.SelectSingleNode(this.GetModuleParamString("DataURI"), this.Namespaces).InnerText.Split('/');

                        //SPO
                        Int64 subject = 0;
                        Int64 predicate = 0;
                        Int64 _object = 0;
                        Int64 result;

                        for (int i = 0; i < vars.Length; i++)
                        {
                            if (Int64.TryParse(vars[i], out result))
                            {

                                if (subject != 0 && predicate != 0 && _object == 0)
                                    _object = Convert.ToInt64(vars[i]);

                                if (subject != 0 && predicate == 0)
                                    predicate = Convert.ToInt64(vars[i]);

                                if (subject == 0)
                                    subject = Convert.ToInt64(vars[i]);

                            }

                        }

                        this.RDFTriple = new RDFTriple(subject, predicate, _object);
                    }
                    else
                    {
                        this.RDFTriple = new RDFTriple(this.BaseData.SelectSingleNode(this.GetModuleParamString("DataURI"), this.Namespaces).InnerText);
                    }

                }
                if (this.GetModuleParamString("Offset") != string.Empty)
                    this.RDFTriple.Offset = this.GetModuleParamString("Offset");
                else
                    this.RDFTriple.Offset = string.Empty;

                if (this.GetModuleParamString("Limit") != string.Empty)
                    this.RDFTriple.Limit = this.GetModuleParamString("Limit");
                else
                    this.RDFTriple.Limit = string.Empty;

                if (this.GetModuleParamString("Edit") == "true")
                    this.RDFTriple.Edit = true;

                if (this.GetModuleParamXml("ExpandRDFList") != null)
                {
                    XmlNode x = this.GetModuleParamXml("ExpandRDFList");

                    if (x != null)
                        this.RDFTriple.ExpandRDFList = x.InnerXml;
                }

                this.RDFTriple.ShowDetails = true;
                this.RDFTriple.Expand = true;
                this.BaseData = dataio.GetRDFData(this.RDFTriple);
                this.Namespaces = rdfnamespaces.LoadNamespaces(this.BaseData);

            }
            catch (Exception ex) { Framework.Utilities.DebugLogging.Log(ex.Message + " ++ " + ex.StackTrace); }
        }
Example #16
0
        public void GetNetworkProfile(Int64 subject, Int64 predicate)
        {
            Profile.Utilities.DataIO dataio = new Profile.Utilities.DataIO();

            Namespace rdfnamespaces = new Namespace();
            try
            {
                this.RDFTriple = new RDFTriple(subject, predicate);

                this.RDFTriple.ShowDetails = true;
                this.RDFTriple.Expand = true;
                //This method is used during the edit process.
                this.RDFTriple.Edit = true;

                this.BaseData = dataio.GetRDFData(this.RDFTriple);
                this.Namespaces = rdfnamespaces.LoadNamespaces(this.BaseData);

            }
            catch (Exception ex) { Framework.Utilities.DebugLogging.Log(ex.Message + " ++ " + ex.StackTrace); }
        }
Example #17
0
        public void LoadRDFData()
        {
            Framework.Utilities.DebugLogging.Log("{Page Calling} Profile.ProfileData.LoadRDFData() start " + ((System.Web.UI.TemplateControl)(this)).AppRelativeVirtualPath);
            XmlDocument xml = new XmlDocument();
            Namespace rdfnamespaces = new Namespace();
            Profiles.Profile.Utilities.DataIO data = new Profiles.Profile.Utilities.DataIO();

            if (HttpContext.Current.Request.Headers["Offset"] != null)
                this.RDFTriple.Offset = HttpContext.Current.Request.Headers["Offset"];

            if (HttpContext.Current.Request.Headers["Limit"] != null)
                this.RDFTriple.Limit = HttpContext.Current.Request.Headers["Limit"];

            if (HttpContext.Current.Request.Headers["ExpandRDFList"] != null)
                this.RDFTriple.ExpandRDFList = HttpContext.Current.Request.Headers["ExpandRDFList"];

            xml = data.GetRDFData(this.RDFTriple);
            this.RDFData = xml;
            this.RDFNamespaces = rdfnamespaces.LoadNamespaces(xml);
            Framework.Utilities.DebugLogging.Log("{Page Calling} Profile.ProfileData.LoadRDFData() end" + ((System.Web.UI.TemplateControl)(this)).AppRelativeVirtualPath);
        }
Example #18
0
        public void LoadPageData()
        {
            Framework.Utilities.Namespace namespaces = new Namespace();

            Profiles.Profile.Utilities.DataIO data = new Profiles.Profile.Utilities.DataIO();
            this.PresentationXML = data.GetPresentationData(this.RDFTriple);

            XmlNode x = this.PresentationXML.SelectSingleNode("Presentation[1]/ExpandRDFList[1]");

            if (x != null)
                this.RDFTriple.ExpandRDFList = x.OuterXml;

            this.RDFData = data.GetRDFData(this.RDFTriple);

            this.RDFNamespaces = namespaces.LoadNamespaces(this.RDFData);
        }
        public void DrawProfilesModule()
        {
            string    countrycodes = string.Empty;
            DataIOMap dataIO       = new Search.Utilities.DataIOMap();

            string researchers = Newtonsoft.Json.JsonConvert.SerializeObject(dataIO.GetTopGeoResearchers());
            string countries   = Newtonsoft.Json.JsonConvert.SerializeObject(dataIO.GetCountryCounts());



            using (StreamReader sr = new StreamReader(Server.MapPath("~/Search/Modules/SearchMap/countries.json")))
            {
                countrycodes = sr.ReadToEnd();
            }

            litJS.Text = string.Format("<script>var countries = {0}; var researchers = {1};var countrycodes = {2};</script>", countries, researchers, countrycodes);

            Profiles.Profile.Modules.CustomViewAuthorInAuthorshipTimeline.DataIO data = new Profiles.Profile.Modules.CustomViewAuthorInAuthorshipTimeline.DataIO();
            List <Publication> publication = new List <Publication>();

            Profiles.Profile.Utilities.DataIO.ClassType type = Profiles.Profile.Utilities.DataIO.ClassType.Unknown;
            Framework.Utilities.Namespace xmlnamespace       = new Profiles.Framework.Utilities.Namespace();
            XmlNamespaceManager           namespaces         = xmlnamespace.LoadNamespaces(BaseData);

            //if (BaseData.SelectSingleNode("rdf:RDF/rdf:Description[1]/rdf:type[@rdf:resource='http://xmlns.com/foaf/0.1/Person']", namespaces) != null)
            //    type = Utilities.DataIO.ClassType.Person;
            //if (BaseData.SelectSingleNode("rdf:RDF/rdf:Description[1]/rdf:type[@rdf:resource='http://xmlns.com/foaf/0.1/Group']", namespaces) != null)
            type = Profiles.Profile.Utilities.DataIO.ClassType.Group;

            using (SqlDataReader reader = data.GetPublications(base.RDFTriple, type))
            {
                while (reader.Read())
                {
                    publication.Add(new Publication(reader["bibo_pmid"].ToString(), reader["vivo_pmcid"].ToString(),
                                                    reader["prns_informationResourceReference"].ToString(), reader["vivo_webpage"].ToString(), Convert.ToInt32(reader["PMCCitations"]),
                                                    reader["Fields"].ToString(), Convert.ToInt32(reader["TranslationHumans"]), Convert.ToInt32(reader["TranslationAnimals"]),
                                                    Convert.ToInt32(reader["TranslationCells"]), Convert.ToInt32(reader["TranslationPublicHealth"]), Convert.ToInt32(reader["TranslationClinicalTrial"])));
                }

                rpPublication.DataSource = publication;
                rpPublication.DataBind();
            }

            // Get timeline bar chart
            string storedproc = "[Profile.Module].[NetworkAuthorshipTimeline.Person.GetData]";

            if (type == Profiles.Profile.Utilities.DataIO.ClassType.Group)
            {
                storedproc = "[Profile.Module].[NetworkAuthorshipTimeline.Group.GetData]";
            }

            Profiles.Profile.Modules.CustomViewAuthorInAuthorshipTimeline.DataIO.VisualizationImageLink vil      = data.GetGoogleTimeline(new RDFTriple(Convert.ToInt64(System.Configuration.ConfigurationManager.AppSettings["Search.PublicationsNodeID2"].ToString())), storedproc);
            Profiles.Profile.Modules.CustomViewAuthorInAuthorshipTimeline.DataIO.VisualizationImageLink vilCOVID = data.GetGoogleTimelineCOVID(new RDFTriple(Convert.ToInt64(System.Configuration.ConfigurationManager.AppSettings["Search.PublicationsNodeID2"].ToString())), storedproc);
            timelineBarCOVID.Src  = vilCOVID.src;
            timelineBarCOVID.Alt  = vilCOVID.alt;
            timelineBar.Src       = vil.src;
            timelineBar.Alt       = vil.alt;
            litTimelineTable.Text = vil.asText;

            if (timelineBar.Src == "")
            {
                timelineBar.Visible = false;
            }


            // Login link
            //loginLiteral.Text = String.Format("<a href='{0}'>login</a>", Root.Domain + "/login/default.aspx?pin=send&method=login&edit=true");

            //if (type == Utilities.DataIO.ClassType.Group) divPubHeaderText.Visible = false;
        }