private void DrawProfilesModule() { XsltArgumentList args = new XsltArgumentList(); XslCompiledTransform xslt = new XslCompiledTransform(); SessionManagement sm = new SessionManagement(); Utilities.DataIO data = new Profiles.Profile.Utilities.DataIO(); string email = string.Empty; string imageemailurl = string.Empty; if (this.BaseData.SelectSingleNode("rdf:RDF[1]/rdf:Description[1]/prns:emailEncrypted", this.Namespaces) != null && this.BaseData.SelectSingleNode("rdf:RDF[1]/rdf:Description[1]/vivo:email", this.Namespaces) == null) { email = this.BaseData.SelectSingleNode("rdf:RDF[1]/rdf:Description[1]/prns:emailEncrypted", this.Namespaces).InnerText; imageemailurl = string.Format(Root.Domain + "/profile/modules/CustomViewPersonGeneralInfo/" + "EmailHandler.ashx?msg={0}", HttpUtility.UrlEncode(email)); } args.AddParam("root", "", Root.Domain); if (email != string.Empty) { args.AddParam("email", "", imageemailurl); } args.AddParam("imgguid", "", Guid.NewGuid().ToString()); // Check for an ORCID string internalUsername = new Profiles.ORCID.Utilities.ProfilesRNSDLL.BLL.Profile.Data.Person().GetInternalUsername(Convert.ToInt64(Request.QueryString["Subject"])); Profiles.ORCID.Utilities.ProfilesRNSDLL.BO.ORCID.Person orcidPerson = new Profiles.ORCID.Utilities.ProfilesRNSDLL.BLL.ORCID.Person().GetByInternalUsername(internalUsername); if (orcidPerson.Exists && !orcidPerson.ORCIDIsNull) { args.AddParam("orcid", "", orcidPerson.ORCID); args.AddParam("orcidurl", "", Profiles.ORCID.Utilities.config.ORCID_URL + "/" + orcidPerson.ORCID); args.AddParam("orcidinfosite", "", Profiles.ORCID.Utilities.config.InfoSite); args.AddParam("orcidimage", "", Root.Domain + "/Framework/Images/orcid_16x16(1).gif"); args.AddParam("orcidimageguid", "", Guid.NewGuid().ToString()); } else if (Profiles.ORCID.Utilities.config.ShowNoORCIDMessage && Profiles.ORCID.Utilities.config.Enabled) { //args.AddParam("orcid", "", "No ORCID id has been created for this user"); args.AddParam("orcid", "", "Login to create your ORCID iD"); args.AddParam("orcidinfosite", "", Profiles.ORCID.Utilities.config.InfoSite); string qs = HttpUtility.UrlEncode("predicateuri=http%3a%2f%2fvivoweb.org%2fontology%2fcore!orcidId&module=DisplayItemToEdit&ObjectType=Literal"); args.AddParam("orcidurl", "", Root.Domain + "/login/default.aspx?method=login&edit=true&editparams=" + qs); args.AddParam("orcidimage", "", Root.Domain + "/Framework/Images/orcid_16x16(1).gif"); args.AddParam("orcidimageguid", "", Guid.NewGuid().ToString()); } litPersonalInfo.Text = XslHelper.TransformInMemory(Server.MapPath("~/Profile/Modules/CustomViewPersonGeneralInfo/CustomViewPersonGeneralInfo.xslt"), args, base.BaseData.OuterXml); if (base.BaseData.SelectSingleNode("rdf:RDF/rdf:Description[1]/prns:mainImage/@rdf:resource", base.Namespaces) != null) { string imageurl = base.BaseData.SelectSingleNode("//rdf:RDF/rdf:Description[1]/prns:mainImage/@rdf:resource", base.Namespaces).Value; imgPhoto.ImageUrl = imageurl + "&cachekey=" + Guid.NewGuid().ToString(); } else { imgPhoto.Visible = false; } }
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); } }
private void DrawProfilesModule() { XsltArgumentList args = new XsltArgumentList(); XslCompiledTransform xslt = new XslCompiledTransform(); SessionManagement sm = new SessionManagement(); Profiles.Profile.Modules.CustomViewPersonGeneralInfo.DataIO data = new Profiles.Profile.Modules.CustomViewPersonGeneralInfo.DataIO(); string email = string.Empty; string imageemailurl = string.Empty; string audioemailurl = string.Empty; if (this.BaseData.SelectSingleNode("rdf:RDF[1]/rdf:Description[1]/prns:emailEncrypted", this.Namespaces) != null && this.BaseData.SelectSingleNode("rdf:RDF[1]/rdf:Description[1]/vivo:email", this.Namespaces) == null) { email = this.BaseData.SelectSingleNode("rdf:RDF[1]/rdf:Description[1]/prns:emailEncrypted", this.Namespaces).InnerText; imageemailurl = string.Format(Root.Domain + "/profile/modules/CustomViewPersonGeneralInfo/" + "EmailHandler.ashx?msg={0}", HttpUtility.UrlEncode(email)); audioemailurl = string.Format(Root.Domain + "/profile/modules/CustomViewPersonGeneralInfo/" + "EmailAudioHandler.ashx?msg={0}", HttpUtility.UrlEncode(email)); } args.AddParam("root", "", Root.Domain); if (email != string.Empty) { args.AddParam("email", "", imageemailurl); args.AddParam("emailAudio", "", audioemailurl); args.AddParam("emailAudioImg", "", Root.Domain + "/Framework/Images/listen.jpg"); } args.AddParam("imgguid", "", Guid.NewGuid().ToString()); if (base.BaseData.SelectSingleNode("rdf:RDF/rdf:Description[1]/vivo:orcidId", base.Namespaces) != null) // Only show ORCID if security settings allow it { args.AddParam("orcid", "", base.BaseData.SelectSingleNode("rdf:RDF/rdf:Description[1]/vivo:orcidId", base.Namespaces).InnerText); args.AddParam("orcidurl", "", Profiles.ORCID.Utilities.config.ORCID_URL + "/" + base.BaseData.SelectSingleNode("rdf:RDF/rdf:Description[1]/vivo:orcidId", base.Namespaces).InnerText); string infosite; if (Profiles.ORCID.Utilities.config.InfoSite == null) { infosite = Root.Domain + "/about/default.aspx?tab=orcid"; } else if (Profiles.ORCID.Utilities.config.InfoSite.Equals("")) { infosite = Root.Domain + "/about/default.aspx?tab=orcid"; } else { infosite = Profiles.ORCID.Utilities.config.InfoSite; } args.AddParam("orcidinfosite", "", infosite); args.AddParam("orcidimage", "", Root.Domain + "/Framework/Images/orcid_16x16(1).gif"); args.AddParam("orcidimageguid", "", Guid.NewGuid().ToString()); } else if (Profiles.ORCID.Utilities.config.ShowNoORCIDMessage && Profiles.ORCID.Utilities.config.Enabled) { // Check for an ORCID string internalUsername = new Profiles.ORCID.Utilities.ProfilesRNSDLL.BLL.Profile.Data.Person().GetInternalUsername(Convert.ToInt64(Request.QueryString["Subject"])); Profiles.ORCID.Utilities.ProfilesRNSDLL.BO.ORCID.Person orcidPerson = new Profiles.ORCID.Utilities.ProfilesRNSDLL.BLL.ORCID.Person().GetByInternalUsername(internalUsername); if (!orcidPerson.Exists || orcidPerson.ORCIDIsNull) { //args.AddParam("orcid", "", "No ORCID id has been created for this user"); args.AddParam("orcid", "", "Login to create your ORCID iD"); args.AddParam("orcidinfosite", "", Profiles.ORCID.Utilities.config.InfoSite); string qs = HttpUtility.UrlEncode("predicateuri=http%3a%2f%2fvivoweb.org%2fontology%2fcore!orcidId&module=DisplayItemToEdit&ObjectType=Literal"); args.AddParam("orcidurl", "", Root.Domain + "/login/default.aspx?method=login&edit=true&editparams=" + qs); args.AddParam("orcidimage", "", Root.Domain + "/Framework/Images/orcid_16x16(1).gif"); args.AddParam("orcidimageguid", "", Guid.NewGuid().ToString()); } } args.AddParam("nodeid", "", Request.QueryString["Subject"]); litPersonalInfo.Text = XslHelper.TransformInMemory(Server.MapPath("~/Profile/Modules/CustomViewPersonGeneralInfo/CustomViewPersonGeneralInfo.xslt"), args, base.BaseData.OuterXml); try { string addressURI = base.BaseData.SelectSingleNode("rdf:RDF/rdf:Description[1]/vivo:mailingAddress", base.Namespaces).Attributes["rdf:resource"].Value; mapCountry = base.BaseData.SelectSingleNode("rdf:RDF/rdf:Description[@rdf:about=\"" + addressURI + "\"]/vivo:address3", base.Namespaces).InnerText; string mr = data.GetMapData(mapCountry); if (mr != "-1") { mapRegion = "region: '" + mr + "',"; } } catch (Exception) { } /* * if (base.BaseData.SelectSingleNode("rdf:RDF/rdf:Description[1]/prns:mainImage/@rdf:resource", base.Namespaces) != null) * { * string imageurl = base.BaseData.SelectSingleNode("//rdf:RDF/rdf:Description[1]/prns:mainImage/@rdf:resource", base.Namespaces).Value; * imgPhoto.ImageUrl = imageurl;// + "&cachekey=" + Guid.NewGuid().ToString(); * } * else * { * imgPhoto.Visible = false; * } */ // OpenSocial. Allows gadget developers to show test gadgets if you have them installed /* string uri = this.BaseData.SelectSingleNode("rdf:RDF/rdf:Description/@rdf:about", base.Namespaces).Value; * OpenSocialManager om = OpenSocialManager.GetOpenSocialManager(uri, Page); * if (om.IsVisible() && om.GetUnrecognizedGadgets().Count > 0) * { * pnlSandboxGadgets.Visible = true; * litSandboxGadgets.Visible = true; * string sandboxDivs = "" ; * foreach (PreparedGadget gadget in om.GetUnrecognizedGadgets()) * { * sandboxDivs += "<div id='" + gadget.GetChromeId() + "' class='gadgets-gadget-parent'></div>"; * } * litSandboxGadgets.Text = sandboxDivs; * om.LoadAssets(); * // Add this just in case it is needed. * new ORNGProfileRPCService(Page, this.BaseData.SelectSingleNode("rdf:RDF/rdf:Description/foaf:firstName", base.Namespaces).InnerText, uri); * } */ }
private void DrawProfilesModule() { XsltArgumentList args = new XsltArgumentList(); XslCompiledTransform xslt = new XslCompiledTransform(); SessionManagement sm = new SessionManagement(); Utilities.DataIO data = new Profiles.Profile.Utilities.DataIO(); string email = string.Empty; //string imageemailurl = string.Empty; string emailPlainText = string.Empty; string audioemailurl = string.Empty; if (this.BaseData.SelectSingleNode("rdf:RDF[1]/rdf:Description[1]/prns:emailEncrypted", this.Namespaces) != null && this.BaseData.SelectSingleNode("rdf:RDF[1]/rdf:Description[1]/vivo:email", this.Namespaces) == null) { email = this.BaseData.SelectSingleNode("rdf:RDF[1]/rdf:Description[1]/prns:emailEncrypted", this.Namespaces).InnerText; //imageemailurl = string.Format(Root.Domain + "/profile/modules/CustomViewPersonGeneralInfo/" + "EmailHandler.ashx?msg={0}", HttpUtility.UrlEncode(email)); emailPlainText = getEmailPlainText(email); audioemailurl = string.Format(Root.Domain + "/profile/modules/CustomViewPersonGeneralInfo/" + "EmailAudioHandler.ashx?msg={0}", HttpUtility.UrlEncode(email)); } args.AddParam("root", "", Root.Domain); if (email != string.Empty) { //args.AddParam("email", "", imageemailurl); args.AddParam("email", "", emailPlainText); args.AddParam("emailAudioImg", "", Root.Domain + "/Framework/Images/listen.jpg"); } args.AddParam("imgguid", "", Guid.NewGuid().ToString()); if (base.BaseData.SelectSingleNode("rdf:RDF/rdf:Description[1]/vivo:orcidId", base.Namespaces) != null) // Only show ORCID if security settings allow it { args.AddParam("orcid", "", base.BaseData.SelectSingleNode("rdf:RDF/rdf:Description[1]/vivo:orcidId", base.Namespaces).InnerText); args.AddParam("orcidurl", "", Profiles.ORCID.Utilities.config.ORCID_URL + "/" + base.BaseData.SelectSingleNode("rdf:RDF/rdf:Description[1]/vivo:orcidId", base.Namespaces).InnerText); args.AddParam("orcidinfosite", "", Profiles.ORCID.Utilities.config.InfoSite); args.AddParam("orcidimage", "", Root.Domain + "/Framework/Images/orcid_16x16(1).gif"); args.AddParam("orcidimageguid", "", Guid.NewGuid().ToString()); } else if (Profiles.ORCID.Utilities.config.ShowNoORCIDMessage && Profiles.ORCID.Utilities.config.Enabled) { // Check for an ORCID string internalUsername = new Profiles.ORCID.Utilities.ProfilesRNSDLL.BLL.Profile.Data.Person().GetInternalUsername(Convert.ToInt64(Request.QueryString["Subject"])); Profiles.ORCID.Utilities.ProfilesRNSDLL.BO.ORCID.Person orcidPerson = new Profiles.ORCID.Utilities.ProfilesRNSDLL.BLL.ORCID.Person().GetByInternalUsername(internalUsername); if (!orcidPerson.Exists || orcidPerson.ORCIDIsNull) { //args.AddParam("orcid", "", "No ORCID id has been created for this user"); args.AddParam("orcid", "", "Login to create your ORCID iD"); args.AddParam("orcidinfosite", "", Profiles.ORCID.Utilities.config.InfoSite); string qs = HttpUtility.UrlEncode("predicateuri=http%3a%2f%2fvivoweb.org%2fontology%2fcore!orcidId&module=DisplayItemToEdit&ObjectType=Literal"); args.AddParam("orcidurl", "", Root.Domain + "/login/default.aspx?method=login&edit=true&editparams=" + qs); args.AddParam("orcidimage", "", Root.Domain + "/Framework/Images/orcid_16x16(1).gif"); args.AddParam("orcidimageguid", "", Guid.NewGuid().ToString()); } } args.AddParam("nodeid", "", Request.QueryString["Subject"]); litPersonalInfo.Text = XslHelper.TransformInMemory(Server.MapPath("~/Profile/Modules/CustomViewPersonGeneralInfo/CustomViewPersonGeneralInfo.xslt"), args, base.BaseData.OuterXml); if (base.BaseData.SelectSingleNode("rdf:RDF/rdf:Description[1]/prns:mainImage/@rdf:resource", base.Namespaces) != null) { string imageurl = base.BaseData.SelectSingleNode("//rdf:RDF/rdf:Description[1]/prns:mainImage/@rdf:resource", base.Namespaces).Value; imgPhoto.ImageUrl = imageurl + "&cachekey=" + Guid.NewGuid().ToString(); } else { imgPhoto.Visible = false; } // OpenSocial. Allows gadget developers to show test gadgets if you have them installed string uri = this.BaseData.SelectSingleNode("rdf:RDF/rdf:Description/@rdf:about", base.Namespaces).Value; OpenSocialManager om = OpenSocialManager.GetOpenSocialManager(uri, Page); if (om.IsVisible()) { if (om.GetUnrecognizedGadgets().Count > 0) { pnlSandboxGadgets.Visible = true; litSandboxGadgets.Visible = true; string sandboxDivs = "" ; foreach (PreparedGadget gadget in om.GetUnrecognizedGadgets()) { sandboxDivs += "<div id='" + gadget.GetChromeId() + "' class='gadgets-gadget-parent'></div>"; } litSandboxGadgets.Text = sandboxDivs; om.LoadAssets(); } // Add this just in case it is needed. new ORNGProfileRPCService(Page, this.BaseData.SelectSingleNode("rdf:RDF/rdf:Description/foaf:firstName", base.Namespaces).InnerText, uri); } }