public CustomEditMainImage(XmlDocument pagedata, List<ModuleParams> moduleparams, XmlNamespaceManager pagenamespaces) : base(pagedata, moduleparams, pagenamespaces) { Edit.Utilities.DataIO data = new Profiles.Edit.Utilities.DataIO(); SessionManagement sm = new SessionManagement(); this.XMLData = pagedata; propdata = new Profiles.Profile.Utilities.DataIO(); if (Request.QueryString["subject"] != null) this.SubjectID = Convert.ToInt64(Request.QueryString["subject"]); else if (base.GetRawQueryStringItem("subject") != null) this.SubjectID = Convert.ToInt64(base.GetRawQueryStringItem("subject")); else Response.Redirect("~/search"); this.PredicateURI = Request.QueryString["predicateuri"].Replace("!", "#"); this.PropertyListXML = propdata.GetPropertyList(this.BaseData, base.PresentationXML, PredicateURI, false, true, false); litBackLink.Text = "<a href='" + Root.Domain + "/edit/" + this.SubjectID.ToString() + "'>Edit Menu</a> > <b>" + PropertyListXML.SelectSingleNode("PropertyList/PropertyGroup/Property/@Label").Value + "</b>"; securityOptions.Subject = this.SubjectID; securityOptions.PredicateURI = PredicateURI; securityOptions.PrivacyCode = Convert.ToInt32(this.PropertyListXML.SelectSingleNode("PropertyList/PropertyGroup/Property/@ViewSecurityGroup").Value); securityOptions.SecurityGroups = new XmlDataDocument(); securityOptions.SecurityGroups.LoadXml(base.PresentationXML.DocumentElement.LastChild.OuterXml); securityOptions.BubbleClick += SecurityDisplayed; }
//Inserts comma seperated string of PubMed Ids into the db private void InsertPubMedIds(string value) { string uri = "http://eutils.ncbi.nlm.nih.gov/entrez/eutils/efetch.fcgi?retmax=1000&db=pubmed&retmode=xml&id=" + value; System.Xml.XmlDocument myXml = new System.Xml.XmlDocument(); myXml.LoadXml(this.HttpPost(uri, "Catalyst", "text/plain")); XmlNodeList nodes = myXml.SelectNodes("PubmedArticleSet/PubmedArticle"); Utilities.DataIO data = new Profiles.Edit.Utilities.DataIO(); foreach (XmlNode node in nodes) { string pmid = node.SelectSingleNode("MedlineCitation/PMID").InnerText; if (!data.CheckPublicationExists(pmid)) { // Insert or update the publication data.AddPublication(pmid, node.OuterXml); } // Assign the user to the publication data.AddPublication(_personId, Convert.ToInt32(pmid)); } this.Counter = 0; Session["phAddPub.Visible"] = null; Session["pnlAddPubMed.Visible"] = null; Session["pnlAddCustomPubMed.Visible"] = null; Session["pnlDeletePubMed.Visible"] = null; }
public CustomEditAuthorInAuthorship(XmlDocument pagedata, List <ModuleParams> moduleparams, XmlNamespaceManager pagenamespaces) : base(pagedata, moduleparams, pagenamespaces) { SessionManagement sm = new SessionManagement(); Utilities.DataIO data = new Profiles.Edit.Utilities.DataIO(); propdata = new Profiles.Profile.Utilities.DataIO(); this._subject = Convert.ToInt64(Request.QueryString["subject"]); this._predicateuri = Request.QueryString["predicateuri"].Replace("!", "#"); this._personId = data.GetPersonID(_subject); Session["NodeID"] = this._subject; Session["SessionID"] = sm.Session().SessionID; this.PropertyListXML = propdata.GetPropertyList(pagedata, base.PresentationXML, this._predicateuri, false, true, false); securityOptions.Subject = this._subject; securityOptions.PredicateURI = this._predicateuri; securityOptions.PrivacyCode = Convert.ToInt32(this.PropertyListXML.SelectSingleNode("PropertyList/PropertyGroup/Property/@ViewSecurityGroup").Value); securityOptions.SecurityGroups = new XmlDataDocument(); securityOptions.SecurityGroups.LoadXml(base.PresentationXML.DocumentElement.LastChild.OuterXml); securityOptions.BubbleClick += SecurityDisplayed; }
public CustomEditMainImage(XmlDocument pagedata, List <ModuleParams> moduleparams, XmlNamespaceManager pagenamespaces) : base(pagedata, moduleparams, pagenamespaces) { Edit.Utilities.DataIO data = new Profiles.Edit.Utilities.DataIO(); SessionManagement sm = new SessionManagement(); this.XMLData = pagedata; propdata = new Profiles.Profile.Utilities.DataIO(); if (Request.QueryString["subject"] != null) { this.SubjectID = Convert.ToInt64(Request.QueryString["subject"]); } else if (base.GetRawQueryStringItem("subject") != null) { this.SubjectID = Convert.ToInt64(base.GetRawQueryStringItem("subject")); } else { Response.Redirect("~/search"); } this.PredicateURI = Request.QueryString["predicateuri"].Replace("!", "#"); this.PropertyListXML = propdata.GetPropertyList(this.BaseData, base.PresentationXML, PredicateURI, false, true, false); litBackLink.Text = "<a href='" + Root.Domain + "/edit/" + this.SubjectID.ToString() + "'>Edit Menu</a> > <b>" + PropertyListXML.SelectSingleNode("PropertyList/PropertyGroup/Property/@Label").Value + "</b>"; securityOptions.Subject = this.SubjectID; securityOptions.PredicateURI = PredicateURI; securityOptions.PrivacyCode = Convert.ToInt32(this.PropertyListXML.SelectSingleNode("PropertyList/PropertyGroup/Property/@ViewSecurityGroup").Value); securityOptions.SecurityGroups = new XmlDataDocument(); securityOptions.SecurityGroups.LoadXml(base.PresentationXML.DocumentElement.LastChild.OuterXml); securityOptions.BubbleClick += SecurityDisplayed; }
protected void gridEntities_RowDeleting(object sender, GridViewDeleteEventArgs e) { Edit.Utilities.DataIO data = new Profiles.Edit.Utilities.DataIO(); Int64 _object = Convert.ToInt64(data.GetStoreNode(gridEntities.DataKeys[e.RowIndex].Values[0].ToString())); data.DeleteTriple(this.SubjectID, this.PredicateID, _object); this.LoadEntityGrid(true); upnlEditSection.Update(); }
public EditObjectTypeProperty(XmlDocument pagedata, List<ModuleParams> moduleparams, XmlNamespaceManager pagenamespaces) : base(pagedata, moduleparams, pagenamespaces) { Edit.Utilities.DataIO data; SessionManagement sm = new SessionManagement(); Profiles.Profile.Utilities.DataIO propdata = new Profiles.Profile.Utilities.DataIO(); data = new Profiles.Edit.Utilities.DataIO(); if (Request.QueryString["subject"] != null) this.SubjectID = Convert.ToInt64(Request.QueryString["subject"]); else if (base.GetRawQueryStringItem("subject") != null) this.SubjectID = Convert.ToInt64(base.GetRawQueryStringItem("subject")); else Response.Redirect("~/search"); this.PredicateURI = Request.QueryString["predicateuri"].Replace("!", "#"); GetSubjectProfile(); this.PropertyListXML = propdata.GetPropertyList(this.BaseData, base.PresentationXML, PredicateURI, false, true, false); this.PropertyLabel = PropertyListXML.SelectSingleNode("PropertyList/PropertyGroup/Property/@Label").Value; litBackLink.Text = "<a href='" + Root.Domain + "/edit/" + this.SubjectID.ToString() + "'>Edit Menu</a> > <b>" + this.PropertyLabel + "</b>"; //Quick add for adding a note on the format of grant info when adding manually if (PropertyListXML.SelectSingleNode("PropertyList/PropertyGroup/@Label").Value == "Research") { litGrantNote1.Text = "Please use the following format when adding the grant information: "; litGrantNote2.Text = "Funding Agency: Agency Name - Title: Grant Title - Award Number: Grant ID Number - Total direct costs: $amount - Start Date: yyyy-mm-dd - End Date: yyyy-mm-dd <br /> Or for subaward:<br /> Subaward: Name of Pass-Through Institution - Funding Agency: Agency Name - Title: Grant Title - Award Number: Grant ID Number - Total direct costs: $amount - Start Date: yyyy-mm-dd - End Date: yyyy-mm-dd"; } //Quick fix to allow only Admin and Curators to edit Visibility privacy securityOptions.userRole = propdata.GetUserRole(sm.Session().SessionID); if (securityOptions.userRole == -40 || securityOptions.userRole == -50) { securityOptions.FindControl("imbSecurityOptions").Visible = true; securityOptions.FindControl("lbSecurityOptions").Visible = true; } else { securityOptions.FindControl("imbSecurityOptions").Visible = false; securityOptions.FindControl("lbSecurityOptions").Visible = false; } securityOptions.Subject = this.SubjectID; securityOptions.PredicateURI = PredicateURI; this.PredicateID = data.GetStoreNode(this.PredicateURI); securityOptions.PrivacyCode = Convert.ToInt32(this.PropertyListXML.SelectSingleNode("PropertyList/PropertyGroup/Property/@ViewSecurityGroup").Value); securityOptions.SecurityGroups = new XmlDataDocument(); securityOptions.SecurityGroups.LoadXml(base.PresentationXML.DocumentElement.LastChild.OuterXml); this._subject = Convert.ToInt64(Request.QueryString["subject"]); this._personId = data.GetPersonID(_subject); }
protected void ibDown_Click(object sender, EventArgs e) { Edit.Utilities.DataIO data = new Profiles.Edit.Utilities.DataIO(); gridEntities.EditIndex = -1; GridViewRow row = ((ImageButton)sender).Parent.Parent as GridViewRow; Int64 _object = Convert.ToInt64(data.GetStoreNode(gridEntities.DataKeys[row.RowIndex].Values[0].ToString())); data.MoveTripleUp(this.SubjectID, this.PredicateID, _object); this.LoadEntityGrid(true); upnlEditSection.Update(); }
private void SaveEntityByURI(string uri) { Int64 objectid = 0; Utilities.DataIO data = new Profiles.Edit.Utilities.DataIO(); objectid = data.GetStoreNode(uri.Trim()); Session["pnlAddBySearch.Visible"] = null; Session["pnlAddByURI.Visible"] = null; data.AddExistingEntity(SubjectID, PredicateID, objectid); this.LoadEntityGrid(true); }
protected void deleteOne_Onclick(object sender, EventArgs e) { ImageButton lb = (ImageButton)sender; string key = lb.CommandArgument; //string key = grdEditPublications.DataKeys[0].Value.ToString(); Utilities.DataIO data = new Profiles.Edit.Utilities.DataIO(); data.DeleteOnePublication(Convert.ToInt32(Session["ProfileUsername"]), key); this.Counter = 0; grdEditPublications.DataBind(); upnlEditSection.Update(); }
private void AddNewEntity() { Utilities.DataIO data = new Profiles.Edit.Utilities.DataIO(); string newentity = txtNewEntity.Text.Trim(); string entityclassuri = ddlAddNewPropertyList.SelectedValue.Trim(); Session["pnlAddBySearch.Visible"] = null; Session["pnlAddByURI.Visible"] = null; Int64 entityid = 0; entityid = data.AddNewEntity(newentity, entityclassuri); data.AddExistingEntity(this.SubjectID, this.PredicateID, entityid); this.LoadEntityGrid(true); }
private void UpdateVisibility() { Edit.Utilities.DataIO data = new Profiles.Edit.Utilities.DataIO(); int securitygroup = Convert.ToInt32(this.PropertyListXML.SelectSingleNode("PropertyList/PropertyGroup/Property/@ViewSecurityGroup").Value); data.UpdateSecuritySetting(this.SubjectID, data.GetStoreNode(this.PredicateURI), securitygroup); if (securitygroup >= -10 && securitygroup < 0) { data.UpdateSecuritySetting(this.SubjectID, data.GetStoreNode("http://vivoweb.org/ontology/core#email"), -20); } else { data.UpdateSecuritySetting(this.SubjectID, data.GetStoreNode("http://vivoweb.org/ontology/core#email"), securitygroup); } }
protected void btnDeleteAll_OnClick(object sender, EventArgs e) { // PRG: Double-check we're using the correct username variable here //myParameters.Add("@username", (string)Session["ProfileUsername"])); Utilities.DataIO data = new Profiles.Edit.Utilities.DataIO(); data.DeletePublications(_personId, true, true); this.Counter = 0; phAddPub.Visible = true; phAddPubMed.Visible = true; phAddCustom.Visible = true; phSecuritySettings.Visible = true; pnlDeletePubMed.Visible = false; btnImgDeletePub.ImageUrl = Root.Domain + "/Framework/images/icon_squareArrow.gif"; grdEditPublications.DataBind(); upnlEditSection.Update(); }
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); data.SaveImage(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(); }
public CustomEditAuthorInAuthorship(XmlDocument pagedata, List<ModuleParams> moduleparams, XmlNamespaceManager pagenamespaces) : base(pagedata, moduleparams, pagenamespaces) { SessionManagement sm = new SessionManagement(); Utilities.DataIO data = new Profiles.Edit.Utilities.DataIO(); this._subject = Convert.ToInt64(Request.QueryString["subject"]); this._predicateuri = Request.QueryString["predicateuri"].Replace("!", "#"); this._personId = data.GetPersonID(_subject); Session["NodeID"] = this._subject; Session["SessionID"] = sm.Session().SessionID; this.PropertyListXML = data.GetPropertyList(pagedata, base.PresentationXML, this._predicateuri, false, true, false); securityOptions.Subject = this._subject; securityOptions.PredicateURI = this._predicateuri; securityOptions.PrivacyCode = Convert.ToInt32(this.PropertyListXML.SelectSingleNode("PropertyList/PropertyGroup/Property/@ViewSecurityGroup").Value); securityOptions.SecurityGroups = new XmlDataDocument(); securityOptions.SecurityGroups.LoadXml(base.PresentationXML.DocumentElement.LastChild.OuterXml); }
private void ExecuteSearch(bool button) { Utilities.DataIO data = new Profiles.Edit.Utilities.DataIO(); if (drpDepartment.SelectedItem.Text != "--Select--") { this.Department = drpDepartment.SelectedItem.Value; } else { this.Department = string.Empty; } if (drpInstitution.SelectedItem.Text != "--Select--") { this.Institution = drpInstitution.SelectedItem.Value; } else { this.Institution = string.Empty; } this.Fname = txtFirstName.Text; this.Lname = txtLastName.Text; if (this.TotalPages == 0) { MyDataSet = data.SearchPeople(Lname, Fname, Institution, Department, isManagerPage, 0, 1000000); this.TotalRowCount = MyDataSet.Tables[0].Rows.Count; } gridSearchResults.DataSource = MyDataSet; gridSearchResults.DataBind(); pnlProxySearchResults.Visible = true; }
private void UpdateSecuritySetting(string securitygroup) { // maybe be able to make this more general purpose if (this.PredicateURI.StartsWith(Profiles.ORNG.Utilities.OpenSocialManager.ORNG_ONTOLOGY_PREFIX)) { Profiles.ORNG.Utilities.DataIO data = new Profiles.ORNG.Utilities.DataIO(); if ("0".Equals(securitygroup)) { data.RemovePersonalGadget(this.Subject, this.PredicateURI); } else { data.AddPersonalGadget(this.Subject, this.PredicateURI); } } else if (!"0".Equals(securitygroup)) { Edit.Utilities.DataIO data = new Profiles.Edit.Utilities.DataIO(); data.UpdateSecuritySetting(this.Subject, data.GetStoreNode(this.PredicateURI), Convert.ToInt32(securitygroup)); } //Framework.Utilities.Cache.AlterDependency(this.Subject.ToString()); }
public CustomEditAuthorInAuthorship(XmlDocument pagedata, List<ModuleParams> moduleparams, XmlNamespaceManager pagenamespaces) : base(pagedata, moduleparams, pagenamespaces) { SessionManagement sm = new SessionManagement(); Utilities.DataIO data = new Profiles.Edit.Utilities.DataIO(); propdata = new Profiles.Profile.Utilities.DataIO(); this._subject = Convert.ToInt64(Request.QueryString["subject"]); this._predicateuri = Request.QueryString["predicateuri"].Replace("!", "#"); this._personId = data.GetPersonID(_subject); Session["NodeID"] = this._subject; Session["SessionID"] = sm.Session().SessionID; this.PropertyListXML = propdata.GetPropertyList(pagedata, base.PresentationXML, this._predicateuri, false, true, false); //Quick fix to allow only Admin and Curators to edit Visibility privacy securityOptions.userRole = propdata.GetUserRole(sm.Session().SessionID); if (securityOptions.userRole == -40 || securityOptions.userRole == -50) { securityOptions.FindControl("imbSecurityOptions").Visible = true; securityOptions.FindControl("lbSecurityOptions").Visible = true; } else { securityOptions.FindControl("imbSecurityOptions").Visible = false; securityOptions.FindControl("lbSecurityOptions").Visible = false; } securityOptions.Subject = this._subject; securityOptions.PredicateURI = this._predicateuri; securityOptions.PrivacyCode = Convert.ToInt32(this.PropertyListXML.SelectSingleNode("PropertyList/PropertyGroup/Property/@ViewSecurityGroup").Value); securityOptions.SecurityGroups = new XmlDataDocument(); securityOptions.SecurityGroups.LoadXml(base.PresentationXML.DocumentElement.LastChild.OuterXml); securityOptions.BubbleClick += SecurityDisplayed; }
protected void grdEditPublications_SelectedIndexChanged(object sender, EventArgs e) { pnlAddPubById.Visible = false; pnlAddPubMed.Visible = false; pnlAddPubMedResults.Visible = false; pnlAddCustomPubMed.Visible = true; IDataReader reader = null; try { Utilities.DataIO data = new Profiles.Edit.Utilities.DataIO(); HiddenField hdn = (HiddenField)grdEditPublications.Rows[grdEditPublications.SelectedIndex].FindControl("hdnMPID"); reader = data.GetCustomPub(hdn.Value); if (reader.Read()) { drpPublicationType.SelectedValue = reader["hmspubcategory"].ToString(); txtPubMedAdditionalInfo.Text = reader["additionalinfo"].ToString(); txtPubMedAuthors.Text = reader["authors"].ToString(); if (reader["hmspubcategory"].ToString() == "Thesis") { txtPubMedNewsCity.Text = reader["placeofpub"].ToString(); } else { txtPubMedPublisherCity.Text = reader["placeofpub"].ToString(); } txtPubMedNewsColumn.Text = reader["newspapercol"].ToString(); txtPubMedConferenceDate.Text = reader["confdts"].ToString(); txtPubMedConferenceEdition.Text = reader["confeditors"].ToString(); txtPubMedConferenceName.Text = reader["confnm"].ToString(); txtPubMedPublisherContract.Text = reader["contractnum"].ToString(); if (reader["publicationdt"].ToString().Length > 0) { DateTime dt = (DateTime.Parse(reader["publicationdt"].ToString())); txtPubMedPublicationDate.Text = dt.ToShortDateString(); } txtPubMedEdition.Text = reader["edition"].ToString(); txtPubMedPublicationIssue.Text = reader["issuepub"].ToString(); txtPubMedConferenceLocation.Text = reader["confloc"].ToString(); txtPubMedPublisherName.Text = reader["publisher"].ToString(); txtPubMedOptionalWebsite.Text = reader["url"].ToString(); txtPubMedPublicationPages.Text = reader["paginationpub"].ToString(); txtPubMedPublisherReport.Text = reader["reptnumber"].ToString(); txtPubMedNewsSection.Text = reader["newspapersect"].ToString(); txtPubMedTitle.Text = reader["pubtitle"].ToString(); txtPubMedTitle2.Text = reader["articletitle"].ToString(); txtPubMedNewsUniversity.Text = reader["dissunivnm"].ToString(); txtPubMedPublicationVolume.Text = reader["volnum"].ToString(); txtPubMedAbstract.Text = reader["abstract"].ToString(); ShowCustomEdit(reader["hmspubcategory"].ToString()); upnlEditSection.Update(); } } catch (Exception ex) { string err = ex.Message; } finally { if (reader != null) { if (!reader.IsClosed) { reader.Close(); } } } }
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; } }
public void DrawProfilesModule() { Framework.Utilities.DataIO data = new Profiles.Framework.Utilities.DataIO(); if (Request.Form["hdnSelectedURI"] != string.Empty && Request.Form["hdnSelectedURI"] != null) { Edit.Utilities.DataIO editdata = new Profiles.Edit.Utilities.DataIO(); string newentity = string.Empty; newentity = Request.Form["hdnSelectedURI"].Trim(); Int64 _object = Convert.ToInt64(editdata.GetStoreNode(newentity)); editdata.AddExistingEntity(this.SubjectID, this.PredicateID, _object); Session["pnlAddBySearch.Visible"] = null; this.LoadEntityGrid(true); } else { LoadEntityGrid(false); } XmlDocument list = data.GetPropertyRangeList(this.PredicateURI); List<GenericListItem> propertylist = new List<GenericListItem>(); string space = string.Empty; foreach (XmlNode property in list.SelectNodes("PropertyRangeList/PropertyRange")) { for (int i = 0; i < Convert.ToInt16(property.SelectSingleNode("@Depth").Value); i++) { space += Server.HtmlDecode(" "); } //remove PI and Co-PI in drop down list when it's investigator, remove all other relationships besides "Advising Relationship" if (this.PropertyLabel == "investigator on" || this.PropertyLabel == "advisees") { if (property.SelectSingleNode("@Label").Value == "Investigator Role" || property.SelectSingleNode("@Label").Value == "Advising Relationship") { propertylist.Add(new GenericListItem(space + property.SelectSingleNode("@Label").Value, property.SelectSingleNode("@ClassURI").Value)); } } else { propertylist.Add(new GenericListItem(space + property.SelectSingleNode("@Label").Value, property.SelectSingleNode("@ClassURI").Value)); } space = string.Empty; } PropertyList = propertylist; if (ddlPropertyList.SelectedValue == string.Empty) { ddlPropertyList.DataSource = propertylist; ddlPropertyList.DataTextField = "Text"; ddlPropertyList.DataValueField = "Value"; ddlPropertyList.DataBind(); ddlPropertyList.Items.Insert(0, new ListItem("--- Select ---", "")); ddlPropertyList.SelectedValue = ""; ddlPropertyList.EnableViewState = true; } if (ddlAddNewPropertyList.SelectedValue == string.Empty) { ddlAddNewPropertyList.DataSource = propertylist; ddlAddNewPropertyList.DataTextField = "Text"; ddlAddNewPropertyList.DataValueField = "Value"; ddlAddNewPropertyList.DataBind(); ddlAddNewPropertyList.Items.Insert(0, new ListItem("--- Select ---", "")); ddlAddNewPropertyList.SelectedValue = ""; ddlAddNewPropertyList.EnableViewState = true; } }
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; } }
protected void ProcessUpload(object sender, AjaxControlToolkit.AsyncFileUploadEventArgs e) { try { 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); data.SaveImage(data.GetPersonID(this.SubjectID), imageBytes); base.GetSubjectProfile(); this.PropertyListXML = propdata.GetPropertyList(this.BaseData, base.PresentationXML, this.PredicateURI, false, true, false); this.DrawProfilesModule(); InitLinks(); pnlUpload.Visible = false; this.KillCache(); upnlEditSection.Update(); } catch (Exception ex) { Framework.Utilities.DebugLogging.Log(ex.Message + " " + ex.StackTrace); throw new Exception(ex.Message); } }
protected void deleteOne_Onclick(object sender, EventArgs e) { ImageButton lb = (ImageButton)sender; string key = lb.CommandArgument; //string key = grdEditPublications.DataKeys[0].Value.ToString(); Utilities.DataIO data = new Profiles.Edit.Utilities.DataIO(); data.DeleteOnePublication(Convert.ToInt32(Session["ProfileUsername"]), Convert.ToInt64(Session["NodeID"]), key, this.PropertyListXML); this.Counter = 0; grdEditPublications.DataBind(); upnlEditSection.Update(); }
protected void btnPubMedSaveCustom_OnClick(object sender, EventArgs e) { Hashtable myParameters = new Hashtable(); Utilities.DataIO data = new Profiles.Edit.Utilities.DataIO(); myParameters.Add("@HMS_PUB_CATEGORY", drpPublicationType.SelectedValue); myParameters.Add("@ADDITIONAL_INFO", txtPubMedAdditionalInfo.Text); myParameters.Add("@ABSTRACT", txtPubMedAbstract.Text); myParameters.Add("@AUTHORS", txtPubMedAuthors.Text); if (drpPublicationType.SelectedValue == "Thesis") { myParameters.Add("@PLACE_OF_PUB", txtPubMedNewsCity.Text); } else { myParameters.Add("@PLACE_OF_PUB", txtPubMedPublisherCity.Text); } myParameters.Add("@NEWSPAPER_COL", txtPubMedNewsColumn.Text); myParameters.Add("@CONF_DTS", txtPubMedConferenceDate.Text); myParameters.Add("@CONF_EDITORS", txtPubMedConferenceEdition.Text); myParameters.Add("@CONF_NM", txtPubMedConferenceName.Text); myParameters.Add("@CONTRACT_NUM", txtPubMedPublisherContract.Text); myParameters.Add("@PUBLICATION_DT", txtPubMedPublicationDate.Text); myParameters.Add("@EDITION", txtPubMedEdition.Text); myParameters.Add("@ISSUE_PUB", txtPubMedPublicationIssue.Text); myParameters.Add("@CONF_LOC", txtPubMedConferenceLocation.Text); myParameters.Add("@PUBLISHER", txtPubMedPublisherName.Text); myParameters.Add("@URL", txtPubMedOptionalWebsite.Text); myParameters.Add("@PAGINATION_PUB", txtPubMedPublicationPages.Text); myParameters.Add("@REPT_NUMBER", txtPubMedPublisherReport.Text); myParameters.Add("@NEWSPAPER_SECT", txtPubMedNewsSection.Text); myParameters.Add("@PUB_TITLE", txtPubMedTitle.Text); myParameters.Add("@ARTICLE_TITLE", txtPubMedTitle2.Text); myParameters.Add("@DISS_UNIV_NM", txtPubMedNewsUniversity.Text); myParameters.Add("@VOL_NUM", txtPubMedPublicationVolume.Text); if (grdEditPublications.SelectedIndex > -1) { //myParameters.Add("@username", Profile.UserId); myParameters.Add("@updated_by", _personId); HiddenField hdn = (HiddenField)grdEditPublications.Rows[grdEditPublications.SelectedIndex].FindControl("hdnMPID"); myParameters.Add("@mpid", hdn.Value); data.EditCustomPublication(myParameters, _subject, this.PropertyListXML); grdEditPublications.SelectedIndex = -1; } else { myParameters.Add("@PersonID", _personId); myParameters.Add("@created_by", _personId); data.AddCustomPublication(myParameters, _personId, _subject, this.PropertyListXML); } this.Counter = 0; grdEditPublications.DataBind(); ClearPubMedCustom(); LinkButton lb = (LinkButton)sender; if (lb.ID == "btnPubMedSaveCustom") { phAddPub.Visible = true; phAddPubMed.Visible = true; phDeletePub.Visible = true; phSecuritySettings.Visible = true; phMain.Visible = false; pnlAddCustomPubMed.Visible = false; btnImgAddCustom.ImageUrl = Root.Domain + "/Framework/images/icon_squareArrow.gif"; } Session["pnlAddCustomPubMed.Visible"] = null; upnlEditSection.Update(); }
protected void btnDeletePubMedOnly_OnClick(object sender, EventArgs e) { // PRG: Double-check we're using the correct username variable here //myParameters.Add("@username", (string)Session["ProfileUsername"])); Utilities.DataIO data = new Profiles.Edit.Utilities.DataIO(); data.DeletePublications(_personId, _subject, true, false); this.Counter = 0; phAddPub.Visible = true; phAddPubMed.Visible = true; phAddCustom.Visible = true; pnlDeletePubMed.Visible = false; phSecuritySettings.Visible = true; btnImgDeletePub.ImageUrl = Root.Domain + "/Framework/images/icon_squareArrow.gif"; grdEditPublications.DataBind(); upnlEditSection.Update(); }
private void UpdateSecuritySetting(string securitygroup) { // maybe be able to make this more general purpose if (this.PredicateURI.StartsWith(Profiles.ORNG.Utilities.OpenSocialManager.ORNG_ONTOLOGY_PREFIX)) { Profiles.ORNG.Utilities.DataIO dataORNG = new Profiles.ORNG.Utilities.DataIO(); if ("0".Equals(securitygroup)) { dataORNG.RemovePersonalGadget(this.Subject, this.PredicateURI); } else { dataORNG.AddPersonalGadget(this.Subject, this.PredicateURI); } } // else if (!"0".Equals(securitygroup)) // { Edit.Utilities.DataIO data = new Profiles.Edit.Utilities.DataIO(); data.UpdateSecuritySetting(this.Subject, data.GetStoreNode(this.PredicateURI), Convert.ToInt32(securitygroup)); // } Framework.Utilities.Cache.AlterDependency(this.Subject.ToString()); }
private void UpdateSecuritySetting(string securitygroup) { Edit.Utilities.DataIO data = new Profiles.Edit.Utilities.DataIO(); data.UpdateSecuritySetting(this.Subject, data.GetStoreNode(this.PredicateURI), Convert.ToInt32(securitygroup)); //Framework.Utilities.Cache.AlterDependency(this.Subject.ToString()); }
protected void gridEntities_RowDeleting(object sender, GridViewDeleteEventArgs e) { Edit.Utilities.DataIO data = new Profiles.Edit.Utilities.DataIO(); Int64 _object = Convert.ToInt64(data.GetStoreNode(gridEntities.DataKeys[e.RowIndex].Values[0].ToString())); // ULTIMATE HACK TO END ALL HACKS START if (this.PredicateID == 1445 || this.PredicateID == 1472) { long nodeIDOfGrantProfilePage = _object; string grantid = data.getGrantIDFromResearchRoleNodeID(nodeIDOfGrantProfilePage); if (grantid != " ") { data.DeleteOneGrant(Convert.ToInt32(Session["ProfileUsername"]), grantid); } else { data.DeleteTriple(this.SubjectID, this.PredicateID, _object); } } else { data.DeleteTriple(this.SubjectID, this.PredicateID, _object); } // ULTIMATE HACK TO END ALL HACKS END this.LoadEntityGrid(true); upnlEditSection.Update(); }
protected void ibUp_Click(object sender, EventArgs e) { Edit.Utilities.DataIO data = new Profiles.Edit.Utilities.DataIO(); gridEntities.EditIndex = -1; GridViewRow row = ((ImageButton)sender).Parent.Parent as GridViewRow; Int64 _object = Convert.ToInt64(data.GetStoreNode(gridEntities.DataKeys[row.RowIndex].Values[0].ToString())); data.MoveTripleDown(this.SubjectID, this.PredicateID, _object); this.LoadEntityGrid(true); upnlEditSection.Update(); }
//Inserts comma seperated string of PubMed Ids into the db private void InsertPubMedIds(string value) { string uri = "https://eutils.ncbi.nlm.nih.gov/entrez/eutils/efetch.fcgi?retmax=1000&db=pubmed&retmode=xml&id=" + value; System.Xml.XmlDocument myXml = new System.Xml.XmlDocument(); myXml.LoadXml(this.HttpPost(uri, "Catalyst", "text/plain")); XmlNodeList nodes = myXml.SelectNodes("PubmedArticleSet/PubmedArticle"); Utilities.DataIO data = new Profiles.Edit.Utilities.DataIO(); foreach (XmlNode node in nodes) { string pmid = node.SelectSingleNode("MedlineCitation/PMID").InnerText; if (!data.CheckPublicationExists(pmid)) // Insert or update the publication data.AddPublication(pmid, node.OuterXml); // Assign the user to the publication data.AddPublication(_personId, _subject, Convert.ToInt32(pmid), this.PropertyListXML); } data.UpdateEntityOnePerson(_personId); this.Counter = 0; Session["phAddPub.Visible"] = null; Session["pnlAddPubMed.Visible"] = null; Session["pnlAddCustomPubMed.Visible"] = null; Session["pnlDeletePubMed.Visible"] = null; }
private void UpdateSecuritySetting(string securitygroup) { Edit.Utilities.DataIO data = new Profiles.Edit.Utilities.DataIO(); data.UpdateSecuritySetting(this.Subject, data.GetStoreNode(this.PredicateURI), Convert.ToInt32(securitygroup)); }
protected void btnPubMedSaveCustom_OnClick(object sender, EventArgs e) { Hashtable myParameters = new Hashtable(); Utilities.DataIO data = new Profiles.Edit.Utilities.DataIO(); myParameters.Add("@HMS_PUB_CATEGORY", drpPublicationType.SelectedValue); myParameters.Add("@ADDITIONAL_INFO", txtPubMedAdditionalInfo.Text); myParameters.Add("@ABSTRACT", txtPubMedAbstract.Text); myParameters.Add("@AUTHORS", txtPubMedAuthors.Text); if (drpPublicationType.SelectedValue == "Thesis") { myParameters.Add("@PLACE_OF_PUB", txtPubMedNewsCity.Text); } else { myParameters.Add("@PLACE_OF_PUB", txtPubMedPublisherCity.Text); } myParameters.Add("@NEWSPAPER_COL", txtPubMedNewsColumn.Text); myParameters.Add("@CONF_DTS", txtPubMedConferenceDate.Text); myParameters.Add("@CONF_EDITORS", txtPubMedConferenceEdition.Text); myParameters.Add("@CONF_NM", txtPubMedConferenceName.Text); myParameters.Add("@CONTRACT_NUM", txtPubMedPublisherContract.Text); myParameters.Add("@PUBLICATION_DT", txtPubMedPublicationDate.Text); myParameters.Add("@EDITION", txtPubMedEdition.Text); myParameters.Add("@ISSUE_PUB", txtPubMedPublicationIssue.Text); myParameters.Add("@CONF_LOC", txtPubMedConferenceLocation.Text); myParameters.Add("@PUBLISHER", txtPubMedPublisherName.Text); myParameters.Add("@URL", txtPubMedOptionalWebsite.Text); myParameters.Add("@PAGINATION_PUB", txtPubMedPublicationPages.Text); myParameters.Add("@REPT_NUMBER", txtPubMedPublisherReport.Text); myParameters.Add("@NEWSPAPER_SECT", txtPubMedNewsSection.Text); myParameters.Add("@PUB_TITLE", txtPubMedTitle.Text); myParameters.Add("@ARTICLE_TITLE", txtPubMedTitle2.Text); myParameters.Add("@DISS_UNIV_NM", txtPubMedNewsUniversity.Text); myParameters.Add("@VOL_NUM", txtPubMedPublicationVolume.Text); if (grdEditPublications.SelectedIndex > -1) { //myParameters.Add("@username", Profile.UserId); myParameters.Add("@updated_by", _personId); HiddenField hdn = (HiddenField)grdEditPublications.Rows[grdEditPublications.SelectedIndex].FindControl("hdnMPID"); myParameters.Add("@mpid", hdn.Value); data.EditCustomPublication(myParameters); grdEditPublications.SelectedIndex = -1; } else { myParameters.Add("@PersonID", _personId); myParameters.Add("@created_by", _personId); data.AddCustomPublication(myParameters, _personId); } this.Counter = 0; grdEditPublications.DataBind(); ClearPubMedCustom(); LinkButton lb = (LinkButton)sender; if (lb.ID == "btnPubMedSaveCustom") { phAddPub.Visible = true; phAddPubMed.Visible = true; phDeletePub.Visible = true; phSecuritySettings.Visible = true; phMain.Visible = false; pnlAddCustomPubMed.Visible = false; btnImgAddCustom.ImageUrl = Root.Domain + "/Framework/images/icon_squareArrow.gif"; } Session["pnlAddCustomPubMed.Visible"] = null; upnlEditSection.Update(); }
public void DrawProfilesModule() { Framework.Utilities.DataIO data = new Profiles.Framework.Utilities.DataIO(); if (Request.Form["hdnSelectedURI"] != string.Empty && Request.Form["hdnSelectedURI"] != null) { Edit.Utilities.DataIO editdata = new Profiles.Edit.Utilities.DataIO(); string newentity = string.Empty; newentity = Request.Form["hdnSelectedURI"].Trim(); Int64 _object = Convert.ToInt64(editdata.GetStoreNode(newentity)); editdata.AddExistingEntity(this.SubjectID, this.PredicateID, _object); Session["pnlAddBySearch.Visible"] = null; this.LoadEntityGrid(true); } else { LoadEntityGrid(false); } XmlDocument list = data.GetPropertyRangeList(this.PredicateURI); List <GenericListItem> propertylist = new List <GenericListItem>(); string space = string.Empty; foreach (XmlNode property in list.SelectNodes("PropertyRangeList/PropertyRange")) { for (int i = 0; i < Convert.ToInt16(property.SelectSingleNode("@Depth").Value); i++) { space += Server.HtmlDecode(" "); } propertylist.Add(new GenericListItem(space + property.SelectSingleNode("@Label").Value, property.SelectSingleNode("@ClassURI").Value)); space = string.Empty; } PropertyList = propertylist; if (ddlPropertyList.SelectedValue == string.Empty) { ddlPropertyList.DataSource = propertylist; ddlPropertyList.DataTextField = "Text"; ddlPropertyList.DataValueField = "Value"; ddlPropertyList.DataBind(); ddlPropertyList.Items.Insert(0, new ListItem("--- Select ---", "")); ddlPropertyList.SelectedValue = ""; ddlPropertyList.EnableViewState = true; } if (ddlAddNewPropertyList.SelectedValue == string.Empty) { ddlAddNewPropertyList.DataSource = propertylist; ddlAddNewPropertyList.DataTextField = "Text"; ddlAddNewPropertyList.DataValueField = "Value"; ddlAddNewPropertyList.DataBind(); ddlAddNewPropertyList.Items.Insert(0, new ListItem("--- Select ---", "")); ddlAddNewPropertyList.SelectedValue = ""; ddlAddNewPropertyList.EnableViewState = true; } }
private void ExecuteSearch(bool button) { Utilities.DataIO data = new Profiles.Edit.Utilities.DataIO(); Int32 totalpageremainder = 0; if (drpDepartment.SelectedItem.Text != "--Select--") { this.Department = drpDepartment.SelectedItem.Value; } else { this.Department = string.Empty; } if (drpInstitution.SelectedItem.Text != "--Select--") { this.Institution = drpInstitution.SelectedItem.Value; } else { this.Institution = string.Empty; } this.Fname = txtFirstName.Text; this.Lname = txtLastName.Text; if (!button) { if (Request.QueryString["offset"] != null) { this.Offset = Convert.ToInt32(Request.QueryString["offset"]); } if (Request.QueryString["totalrows"] != null) { this.TotalRowCount = Convert.ToInt32(Request.QueryString["totalrows"]); } if (Request.QueryString["CurrentPage"] != null) { this.CurrentPage = Convert.ToInt32(Request.QueryString["CurrentPage"]); } if (Request.QueryString["TotalPages"] != null) { this.TotalPages = Convert.ToInt32(Request.QueryString["TotalPages"]); } } if (this.TotalPages == 0) { MyDataSet = data.SearchPeople(Lname, Fname, Institution, Department, 0, 1000000); this.TotalRowCount = MyDataSet.Tables[0].Rows.Count; } if (this.CurrentPage <= 0) { this.CurrentPage = 1; } this.TotalPages = Math.DivRem(this.TotalRowCount, 25, out totalpageremainder); if (totalpageremainder > 0) { this.TotalPages = this.TotalPages + 1; } if (this.CurrentPage > this.TotalPages) { this.CurrentPage = this.TotalPages; } this.Offset = ((Convert.ToInt32(this.CurrentPage) * 25) + 1) - 25; if (this.Offset < 0) { this.Offset = 0; } MyDataSet = data.SearchPeople(Lname, Fname, Institution, Department, this.Offset - 1, 100); gridSearchResults.PageIndex = 0; gridSearchResults.DataSource = MyDataSet; gridSearchResults.DataBind(); if (MyDataSet.Tables[0].Rows.Count > 0) { gridSearchResults.BottomPagerRow.Visible = true; } pnlProxySearchResults.Visible = true; litPagination.Text = "<script type='text/javascript'>" + "_page = " + this.CurrentPage + ";" + "_offset = " + this.Offset + ";" + "_totalrows = " + this.TotalRowCount + ";" + "_totalpages =" + this.TotalPages + ";" + "_root = '" + Root.Domain + "';" + "_subject = '" + Subject + "';" + "_fname = '" + this.Fname + "';" + "_lname = '" + this.Lname.Replace("'", "\\'") + "';" + "_department = '" + this.Department.Replace("'", "\\'") + "';" + "_institution = '" + this.Institution.Replace("'", "\\'") + "';" + "</script>"; //pnlProxySearchResults.Update(); }