public PreparedGadget(GadgetSpec gadgetSpec, OpenSocialHelper helper, int moduleId, string securityToken) { this.gadgetSpec = gadgetSpec; this.helper = helper; this.moduleId = moduleId; this.securityToken = securityToken; }
protected void Page_Load(object sender, EventArgs e) { if (IsPostBack) { return; } // only allow access when in debug mode if (ConfigUtil.GetConfigItem("OpenSocialDevPassword") == null) { Response.Redirect("~/Search.aspx"); } // Make sure the right panel is hidden HideRightColumn(); Profile.PropertyValues.Clear(); Profile.Save(); OpenSocialHelper helper = new OpenSocialHelper(1, 1, Page); String gadgetURLs = ""; foreach (PreparedGadget gadget in helper.GetVisibleGadgets()) { gadgetURLs += gadget.GetGadgetURL() + Environment.NewLine; } txtGadgetURLS.Text = gadgetURLs; Session.Clear(); Session.Abandon(); }
// Profiles OpenSocial Extension by UCSF #region OpenSocial protected OpenSocialHelper SetOpenSocialHelper(int viewerId, int ownerId, Page page) { // lazy create as this is expensive if (this.osHelper == null) { this.osHelper = new OpenSocialHelper(viewerId, ownerId, page); } return(this.osHelper); }
protected OpenSocialHelper SetOpenSocialHelper(int viewerId, int ownerId, Page page) { // lazy create as this is expensive if (this.osHelper == null) { this.osHelper = new OpenSocialHelper(viewerId, ownerId, page); } return this.osHelper; }
protected void Page_Load(object sender, EventArgs e) { Session["EmailImgText"] = "none"; Session["ProfileEdit"] = "false"; // Get the profile ID from the query string _personId = GetPersonFromQueryString(); if (!IsPostBack) { if (_personId > 0) { personProfileList = new Connects.Profiles.Service.ServiceImplementation.ProfileService().GetPersonFromPersonId(_personId); personProfile = personProfileList.Person[0]; if (personProfile != null) { // check to see if profile is hidden _isVisibleProfile = personProfile.Visible; this.EditUserId = Profile.UserId; // Handle situation where it's the logged-in user viewing their own page ProcessSelfProxyAndHidden(); //Save Search History if (Profile.UserId != 0) { SaveUserSearchHistory(_personId); } hypBack.NavigateUrl = (string)Session["BackPage"]; if ((string)Request["From"] == "SE") { hypBack.Visible = true; } // Set the page titles Page.Title = personProfile.Name.FirstName + " " + personProfile.Name.LastName + " | " + Page.Title; ltProfileName.Text = personProfile.Name.FullName; // Profiles OpenSocial Extension by UCSF OpenSocialHelper os = SetOpenSocialHelper(Profile.UserId, _personId, Page); os.SetPubsubData(OpenSocialHelper.JSON_PERSONID_CHANNEL, OpenSocialHelper.BuildJSONPersonIds(_personId, personProfile.Name.FullName)); // PMID UserPreferences userPreference = new UserPreferences(); userPreference = _userBL.GetUserPreferences(_personId); if (userPreference.Publications.Equals("Y")) { os.SetPubsubData(OpenSocialHelper.JSON_PMID_CHANNEL, OpenSocialHelper.BuildJSONPubMedIds(personProfile)); } os.RemovePubsubGadgetsWithoutData(); GenerateOpensocialJavascipt(); pnlOpenSocialGadgets.Visible = OpenSocial().IsVisible(); // record that their profile was viewed OpenSocialHelper.PostActivity(_personId, "profile was viewed"); } } } InitializeUserControlEvents(); }