public ORNGRPCService(string uri, Page page, bool editMode)
 {
     this.om = OpenSocialManager.GetOpenSocialManager(uri, page, false);
     // Add to Session so that it does not get prematurely garbage collected
     HttpContext.Current.Session[KEY_PREFIX + ":" + om.GetGuid().ToString()] = this;
     managers.Add(new WeakReference(this));
 }
 public ORNGCallbackResponder(string uri, Page page, bool editMode, string request)
 {
     this.om = OpenSocialManager.GetOpenSocialManager(uri, page, editMode, false);
     this.requestToRespondTo = request;
     // Add to Session so that it does not get prematurely garbage collected
     HttpContext.Current.Session[KEY_PREFIX + requestToRespondTo + ":" + om.GetGuid().ToString()] = this;
     managers.Add(new WeakReference(this));
 }
Example #3
0
 public ORNGRPCService(string uri, Page page, bool editMode, string[] chnls)
 {
     this.om = OpenSocialManager.GetOpenSocialManager(uri, page, false);
     this.channels.AddRange(chnls);
     // Add to Session so that it does not get prematurely garbage collected
     HttpContext.Current.Session[KEY_PREFIX + ":" + om.GetGuid().ToString()] = this;
     managers.Add(new WeakReference(this));
     DebugLogging.Log("ORNGRPCService created :" + om.GetGuid().ToString() + " channels " + this.channels.ToString());
 }
 public ViewPersonalGadget(XmlDocument pagedata, List<ModuleParams> moduleparams, XmlNamespaceManager pagenamespaces)
     : base(pagedata, moduleparams, pagenamespaces)
 {
     // code to convert from numeric node ID to URI
     if (base.Namespaces.HasNamespace("rdf"))
     {
         XmlNode node = this.BaseData.SelectSingleNode("rdf:RDF/rdf:Description/@rdf:about", base.Namespaces);
         uri = node != null ? node.Value : null;
     }
     om = OpenSocialManager.GetOpenSocialManager(uri, Page);
     gadget = om.AddGadget(Convert.ToInt32(base.GetModuleParamString("AppId")), base.GetModuleParamString("View"), base.GetModuleParamString("OptParams"));
 }
 public Gadgets(XmlDocument pagedata, List<ModuleParams> moduleparams, XmlNamespaceManager pagenamespaces)
     : base(pagedata, moduleparams, pagenamespaces)
 {
     string uri = null;
     // code to convert from numeric node ID to URI
     if (base.Namespaces.HasNamespace("rdf"))
     {
         XmlNode node = this.BaseData.SelectSingleNode("rdf:RDF/rdf:Description/@rdf:about", base.Namespaces);
         uri = node != null ? node.Value : null;
     }
     om = OpenSocialManager.GetOpenSocialManager(uri, Page, false, true);
 }
 public Gadgets(XmlDocument pagedata, List<ModuleParams> moduleparams, XmlNamespaceManager pagenamespaces)
     : base(pagedata, moduleparams, pagenamespaces)
 {
     string uri = "";// null;
     // code to convert from numeric node ID to URI
     if (base.Namespaces.HasNamespace("rdf"))
     {
         XmlNode node = this.BaseData.SelectSingleNode("rdf:RDF/rdf:Description/@rdf:about", base.Namespaces);
         uri = node != null ? node.Value : null;
         // we know the structure of the URI and need to take advantage of that
         if (uri != null && uri.StartsWith(Root.Domain + "/profile/"))
         {
             string suffix = uri.Substring((Root.Domain + "/profile/").Length);
             uri = Root.Domain + "/profile/" + suffix.Split('/')[0];
         }
     }
     om = OpenSocialManager.GetOpenSocialManager(uri, Page);
 }
 public SearchGadgets(XmlDocument pagedata, List<ModuleParams> moduleparams, XmlNamespaceManager pagenamespaces)
     : base(pagedata, moduleparams, pagenamespaces)
 {
     om = OpenSocialManager.GetOpenSocialManager(null, Page);
 }
        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> &gt; <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 = "0".Equals(this.PropertyListXML.SelectSingleNode("PropertyList/PropertyGroup/@NumberOfConnections").Value) ?
                0 : Convert.ToInt32(this.PropertyListXML.SelectSingleNode("PropertyList/PropertyGroup/Property/@ViewSecurityGroup").Value);
            securityOptions.SecurityGroups = new XmlDataDocument();
            securityOptions.SecurityGroups.LoadXml(base.PresentationXML.DocumentElement.LastChild.OuterXml);
        }
 public string getCallbackResponse(OpenSocialManager om, string channel)
 {
     return OpenSocialManager.BuildJSONPersonIds(uri, "one person");
 }
 public ViewPersonalGadget(XmlDocument pagedata, List<ModuleParams> moduleparams, XmlNamespaceManager pagenamespaces)
     : base(pagedata, moduleparams, pagenamespaces)
 {
     // code to convert from numeric node ID to URI
     if (base.Namespaces.HasNamespace("rdf"))
     {
         XmlNode node = this.BaseData.SelectSingleNode("rdf:RDF/rdf:Description/@rdf:about", base.Namespaces);
         uri = node != null ? node.Value : null;
     }
     om = OpenSocialManager.GetOpenSocialManager(uri, Page);
     gadget = om.AddGadget(Convert.ToInt32(base.GetModuleParamString("AppId")), base.GetModuleParamString("View"), base.GetModuleParamString("OptParams"));
     // for some reason doing this in DrawProfilesModule (remove that???) fails!
     new ORNGProfileRPCService(Page, this.BaseData.SelectSingleNode("rdf:RDF/rdf:Description/foaf:firstName", base.Namespaces).InnerText, uri);
 }
            public string getCallbackResponse(OpenSocialManager om, string channel)
            {
                try
                {
                    searchRequest.SelectSingleNode("/SearchOptions/OutputOptions/Limit").InnerText = "500";
                    XmlDocument searchData = new Profiles.Search.Utilities.DataIO().Search(searchRequest, false, false);

                    List<string> peopleURIs = new List<string>();
                    XmlNodeList people = searchData.GetElementsByTagName("rdf:object");
                    for (int i = 0; i < people.Count; i++)
                    {
                        peopleURIs.Add(people[i].Attributes["rdf:resource"].Value);
                    }
                    if (peopleURIs.Count > 0)
                    {
                        return OpenSocialManager.BuildJSONPersonIds(peopleURIs, "" + peopleURIs.Count + " people found");
                    }
                }
                catch (Exception e)
                {
                    DebugLogging.Log(e.Message);
                }

                return null;
            }