public CustomEditGroupMemberOf(XmlDocument pagedata, List <ModuleParams> moduleparams, XmlNamespaceManager pagenamespaces)
            : base(pagedata, moduleparams, pagenamespaces)
        {
            this.XMLData = pagedata;

            data     = new Edit.Utilities.DataIO();
            propdata = new Profiles.Profile.Utilities.DataIO();

            string predicateuri = Request.QueryString["predicateuri"].Replace("!", "#");

            this.PropertyListXML = propdata.GetPropertyList(this.BaseData, base.PresentationXML, predicateuri, false, true, false);
            if (Request.QueryString["subject"] != null)
            {
                this.SubjectID = Convert.ToInt64(Request.QueryString["subject"]);
            }
            else
            {
                Response.Redirect(Root.Domain + "/search");
            }

            securityOptions.Subject        = this.SubjectID;
            securityOptions.PredicateURI   = predicateuri;
            securityOptions.PrivacyCode    = Convert.ToInt32(this.PropertyListXML.SelectSingleNode("PropertyList/PropertyGroup/Property/@ViewSecurityGroup").Value);
            securityOptions.SecurityGroups = new XmlDocument();
            securityOptions.SecurityGroups.LoadXml(base.PresentationXML.DocumentElement.LastChild.OuterXml);
        }
示例#2
0
        protected void FillResearchGrid(bool refresh)
        {
            Edit.Utilities.DataIO data = new Edit.Utilities.DataIO();

            //Need RDF data for the links.

            List <Profiles.Edit.Utilities.FundingState> fundingstate = data.GetFunding(data.GetPersonID(this.SubjectID));

            if (fundingstate.Count > 0)
            {
                System.Text.StringBuilder sb = new System.Text.StringBuilder();
                int last = 0;

                sb.Append("<div class='basicInfo'><table width='590px' border='0' cellpadding='5px' cellspacing='3px'>");
                foreach (Profiles.Edit.Utilities.FundingState fs in fundingstate)
                {
                    last += 1;
                    AddRow(fs, ref sb);
                    if (last < fundingstate.Count)
                    {
                        AddLine(ref sb);
                    }
                }
                sb.Append("</table></div>");
                litHTML.Text = sb.ToString();
            }
        }
        public EditDataTypeProperty(XmlDocument pagedata, List<ModuleParams> moduleparams, XmlNamespaceManager pagenamespaces)
            : base(pagedata, moduleparams, pagenamespaces)
        {
            SessionManagement sm = new SessionManagement();

            data = new Edit.Utilities.DataIO();

            string predicateuri = Request.QueryString["predicateuri"].Replace("!", "#");
            this.PropertyListXML = data.GetPropertyList(this.BaseData, base.PresentationXML, predicateuri, false, true, false);
            PropertyLabel = this.PropertyListXML.SelectSingleNode("PropertyList/PropertyGroup/Property/@Label").Value;

            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");

            litBackLink.Text = "<a href='" + Root.Domain + "/edit/" + this.SubjectID + "'>Edit Menu</a> &gt; <b>" + PropertyListXML.SelectSingleNode("PropertyList/PropertyGroup/Property/@Label").Value + "</b>";

            btnEditProperty.Text = "Add " + PropertyLabel;

            this.PropertyListXML = data.GetPropertyList(this.BaseData, base.PresentationXML, predicateuri, false, true, false);

            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);
        }
        public void fillManagerGrid()
        {
            pnlGridViewManagers.Visible = true;
            List <GroupMemberState> groupManagerState = new List <GroupMemberState>();

            Edit.Utilities.DataIO data   = new Edit.Utilities.DataIO();
            SqlDataReader         reader = data.GetGroupManagers(SubjectID);

            while (reader.Read())
            {
                //public Group(string GroupName, int ViewSecurityGroup, string ViewSecurityGroupName, string EndDate, string GroupID, string GroupNodeID)
                groupManagerState.Add(new GroupMemberState(reader.GetInt32(reader.GetOrdinal("UserID")), "", "",
                                                           reader["DisplayName"].ToString(), reader["Institution"].ToString()));
            }
            reader.Close();

            if (groupManagerState.Count > 0)
            {
                GridViewManagers.DataSource = groupManagerState;
                GridViewManagers.DataBind();
            }
            else
            {
                lblNoManagers.Visible    = true;
                GridViewManagers.Visible = false;
            }
        }
        protected void gvSearchResults_RowAdd(object sender, EventArgs e)
        {
            Edit.Utilities.DataIO data = new Edit.Utilities.DataIO();

            foreach (GridViewRow row in gridSearchResults.Rows)
            {
                CheckBox cb = (CheckBox)row.FindControl("chkPubMed");
                if (cb.Checked)
                {
                    int userID   = Convert.ToInt32(gridSearchResults.DataKeys[row.RowIndex].Values[0].ToString());
                    int personID = Convert.ToInt32(gridSearchResults.DataKeys[row.RowIndex].Values[1].ToString());
                    if (isManagerPage)
                    {
                        data.AddGroupManager(userID, Subject);
                    }
                    else
                    {
                        data.AddGroupMember(userID, personID, Subject);
                    }
                }
            }
            btnAddGroupMembers_OnClick(sender, e);
            if (isManagerPage)
            {
                Response.Redirect(Root.Domain + "/edit/default.aspx?subject=" + Request.QueryString["subject"] + "&predicateuri=http://profiles.catalyst.harvard.edu/ontology/prns!hasGroupManager&module=DisplayItemToEdit&ObjectType=Entity");
            }
            else
            {
                Response.Redirect(Root.Domain + "/edit/default.aspx?subject=" + Request.QueryString["subject"] + "&predicateuri=http%3a%2f%2fvivoweb.org%2fontology%2fcore!contributingRole&module=DisplayItemToEdit&ObjectType=Entity");
            }
        }
        protected void FillResearchGrid(bool refresh)
        {
            Edit.Utilities.DataIO data = new Edit.Utilities.DataIO();

            //Need RDF data for the links.

            List<Profiles.Edit.Utilities.FundingState> fundingstate = data.GetFunding(data.GetPersonID(this.SubjectID));
            if (fundingstate.Count > 0)
            {

                System.Text.StringBuilder sb = new System.Text.StringBuilder();
                int last = 0;

                sb.Append("<div class='basicInfo'><table width='590px' border='0' cellpadding='5px' cellspacing='3px'>");
                foreach (Profiles.Edit.Utilities.FundingState fs in fundingstate)
                {
                    last += 1;
                    AddRow(fs, ref sb);
                    if (last < fundingstate.Count)
                        AddLine(ref sb);
                }
                sb.Append("</table></div>");
                litHTML.Text = sb.ToString();
            }
        }
        public CustomEditMailingAddress(XmlDocument pagedata, List<ModuleParams> moduleparams, XmlNamespaceManager pagenamespaces)
            : base(pagedata, moduleparams, pagenamespaces)
        {
            SessionManagement sm = new SessionManagement();
            base.BaseData  = pagedata;

            data = new 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");

            string predicateuri = Request.QueryString["predicateuri"].Replace("!", "#");
            this.PropertyListXML = data.GetPropertyList(this.BaseData, base.PresentationXML, predicateuri, false, true, false);
            litBackLink.Text = "<a href='" + Root.Domain + "/edit/" + this.SubjectID.ToString() + "'>Edit Menu</a> &gt; <b>" + PropertyListXML.SelectSingleNode("PropertyList/PropertyGroup/Property/@Label").Value + "</b>";

            //create a new network triple request.
            base.RDFTriple = new RDFTriple(this.SubjectID, data.GetStoreNode(predicateuri));

            base.RDFTriple.Expand = true;
            base.RDFTriple.ShowDetails = true;
            base.GetDataByURI();//This will reset the data to a Network.

            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);
        }
        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);
            }
        }
示例#9
0
        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);
            }
        }
        public CustomEditFreetextKeyword(XmlDocument pagedata, List<ModuleParams> moduleparams, XmlNamespaceManager pagenamespaces)
            : base(pagedata, moduleparams, pagenamespaces)
        {
            SessionManagement sm = new SessionManagement();
            propdata = new Profiles.Profile.Utilities.DataIO();
            data = new Profiles.Edit.Utilities.DataIO();
            string predicateuri = Request.QueryString["predicateuri"].Replace("!", "#");
            this.PropertyListXML = propdata.GetPropertyList(this.BaseData, base.PresentationXML, predicateuri, false, true, false);
            PropertyLabel = this.PropertyListXML.SelectSingleNode("PropertyList/PropertyGroup/Property/@Label").Value;

            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");

            litBackLink.Text = "<a href='" + Root.Domain + "/edit/" + this.SubjectID + "'>Edit Menu</a> &gt; <b>" + PropertyListXML.SelectSingleNode("PropertyList/PropertyGroup/Property/@Label").Value + "</b>";

            //btnEditProperty.Text = "Add " + PropertyLabel;
            imbAddArror.Visible = true;

            this.PropertyListXML = propdata.GetPropertyList(this.BaseData, base.PresentationXML, predicateuri, false, true, false);
            this.MaxCardinality = this.PropertyListXML.SelectSingleNode("PropertyList/PropertyGroup/Property/@MaxCardinality").Value;
            this.MinCardinality = this.PropertyListXML.SelectSingleNode("PropertyList/PropertyGroup/Property/@MinCardinality").Value;

            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);

            txtLabel.Attributes.Add("data-autocomplete-url", Root.Domain + "/edit/Modules/CustomEditFreetextKeyword/keywordAutocomplete.aspx?keys=");
        }
        protected void GridViewMembers_RowDeleting(object sender, GridViewDeleteEventArgs e)
        {
            Edit.Utilities.DataIO data = new Edit.Utilities.DataIO();
            int userID = Convert.ToInt32(GridViewMembers.DataKeys[e.RowIndex].Values[0].ToString());

            data.DeleteGroupMember(userID, Subject);
            fillMemberGrid();
        }
        public CustomEditAwardOrHonor(XmlDocument pagedata, List <ModuleParams> moduleparams, XmlNamespaceManager pagenamespaces)
            : base(pagedata, moduleparams, pagenamespaces)
        {
            SessionManagement sm = new SessionManagement();

            this.XMLData = pagedata;

            data = new Edit.Utilities.DataIO();
            Profiles.Profile.Utilities.DataIO 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");
            }

            string predicateuri = Request.QueryString["predicateuri"].Replace("!", "#");

            this.PropertyListXML = propdata.GetPropertyList(this.BaseData, base.PresentationXML, predicateuri, false, true, false);

            this.PredicateID = data.GetStoreNode(predicateuri);

            base.GetNetworkProfile(this.SubjectID, this.PredicateID);

            litBackLink.Text = "<a href='" + Root.Domain + "/edit/" + this.SubjectID.ToString() + "'>Edit Menu</a> &gt; <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);

            if (Request.QueryString["new"] != null && Session["new"] != null)
            {
                Session["pnlInsertAward.Visible"] = null;
                Session["new"] = null;

                if (Session["newclose"] != null)
                {
                    Session["newclose"] = null;
                    btnInsertCancel_OnClick(this, new EventArgs());
                }
                else
                {
                    btnEditAwards_OnClick(this, new EventArgs());
                }
            }

            securityOptions.BubbleClick += SecurityDisplayed;
        }
示例#13
0
        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 GridViewMembers_RowUpdating(object sender, GridViewUpdateEventArgs e)
        {
            Edit.Utilities.DataIO data = new Edit.Utilities.DataIO();
            int     userID             = Convert.ToInt32(GridViewMembers.DataKeys[e.RowIndex].Values[0].ToString());
            TextBox txtTitle           = (TextBox)GridViewMembers.Rows[e.RowIndex].FindControl("txtMemberTitle");
            string  title = txtTitle.Text;

            data.UpdateGroupMember(userID, Subject, title);
            GridViewMembers.EditIndex = -1;
            fillMemberGrid();
        }
        public EditDataTypeProperty(XmlDocument pagedata, List<ModuleParams> moduleparams, XmlNamespaceManager pagenamespaces)
            : base(pagedata, moduleparams, pagenamespaces)
        {
            SessionManagement sm = new SessionManagement();
            propdata = new Profiles.Profile.Utilities.DataIO();
            data = new Profiles.Edit.Utilities.DataIO();
            string predicateuri = Request.QueryString["predicateuri"].Replace("!", "#");
            this.PropertyListXML = propdata.GetPropertyList(this.BaseData, base.PresentationXML, predicateuri, false, true, false);
            PropertyLabel = this.PropertyListXML.SelectSingleNode("PropertyList/PropertyGroup/Property/@Label").Value;

            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");

            litBackLink.Text = "<a href='" + Root.Domain + "/edit/" + this.SubjectID + "'>Edit Menu</a> &gt; <b>" + PropertyListXML.SelectSingleNode("PropertyList/PropertyGroup/Property/@Label").Value + "</b>";

            btnEditProperty.Text = "Add " + PropertyLabel;

            this.PropertyListXML = propdata.GetPropertyList(this.BaseData, base.PresentationXML, predicateuri, false, true, false);
            // Put hack to not insert null MaxCardinality Value
            if (this.PropertyListXML.SelectSingleNode("PropertyList/PropertyGroup/Property/@MaxCardinality") == null)
            {
                this.MaxCardinality = "1";
            }
            else
            {
                this.MaxCardinality = this.PropertyListXML.SelectSingleNode("PropertyList/PropertyGroup/Property/@MaxCardinality").Value;
            }

            this.MinCardinality = this.PropertyListXML.SelectSingleNode("PropertyList/PropertyGroup/Property/@MinCardinality").Value;

            //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;
            securityOptions.PrivacyCode = Convert.ToInt32(this.PropertyListXML.SelectSingleNode("PropertyList/PropertyGroup/Property/@ViewSecurityGroup").Value);
            securityOptions.SecurityGroups = new XmlDataDocument();
            securityOptions.SecurityGroups.LoadXml(base.PresentationXML.DocumentElement.LastChild.OuterXml);
        }
        protected void cmdSaveByURIConfirm_onclick(object sender, ImageClickEventArgs e)
        {
            Edit.Utilities.DataIO data = new Edit.Utilities.DataIO();

            //   data.AddNewEntity("", this.PredicateURI);

            // Cant get the lable to match the URI.


            SaveEntityByURI(hdnURI.Value.Trim());
            ShowAllPanels();
            this.LoadEntityGrid(true);
        }
        public CustomEditAwardOrHonor(XmlDocument pagedata, List<ModuleParams> moduleparams, XmlNamespaceManager pagenamespaces)
            : base(pagedata, moduleparams, pagenamespaces)
        {
            SessionManagement sm = new SessionManagement();
            this.XMLData = pagedata;

            data = new Edit.Utilities.DataIO();
            Profiles.Profile.Utilities.DataIO 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");

            string predicateuri = Request.QueryString["predicateuri"].Replace("!", "#");
            this.PropertyListXML = propdata.GetPropertyList(this.BaseData, base.PresentationXML, predicateuri, false, true, false);

            this.PredicateID = data.GetStoreNode(predicateuri);

            base.GetNetworkProfile(this.SubjectID, this.PredicateID);

            litBackLink.Text = "<a href='" + Root.Domain + "/edit/" + this.SubjectID.ToString() + "'>Edit Menu</a> &gt; <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);

            if (Request.QueryString["new"] != null && Session["new"] != null)
            {
                Session["pnlInsertAward.Visible"] = null;
                Session["new"] = null;

                if (Session["newclose"] != null)
                {
                    Session["newclose"] = null;
                    btnInsertCancel_OnClick(this,new EventArgs());

                }
                else
                {
                    btnEditAwards_OnClick(this, new EventArgs());
                }

            }

            securityOptions.BubbleClick += SecurityDisplayed;
        }
        public CustomEditEmail(XmlDocument pagedata, List<ModuleParams> moduleparams, XmlNamespaceManager pagenamespaces)
            : base(pagedata, moduleparams, pagenamespaces)
        {
            SessionManagement sm = new SessionManagement();
            base.BaseData = pagedata;

            data = new Profiles.Edit.Utilities.DataIO();
            this.Email = base.BaseData.SelectSingleNode("rdf:RDF/rdf:Description/vivo:email", base.Namespaces).InnerText;

            Profiles.Profile.Utilities.DataIO 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, this.PredicateURI, false, true, false);
            litBackLink.Text = "<a href='" + Root.Domain + "/edit/" + this.SubjectID.ToString() + "'>Edit Menu</a> &gt; <b>" + PropertyListXML.SelectSingleNode("PropertyList/PropertyGroup/Property/@Label").Value + "</b>";

            //create a new network triple request.
            base.RDFTriple = new RDFTriple(this.SubjectID, data.GetStoreNode(this.PredicateURI));

            base.RDFTriple.Expand = true;
            base.RDFTriple.ShowDetails = true;
            base.GetDataByURI();//This will reset the data to a Network.

            //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 = 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);
        }
示例#19
0
        public CustomEditEagleI(XmlDocument pagedata, List <ModuleParams> moduleparams, XmlNamespaceManager pagenamespaces)
            : base(pagedata, moduleparams, pagenamespaces)
        {
            SessionManagement sm = new SessionManagement();

            base.BaseData = pagedata;

            Profiles.Profile.Utilities.DataIO propdata = new Profiles.Profile.Utilities.DataIO();
            data = new 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");
            }

            string 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> &gt; <b>" + PropertyListXML.SelectSingleNode("PropertyList/PropertyGroup/Property/@Label").Value + "</b>";


            //create a new network triple request.
            base.RDFTriple = new RDFTriple(this.SubjectID, data.GetStoreNode(predicateuri));

            base.RDFTriple.Expand      = true;
            base.RDFTriple.ShowDetails = true;
            base.GetDataByURI();//This will reset the data to a Network.



            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);
        }
        public CustomEditGroupSettings(XmlDocument pagedata, List <ModuleParams> moduleparams, XmlNamespaceManager pagenamespaces)
            : base(pagedata, moduleparams, pagenamespaces)
        {
            SessionManagement sm = new SessionManagement();

            data     = new Profiles.Edit.Utilities.DataIO();
            propdata = new Profiles.Profile.Utilities.DataIO();
            string predicateuri = Request.QueryString["predicateuri"].Replace("!", "#");

            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");
            }

            litBackLink.Text = "<a href='" + Root.Domain + "/edit/" + this.SubjectID + "'>Edit Menu</a> &gt; <b>Group Settings</b>";

            //btnEditProperty.Text = "Add " + PropertyLabel;
            imbAddArror.Visible = true;

            SqlDataReader reader = data.GetGroup(SubjectID);

            reader.Read();
            securityOptions.PrivacyCode = Convert.ToInt32(reader["ViewSecurityGroup"].ToString());
            reader.Close();

            //this.PropertyListXML = propdata.GetPropertyList(this.BaseData, base.PresentationXML, predicateuri, false, true, false);

            //this.PropertyListXML = propdata.GetPropertyList(this.BaseData, base.PresentationXML, predicateuri, false, true, false);
            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);

            //txtLabel.Attributes.Add("data-autocomplete-url", Root.Domain + "/edit/Modules/CustomEditFreetextKeyword/keywordAutocomplete.aspx?keys=");
        }
示例#21
0
        protected void Page_Load(object sender, EventArgs e)
        {
            if (IsPostBack)
            {
                if (PubMedResults.Tables.Count > 0)
                {
                    grdPubMedSearchResults.DataSource = PubMedResults;
                    grdPubMedSearchResults.DataBind();
                }
            }
            else
            {
                Session["phAddPub.Visible"]           = null;
                Session["pnlAddPubMed.Visible"]       = null;
                Session["pnlAddCustomPubMed.Visible"] = null;
                Session["pnlDeletePubMed.Visible"]    = null;
            }



            // a flag to inform the ucProfileBaseInfo that it is edit page
            Session["ProfileEdit"] = "true";

            Session["ProfileUsername"] = _personId;

            if (_personId == 0)
            {
                if (Session["CurrentPersonEditing"] != null)
                {
                    _personId = System.Convert.ToInt32(Session["CurrentPersonEditing"]);
                }
            }
            else
            {
                Session["CurrentPersonEditing"] = _personId;
            }

            Edit.Utilities.DataIO data;
            data = new Edit.Utilities.DataIO();
            string predicateuri = Request.QueryString["predicateuri"].Replace("!", "#");

            this.PropertyListXML = propdata.GetPropertyList(this.BaseData, base.PresentationXML, predicateuri, false, true, false);
            litBackLink.Text     = "<a href='" + Root.Domain + "/edit/" + _subject + "'>Edit Menu</a>" + " &gt; <b>" + PropertyListXML.SelectSingleNode("PropertyList/PropertyGroup/Property/@Label").Value + "</b>";
        }
        public CustomEditGroupSettings(XmlDocument pagedata, List <ModuleParams> moduleparams, XmlNamespaceManager pagenamespaces)
            : base(pagedata, moduleparams, pagenamespaces)
        {
            SessionManagement sm = new SessionManagement();

            data     = new Profiles.Edit.Utilities.DataIO();
            propdata = new Profiles.Profile.Utilities.DataIO();
            string predicateuri = Request.QueryString["predicateuri"].Replace("!", "#");

            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");
            }

            litBackLink.Text = "<a href='" + Root.Domain + "/edit/default.aspx?subject=" + this.SubjectID + "'>Edit Menu</a> &gt; <b>Group Settings</b>";


            imbAddArror.Visible = true;

            SqlDataReader reader = data.GetGroup(SubjectID);

            reader.Read();
            securityOptions.PrivacyCode = Convert.ToInt32(reader["ViewSecurityGroup"].ToString());
            reader.Close();


            securityOptions.Subject      = this.SubjectID;
            securityOptions.PredicateURI = predicateuri;

            securityOptions.SecurityGroups = new XmlDocument();
            securityOptions.SecurityGroups.LoadXml(base.PresentationXML.DocumentElement.LastChild.OuterXml);

            securityOptions.BubbleClick += SecurityDisplayed;
        }
        public EditVisibilityOnly(XmlDocument pagedata, List<ModuleParams> moduleparams, XmlNamespaceManager pagenamespaces)
            : base(pagedata, moduleparams, pagenamespaces)
        {
            this.XMLData = pagedata;

            data = new Edit.Utilities.DataIO();

            string predicateuri = Request.QueryString["predicateuri"].Replace("!", "#");
            this.PropertyListXML = data.GetPropertyList(this.BaseData, base.PresentationXML, predicateuri, false, true, false);
            if (Request.QueryString["subject"] != null)
                this.SubjectID = Convert.ToInt64(Request.QueryString["subject"]);
            else
                Response.Redirect(Root.Domain + "/search");

            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);
        }
示例#24
0
        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);
            }
        }
示例#25
0
        public EditDataTypeProperty(XmlDocument pagedata, List <ModuleParams> moduleparams, XmlNamespaceManager pagenamespaces)
            : base(pagedata, moduleparams, pagenamespaces)
        {
            SessionManagement sm = new SessionManagement();

            propdata = new Profiles.Profile.Utilities.DataIO();
            data     = new Profiles.Edit.Utilities.DataIO();
            string predicateuri = Request.QueryString["predicateuri"].Replace("!", "#");

            this.PropertyListXML = propdata.GetPropertyList(this.BaseData, base.PresentationXML, predicateuri, false, true, false);
            PropertyLabel        = this.PropertyListXML.SelectSingleNode("PropertyList/PropertyGroup/Property/@Label").Value;

            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");
            }

            litBackLink.Text = "<a href='" + Root.Domain + "/edit/" + this.SubjectID + "'>Edit Menu</a> &gt; <b>" + PropertyListXML.SelectSingleNode("PropertyList/PropertyGroup/Property/@Label").Value + "</b>";

            litEditProperty.Text = "Add " + PropertyLabel;

            this.PropertyListXML = propdata.GetPropertyList(this.BaseData, base.PresentationXML, predicateuri, false, true, false);
            this.MaxCardinality  = this.PropertyListXML.SelectSingleNode("PropertyList/PropertyGroup/Property/@MaxCardinality").Value;
            this.MinCardinality  = this.PropertyListXML.SelectSingleNode("PropertyList/PropertyGroup/Property/@MinCardinality").Value;

            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);
        }
        public CustomEditORCID(XmlDocument pagedata, List <ModuleParams> moduleparams, XmlNamespaceManager pagenamespaces)
            : base(pagedata, moduleparams, pagenamespaces)
        {
            SessionManagement sm = new SessionManagement();

            this.XMLData = pagedata;

            data = new Edit.Utilities.DataIO();
            Profiles.Profile.Utilities.DataIO 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");
            }

            string predicateuri = Request.QueryString["predicateuri"].Replace("!", "#");

            this.PropertyListXML = propdata.GetPropertyList(this.BaseData, base.PresentationXML, predicateuri, false, true, false);

            this.PredicateID = data.GetStoreNode(predicateuri);

            base.GetNetworkProfile(this.SubjectID, this.PredicateID);

            litBackLink.Text = "<a href='" + Root.Domain + "/edit/" + this.SubjectID.ToString() + "'>Edit Menu</a> &gt; <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;
            string orcidHelpLink = string.Empty;
            string orcidInfoSite = Profiles.ORCID.Utilities.config.InfoSite;

            if (!string.IsNullOrEmpty(orcidInfoSite))
            {
                orcidHelpLink         = "&nbsp;<a style='border: none;' href='" + orcidInfoSite + "' target='_blank'>click here.</a>";
                litOrcidInfolink.Text = "For more info about ORCID" + orcidHelpLink;
            }
            //litCreateProvideORCID.Text = "<img src='" + Root.Domain + "/framework/images/icon_squareArrow.gif' border='0'/>&nbsp;<a href='" + Root.Domain + "/ORCID/CreateMyORCID.aspx'>Create My ORCID</a>" + orcidHelpLink + "<br><img src='" + Root.Domain + "/framework/images/icon_squareArrow.gif' border='0'/>&nbsp;<a href='" + Root.Domain + "/ORCID/ProvideORCID.aspx'>Provide My ORCID</a>" + orcidHelpLink;
            //litUploatInfoToORCID.Text = "<img src='" + Root.Domain + "/framework/images/icon_squareArrow.gif' border='0'/>&nbsp;<a href='" + Root.Domain + "/ORCID/UploadInfoToORCID.aspx'>Upload Info To ORCID</a>";
            string loggedInInternalUsername = new Profiles.ORCID.Utilities.DataIO().GetInternalUserID();
            //Profiles.ORCID.Utilities.ProfilesRNSDLL.BO.ORCID.Person person = new Profiles.ORCID.Utilities.ProfilesRNSDLL.BLL.ORCID.Person().GetByInternalUsername(loggedInInternalUsername);

            String orcid = null;

            try { orcid = base.BaseData.SelectSingleNode("rdf:RDF/rdf:Description/vivo:orcidId", base.Namespaces).InnerText; }
            catch (Exception ex) { }

            if (orcid == null)
            {
                pnlAddORCID.Visible   = true;
                pnlEditORCID.Visible  = false;
                orcidtable.Visible    = false;
                pnlORCIDProxy.Visible = false;
            }
            else
            {
                litORCIDID.Text       = "<a href='" + Profiles.ORCID.Utilities.config.ORCID_URL + "/" + orcid + "'>" + orcid + "</a>";
                pnlAddORCID.Visible   = false;
                pnlEditORCID.Visible  = true;
                orcidtable.Visible    = true;
                pnlORCIDProxy.Visible = false;
            }

            if (Profiles.ORCID.Utilities.DataIO.getNodeIdFromInternalUserName(loggedInInternalUsername) != this.SubjectID)
            {
                pnlORCIDProxy.Visible     = true;
                imbProvideMyORCID.Visible = false;
                lbProvideMyORCID.Visible  = false;
                imbUploadToORCID.Visible  = false;
                lbUploadToORCID.Visible   = false;
            }

            if (data.GetSessionSecurityGroup() == -50)
            {
                pnlORCIDAdmin.Visible = true;
                litORCIDAdmin.Text    = "<img src='" + Root.Domain + "/framework/images/icon_squareArrow.gif' border='0'/>&nbsp;<a href='" + Root.Domain + "/ORCID/CreateBatch.aspx'>Batch Upload</a><br><img src='" + Root.Domain + "/framework/images/icon_squareArrow.gif' border='0'/>&nbsp;<a href='" + Root.Domain + "/ORCID/UpdateSecurityGroupDefaultDecisions.aspx'>ORCID Privacy Mapping</a></li>";
            }
        }
        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);
            }
        }
        private void DrawProfilesModule()
        {
            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");
            }

            Edit.Utilities.DataIO  data2 = new Edit.Utilities.DataIO();
            Proxy.Utilities.DataIO data  = new Proxy.Utilities.DataIO();
            SessionManagement      sm    = new SessionManagement();
            string subject = sm.Session().SessionID.ToString();


            if (sm.Session().UserID == 0)
            {
                Response.Redirect(Root.Domain + "/search");
            }

            string predicateName;

            if (isManagerPage)
            {
                predicateName = "Group Managers";
            }
            else
            {
                predicateName = "Group Members";
            }
            litBackLink.Text           = "<a href='" + Root.Domain + "/edit/default.aspx?subject=" + this.SubjectID.ToString() + "'>Edit Menu</a> &gt; <b>" + predicateName + "</b>";
            btnLitAddGroupMembers.Text = "Add " + predicateName;

            if (Request.QueryString["fname"] != null)
            {
                txtFirstName.Text = Request.QueryString["fname"];
                this.Fname        = Request.QueryString["fname"];
            }

            if (Request.QueryString["lname"] != null)
            {
                txtLastName.Text = Request.QueryString["lname"];
                this.Lname       = Request.QueryString["lname"];
            }

            drpInstitution.DataSource     = data2.GetInstitutions(isManagerPage);
            drpInstitution.DataTextField  = "Text";
            drpInstitution.DataValueField = "Value";
            drpInstitution.DataBind();
            drpInstitution.Items.Insert(0, new ListItem("--Select--"));

            if (Request.QueryString["institution"] != null)
            {
                drpInstitution.SelectedIndex = drpInstitution.Items.IndexOf(drpInstitution.Items.FindByText(Request.QueryString["institution"]));
                this.Institution             = Request.QueryString["institution"];
            }

            drpDepartment.DataSource     = data.GetDepartments();
            drpDepartment.DataTextField  = "Text";
            drpDepartment.DataValueField = "Value";
            drpDepartment.DataBind();
            drpDepartment.Items.Insert(0, new ListItem("--Select--"));

            if (Request.QueryString["department"] != null)
            {
                drpDepartment.SelectedIndex = drpDepartment.Items.IndexOf(drpDepartment.Items.FindByText(Request.QueryString["department"]));
                this.Department             = Request.QueryString["department"];
            }

            this.Subject = Convert.ToInt64(Request.QueryString["subject"]);

            if (Request.QueryString["offset"] != null && Request.QueryString["totalrows"] != null)
            {
                this.ExecuteSearch(false);
            }
        }
示例#29
0
        protected void Page_Load(object sender, EventArgs e)
        {
            sm = new SessionManagement();
            //TM199
            if (sm.Session().UserID > 0)
            {
                int count = GetCount();

                if (count > 0)
                {
                    hlRemoveAllFromList.Attributes.Add("onClick", string.Format("ClearList('{0}')", sm.Session().ListID));

                    litJS.Text = string.Format("<script type='text/javascript'>jQuery('#list-count').html('{0}');</script>", count.ToString());
                }
                else
                {
                    litJS.Text = string.Format("<script type='text/javascript'>{0}</script>", "jQuery('#view-list-reports').remove();jQuery('#remove-all-people-from-list').remove();");
                }

                //if (!string.IsNullOrEmpty((string)HttpContext.Current.Session["PERSON-SEARCH-ADD"]))
                if (pageType == pageTypes.SearchResults)
                {
                    hlAddToList.NavigateUrl = String.Format("{0}/lists/default.aspx?type=search", Root.Domain);
                    hlAddToList.Text        = "Add matching people to my list";
                    hlAddToList.Attributes.Add("style", "width:255px;");

                    if (count > 0)
                    {
                        hlRemoveFromList.NavigateUrl = string.Format("{0}/lists/default.aspx?type=removefromsearch", Root.Domain);
                    }
                    else
                    {
                        litJS.Text += string.Format("<script type='text/javascript'>{0}</script>", "jQuery('#remove-people-from-list').remove();");
                    }


                    pnlPersonScript.Visible = false;
                }
                else if (pageType == pageTypes.Person)
                {
                    Profiles.Edit.Utilities.DataIO dataio = new Edit.Utilities.DataIO();
                    string personid = dataio.GetPersonID(Convert.ToInt64(Request.QueryString["subject"])).ToString();
                    if (Profiles.Lists.Utilities.DataIO.PersonExists(personlistid, personid) == "0")
                    {
                        hlAddToList.NavigateUrl = "javascript:void(0);";
                        hlAddToList.Attributes.Add("onclick", string.Format("AddPerson({0},{1},{2})", OwnerNodeID, personlistid, personid));
                        hlAddToList.Text = "Add this person to my list";
                        hlAddToList.Attributes.Add("alt-text", "Remove person from list");
                        hlAddToList.Attributes.Add("alt-onclick", string.Format("RemovePerson({0},{1})", personlistid, personid));

                        pnlPersonScript.Visible = true;
                    }
                    else
                    {
                        hlAddToList.NavigateUrl = "javascript:void(0);";
                        hlAddToList.Attributes.Add("onclick", string.Format("RemovePerson({0},{1})", personlistid, personid));
                        hlAddToList.Text = "Remove person from list";
                        hlAddToList.Attributes.Add("alt-text", "Add person to my list");
                        hlAddToList.Attributes.Add("alt-onclick", string.Format("AddPerson({0},{1},{2})", OwnerNodeID, personlistid, personid));
                        pnlPersonScript.Visible = true;
                    }
                    litJS.Text += string.Format("<script type='text/javascript'>{0}</script>", "jQuery('#remove-people-from-list').remove();");
                }
                else
                {
                    litJS.Text += string.Format("<script type='text/javascript'>{0}</script>", "jQuery('#add-people-to-list').remove();jQuery('#remove-people-from-list').remove();");
                }
            }
        }
        protected void cmdSaveByURIConfirm_onclick(object sender, ImageClickEventArgs e)
        {
            Edit.Utilities.DataIO data = new Edit.Utilities.DataIO();

            //   data.AddNewEntity("", this.PredicateURI);

            // Cant get the lable to match the URI.

            SaveEntityByURI(hdnURI.Value.Trim());
            ShowAllPanels();
            this.LoadEntityGrid(true);
        }
        public CustomEditORCID(XmlDocument pagedata, List<ModuleParams> moduleparams, XmlNamespaceManager pagenamespaces)
            : base(pagedata, moduleparams, pagenamespaces)
        {
            SessionManagement sm = new SessionManagement();
            this.XMLData = pagedata;

            data = new Edit.Utilities.DataIO();
            Profiles.Profile.Utilities.DataIO 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");

            string predicateuri = Request.QueryString["predicateuri"].Replace("!", "#");
            this.PropertyListXML = propdata.GetPropertyList(this.BaseData, base.PresentationXML, predicateuri, false, true, false);

            this.PredicateID = data.GetStoreNode(predicateuri);

            base.GetNetworkProfile(this.SubjectID, this.PredicateID);

            litBackLink.Text = "<a href='" + Root.Domain + "/edit/" + this.SubjectID.ToString() + "'>Edit Menu</a> &gt; <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;
            string orcidHelpLink = string.Empty;
            string orcidInfoSite = Profiles.ORCID.Utilities.config.InfoSite;
            if (!string.IsNullOrEmpty(orcidInfoSite))
            {
                orcidHelpLink = "&nbsp;<a style='border: none;' href='" + orcidInfoSite + "' target='_blank'><img style='border-style: none' src='" + Root.Domain + "/Framework/Images/info.png'  border='0'></a>";
            }
            //litCreateProvideORCID.Text = "<img src='" + Root.Domain + "/framework/images/icon_squareArrow.gif' border='0'/>&nbsp;<a href='" + Root.Domain + "/ORCID/CreateMyORCID.aspx'>Create My ORCID</a>" + orcidHelpLink + "<br><img src='" + Root.Domain + "/framework/images/icon_squareArrow.gif' border='0'/>&nbsp;<a href='" + Root.Domain + "/ORCID/ProvideORCID.aspx'>Provide My ORCID</a>" + orcidHelpLink;
            //litUploatInfoToORCID.Text = "<img src='" + Root.Domain + "/framework/images/icon_squareArrow.gif' border='0'/>&nbsp;<a href='" + Root.Domain + "/ORCID/UploadInfoToORCID.aspx'>Upload Info To ORCID</a>";
            string loggedInInternalUsername = new Profiles.ORCID.Utilities.DataIO().GetInternalUserID();
            //Profiles.ORCID.Utilities.ProfilesRNSDLL.BO.ORCID.Person person = new Profiles.ORCID.Utilities.ProfilesRNSDLL.BLL.ORCID.Person().GetByInternalUsername(loggedInInternalUsername);

            lbCreateMyORCID.Text = "Create ORCID" + orcidHelpLink;
            lbProvideMyORCID.Text = "Provide My ORCID" + orcidHelpLink;

            String orcid = null;
            try { orcid = base.BaseData.SelectSingleNode("rdf:RDF/rdf:Description/vivo:orcidId", base.Namespaces).InnerText; }
            catch (Exception ex) { }

            if (orcid == null)
            {
                pnlAddORCID.Visible = true;
                pnlEditORCID.Visible = false;
                orcidtable.Visible = false;
                pnlORCIDProxy.Visible = false;
            }
            else
            {
                litORCIDID.Text = "<a href='" + Profiles.ORCID.Utilities.config.ORCID_URL + "/" + orcid + "'>" + orcid + "</a>";
                pnlAddORCID.Visible = false;
                pnlEditORCID.Visible = true;
                orcidtable.Visible = true;
                pnlORCIDProxy.Visible = false;
            }

            if (Profiles.ORCID.Utilities.DataIO.getNodeIdFromInternalUserName(loggedInInternalUsername) != this.SubjectID)
            {
                pnlORCIDProxy.Visible = true;
                imbProvideMyORCID.Visible = false;
                lbProvideMyORCID.Visible = false;
                imbUploadToORCID.Visible = false;
                lbUploadToORCID.Visible = false;
            }

            if (data.GetSessionSecurityGroup() == -50)
            {
                pnlORCIDAdmin.Visible = true;
                litORCIDAdmin.Text = "<img src='" + Root.Domain + "/framework/images/icon_squareArrow.gif' border='0'/>&nbsp;<a href='" + Root.Domain + "/ORCID/CreateBatch.aspx'>Batch Upload</a><br><img src='" + Root.Domain + "/framework/images/icon_squareArrow.gif' border='0'/>&nbsp;<a href='" + Root.Domain + "/ORCID/UpdateSecurityGroupDefaultDecisions.aspx'>ORCID Privacy Mapping</a></li>";
            }
        }
        protected void Page_Load(object sender, EventArgs e)
        {
            if (IsPostBack)
            {
                if (PubMedResults.Tables.Count > 0)
                {
                    grdPubMedSearchResults.DataSource = PubMedResults;
                    grdPubMedSearchResults.DataBind();

                }
            }
            else
            {
                Session["phAddPub.Visible"] = null;
                Session["pnlAddPubMed.Visible"] = null;
                Session["pnlAddCustomPubMed.Visible"] = null;
                Session["pnlDeletePubMed.Visible"] = null;
            }

            // a flag to inform the ucProfileBaseInfo that it is edit page
            Session["ProfileEdit"] = "true";

            Session["ProfileUsername"] = _personId;

            if (_personId == 0)
            {
                if (Session["CurrentPersonEditing"] != null)
                    _personId = System.Convert.ToInt32(Session["CurrentPersonEditing"]);
            }
            else
                Session["CurrentPersonEditing"] = _personId;

            Edit.Utilities.DataIO data;
            data = new Edit.Utilities.DataIO();
            string predicateuri = Request.QueryString["predicateuri"].Replace("!", "#");
            this.PropertyListXML = propdata.GetPropertyList(this.BaseData, base.PresentationXML, predicateuri, false, true, false);
            litBackLink.Text = "<a href='" + Root.Domain + "/edit/" + _subject + "'>Edit Menu</a>" + " &gt; <b>" + PropertyListXML.SelectSingleNode("PropertyList/PropertyGroup/Property/@Label").Value + "</b>";
        }
示例#33
0
        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;
                    }
                }
            }
        }