private void UpdateSecuritySetting(string securitygroup) { // maybe be able to make this more general purpose Edit.Utilities.DataIO secdata = new Profiles.Edit.Utilities.DataIO(); if (!"0".Equals(securitygroup)) { Edit.Utilities.DataIO data = new Profiles.Edit.Utilities.DataIO(); if (this.PredicateURI.Equals("http://profiles.catalyst.harvard.edu/ontology/prns#hasGroupSettings")) { data.UpdateGroupSecurity(this.Subject, Convert.ToInt32(securitygroup)); } else if (this.PredicateURI.Equals("http://profiles.catalyst.harvard.edu/ontology/prns#emailEncrypted")) { if (Convert.ToInt32(securitygroup) >= -10 && Convert.ToInt32(securitygroup) < 0) { data.UpdateSecuritySetting(this.Subject, data.GetStoreNode("http://vivoweb.org/ontology/core#email"), -20); } else { data.UpdateSecuritySetting(this.Subject, data.GetStoreNode("http://vivoweb.org/ontology/core#email"), Convert.ToInt32(securitygroup)); } } data.UpdateSecuritySetting(this.Subject, data.GetStoreNode(this.PredicateURI), Convert.ToInt32(securitygroup)); divHidden.Visible = false; } Framework.Utilities.Cache.AlterDependency(this.Subject.ToString()); }
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 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(); }
private void UpdateSecuritySetting(string securitygroup) { Edit.Utilities.DataIO data = new Profiles.Edit.Utilities.DataIO(); if (this.PredicateURI.Equals("http://profiles.catalyst.harvard.edu/ontology/prns#hasGroupSettings")) { data.UpdateGroupSecurity(this.Subject, Convert.ToInt32(securitygroup)); } else { data.UpdateSecuritySetting(this.Subject, data.GetStoreNode(this.PredicateURI), Convert.ToInt32(securitygroup)); } }
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(); }
public EditPersonalGadget(XmlDocument pagedata, List <ModuleParams> moduleparams, XmlNamespaceManager pagenamespaces) : base(pagedata, moduleparams, pagenamespaces) { SessionManagement sm = new SessionManagement(); base.BaseData = pagedata; data = new Profiles.ORNG.Utilities.DataIO(); Profiles.Edit.Utilities.DataIO editdata = new Profiles.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"); } 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> > <b>" + PropertyListXML.SelectSingleNode("PropertyList/PropertyGroup/Property/@Label").Value + "</b>"; //create a new network triple request. base.RDFTriple = new RDFTriple(this.SubjectID, editdata.GetStoreNode(this.PredicateURI)); base.RDFTriple.Expand = true; base.RDFTriple.ShowDetails = true; base.GetDataByURI();//This will reset the data to a Network. // Profiles OpenSocial Extension by UCSF uri = this.BaseData.SelectSingleNode("rdf:RDF/rdf:Description/@rdf:about", base.Namespaces).Value; uri = uri.Substring(0, uri.IndexOf(Convert.ToString(this.SubjectID)) + Convert.ToString(this.SubjectID).Length); appId = Convert.ToInt32(base.GetModuleParamString("AppId")); om = OpenSocialManager.GetOpenSocialManager(uri, Page, true); gadget = om.AddGadget(appId, base.GetModuleParamString("View"), base.GetModuleParamString("OptParams")); 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); hasGadget = Convert.ToInt32(this.PropertyListXML.SelectSingleNode("PropertyList/PropertyGroup/Property/@NumberOfConnections").Value) > 0; }
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); }
public EditPersonalGadget(XmlDocument pagedata, List<ModuleParams> moduleparams, XmlNamespaceManager pagenamespaces) : base(pagedata, moduleparams, pagenamespaces) { SessionManagement sm = new SessionManagement(); base.BaseData = pagedata; data = new Profiles.ORNG.Utilities.DataIO(); Profiles.Edit.Utilities.DataIO editdata = new Profiles.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"); 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> > <b>" + PropertyListXML.SelectSingleNode("PropertyList/PropertyGroup/Property/@Label").Value + "</b>"; //create a new network triple request. base.RDFTriple = new RDFTriple(this.SubjectID, editdata.GetStoreNode(this.PredicateURI)); base.RDFTriple.Expand = true; base.RDFTriple.ShowDetails = true; base.GetDataByURI();//This will reset the data to a Network. // Profiles OpenSocial Extension by UCSF uri = this.BaseData.SelectSingleNode("rdf:RDF/rdf:Description/@rdf:about", base.Namespaces).Value; uri = uri.Substring(0, uri.IndexOf(Convert.ToString(this.SubjectID)) + Convert.ToString(this.SubjectID).Length); appId = Convert.ToInt32(base.GetModuleParamString("AppId")); om = OpenSocialManager.GetOpenSocialManager(uri, Page, true); if (om.IsEnabled()) { gadget = om.AddOntologyGadget(appId, base.GetModuleParamString("View"), base.GetModuleParamString("OptParams")); } 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); hasGadget = Convert.ToInt32(this.PropertyListXML.SelectSingleNode("PropertyList/PropertyGroup/Property/@NumberOfConnections").Value) > 0; }
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 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>"; 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); }
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; } }