protected void GridViewProperty_RowUpdating(object sender, GridViewUpdateEventArgs e) { // remove them all, then rebuild // put this in one spot string _objects = GridViewProperty.DataKeys[e.RowIndex].Values[0].ToString(); foreach (string _object in _objects.Split(new Char[] { ',' }, StringSplitOptions.RemoveEmptyEntries)) { data.DeleteTriple(this.SubjectID, this.PredicateID, Convert.ToInt64(_object)); } TextBox txtLabelGrid = (TextBox)GridViewProperty.Rows[e.RowIndex].FindControl("txtLabelGrid"); // this as well, put in one spot and remove subject, predicate from literalliststate if redundant // grab them all, separated by carriage return or commas or tab foreach (string item in txtLabelGrid.Text.Trim().Split(new Char[] { '\n', ',', '\t' })) { if (item.Trim().Length > 0) { data.AddLiteral(this.SubjectID, this.PredicateID, data.GetStoreNode(item.Trim())); } } GridViewProperty.EditIndex = -1; this.FillPropertyGrid(true); upnlEditSection.Update(); }
protected void btnInsert_OnClick(object sender, EventArgs e) { if (Session["pnlInsertProperty.Visible"] != null) { data.AddLiteral(this.SubjectID, this.PredicateID, data.GetStoreNode(txtLabel.Text.Trim()), this.PropertyListXML); this.FillPropertyGrid(true); txtLabel.Text = ""; Session["pnlInsertProperty.Visible"] = null; btnEditProperty_OnClick(sender, e); upnlEditSection.Update(); } }
protected void btnInsertClose_OnClick(object sender, EventArgs e) { if (Session["pnlInsertProperty.Visible"] != null) { if (txtLabel.Text.Trim().Length > 0) { data.AddLiteral(this.SubjectID, this.PredicateID, data.GetStoreNode(txtLabel.Text.Trim()), this.PropertyListXML); } this.FillPropertyGrid(true); Session["pnlInsertProperty.Visible"] = null; btnInsertCancel_OnClick(sender, e); } }
protected void Page_Load(object sender, EventArgs e) { try { if (!IsPostBack) { Profiles.ORCID.Utilities.ProfilesRNSDLL.BO.ORCID.Person person = GetPerson(); LoadPageLabels(person); if (AssociateORCIDWithOrganizationID(person, Profiles.ORCID.Utilities.ProfilesRNSDLL.BLL.ORCID.OAuth.GetORCID(OAuthCode, "ProvideORCIDConfirmation.aspx", LoggedInInternalUsername))) { pSuccess.Visible = true; LoadPageLabels(person); } else { pSuccess.Visible = false; lblErrors.Text = "An error occurred while associating your ORCID with your local identifier"; } Int64 subjectID = new Profiles.ORCID.Utilities.ProfilesRNSDLL.BLL.Profile.Data.Person().GetNodeId(person.InternalUsername); Edit.Utilities.DataIO data = new Edit.Utilities.DataIO(); data.AddLiteral(subjectID, data.GetStoreNode("http://vivoweb.org/ontology/core#orcidId"), data.GetStoreNode(person.ORCID), this.PropertyListXML); pHasProfile.Visible = !subjectID.Equals(0); hlProfile.NavigateUrl = "~/display/" + subjectID.ToString(); hlEdit.NavigateUrl = Root.Domain + "/edit/default.aspx?subject=" + subjectID.ToString() + "&predicateuri=http://vivoweb.org/ontology/core!orcidId&module=DisplayItemToEdit&ObjectType=Literal"; } } catch (Exception ex) { LogException(ex); } }
protected void btnCreateORCIDs_Click(object sender, EventArgs e) { Profiles.Framework.Utilities.DataIO data = new Profiles.Framework.Utilities.DataIO(); if (data.GetSessionSecurityGroup() != -50) { this.AddError("Only Administrators can push records to ORCID"); } else { foreach (RepeaterItem ri in this.rptSearchResults.Items) { switch (ri.ItemType) { case ListItemType.Item: case ListItemType.AlternatingItem: CheckBox chkSelected = (CheckBox)ri.FindControl("chkSelected"); if (chkSelected.Checked) { Label lblPersonID = (Label)ri.FindControl("lblPersonID"); Label lblErrors = (Label)ri.FindControl("lblErrors"); Label lblMessages = (Label)ri.FindControl("lblMessages"); try { Profiles.ORCID.Utilities.ProfilesRNSDLL.BO.ORCID.Person bo = new Profiles.ORCID.Utilities.ProfilesRNSDLL.BLL.ORCID.Person().GetPersonWithDBData(int.Parse(lblPersonID.Text), sm.Session().SessionID); if (!bo.BiographyIsNull && !bo.Biography.Equals(string.Empty)) { bo.PushBiographyToORCID = true; } //System.Threading.Thread.Sleep(2000); if (new Profiles.ORCID.Utilities.ProfilesRNSDLL.BLL.ORCID.Person().CreateNewORCID(bo, LoggedInInternalUsername, Profiles.ORCID.Utilities.ProfilesRNSDLL.BO.ORCID.REFPersonStatusType.REFPersonStatusTypes.User_Push_Failed)) { Edit.Utilities.DataIO dataio = new Edit.Utilities.DataIO(); long subjectID = Profiles.ORCID.Utilities.DataIO.getNodeIdFromPersonID(int.Parse(lblPersonID.Text)); dataio.AddLiteral(subjectID, dataio.GetStoreNode("http://vivoweb.org/ontology/core#orcidId"), dataio.GetStoreNode(bo.ORCID), this.PropertyListXML); lblMessages.Text = "Success"; } else { lblErrors.Text = bo.Error + bo.AllErrors + "<br /><br />"; } } catch (Exception ex) { // todo remove lblErrors.Text = ex.Message; //this.lblErrors.Text = "An error occurred while creating the ORCID."; } } break; } } } }
protected void btnNewORCID_Click(object sender, EventArgs e) { try { long subjectID = Convert.ToInt32(Request.QueryString["subject"]); int profilePersonID = new Profiles.Edit.Utilities.DataIO().GetPersonID(subjectID); Utilities.ProfilesRNSDLL.BLL.ORCID.Person personBLL = new Utilities.ProfilesRNSDLL.BLL.ORCID.Person(); Utilities.ProfilesRNSDLL.BO.ORCID.Person bo = personBLL.GetByPersonID(profilePersonID); if (chkUploadInfoNow.Checked) { bo = UploadInfoToORCID1.GetPersonWithPageData(bo); } GetPageControlValues(bo); if (Profiles.ORCID.Utilities.config.RequireAcknowledgement) { bo.AgreementAcknowledged = true; } if (new Profiles.ORCID.Utilities.ProfilesRNSDLL.BLL.ORCID.Person().CreateNewORCID(bo, LoggedInInternalUsername, Profiles.ORCID.Utilities.ProfilesRNSDLL.BO.ORCID.REFPersonStatusType.REFPersonStatusTypes.User_Push_Failed)) { Edit.Utilities.DataIO data = new Edit.Utilities.DataIO(); data.AddLiteral(subjectID, data.GetStoreNode("http://vivoweb.org/ontology/core#orcidId"), data.GetStoreNode(bo.ORCID), this.PropertyListXML); bool isProxy = Profiles.ORCID.Utilities.DataIO.getNodeIdFromInternalUserName(LoggedInInternalUsername) != subjectID; Response.Redirect("~/ORCID/CreationConfirmation.aspx?UserORCID=" + bo.ORCID + "&Proxy=" + isProxy, false); return; } else { this.lblErrorsCreate.Text = bo.Error + bo.AllErrors + "<br /><br />"; GetErrorsAndMessages(bo); } } catch (Exception ex) { lblErrorsCreate.Text = ex.Message; LogException(ex); } }
protected void btnNewORCID_Click(object sender, EventArgs e) { try { long subjectID = Convert.ToInt32(Request.QueryString["subject"]); int profilePersonID = new Profiles.Edit.Utilities.DataIO().GetPersonID(subjectID); Utilities.ProfilesRNSDLL.BLL.ORCID.Person personBLL = new Utilities.ProfilesRNSDLL.BLL.ORCID.Person(); Utilities.ProfilesRNSDLL.BO.ORCID.Person bo = personBLL.GetByPersonID(profilePersonID); if (chkUploadInfoNow.Checked) { bo = UploadInfoToORCID1.GetPersonWithPageData(bo); } GetPageControlValues(bo); if (Profiles.ORCID.Utilities.config.RequireAcknowledgement) { bo.AgreementAcknowledged = true; } if (new Profiles.ORCID.Utilities.ProfilesRNSDLL.BLL.ORCID.Person().CreateNewORCID(bo, LoggedInInternalUsername, Profiles.ORCID.Utilities.ProfilesRNSDLL.BO.ORCID.REFPersonStatusType.REFPersonStatusTypes.User_Push_Failed)) { Edit.Utilities.DataIO data = new Edit.Utilities.DataIO(); data.AddLiteral(subjectID, data.GetStoreNode("http://vivoweb.org/ontology/core#orcidId"), data.GetStoreNode(bo.ORCID)); Response.Redirect("~/ORCID/CreationConfirmation.aspx?UserORCID=" + bo.ORCID, false); return; } else { this.lblErrorsCreate.Text = bo.Error + bo.AllErrors + "<br /><br />"; GetErrorsAndMessages(bo); } } catch (Exception ex) { lblErrorsCreate.Text = ex.Message; LogException(ex); } }