Esempio n. 1
0
        protected void Page_Load(object sender, EventArgs e)
        {
            vp_user = new VpSandboxUser(Page);

            if (Request.QueryString["tagsearch"] != null)
            {
              tag = Request.QueryString["tagsearch"];
            }
            else
            {
              tag = "test"; // set a specific default tag here - this is for use in Tag-specific pages
            }

            // set up TagCloudRecentWidgetModule for recent
            m_tagsearch_recent = new RemoteWidget("TagCloudWidgetModule", "tgrc_",
              "videoplay", "tagsearch_recent");
            m_tagsearch_recent.Set("search", tag);

            // set up TagCloudWidgetModule
            m_tagsearch = new RemoteWidget("TagCloudWidgetModule", "tg_", "videoplay",
              "tagsearch");
            m_tagsearch.Set("search", tag);

              // set up widget controller and make HTTP request to backend if required (e.g. if we're handling AJAX or a form post)
            m_rwc = new RemoteWidgetController(this, ConfigurationManager.AppSettings["WidgetServerUrl"], "w_", vp_user.Language);
            if (!vp_user.anon)
            {
                m_rwc.SetUser("videoplay", vp_user.id, vp_user.login,
                    vp_user.email, vp_user.url, vp_user.first_name, vp_user.last_name, vp_user.thumbnail_url);
            }
            m_rwc.Add(m_tagsearch);
            m_rwc.Add(m_tagsearch_recent);
            m_rwc.SetupComplete();
        }
Esempio n. 2
0
        protected void Page_Load(object sender, EventArgs e)
        {
            // user id for the page
            string page_uid = Request.QueryString["UserID"];

            vp_user = new VpSandboxUser(Page);
            // set up ReviewModule
            m_recent_reviews = new RemoteWidget("ReviewModule", "rv_", "videoplay", "recent_by_user");
            m_recent_reviews.Set("user_id", page_uid);

            // set up CommentModule
            m_recent_comments = new RemoteWidget("CommentModule", "rc_", "videoplay", "recent_by_user");
            m_recent_comments.Set("user_id", page_uid);

            // set up RatingModule
            m_recent_ratings = new RemoteWidget("RatingModule", "rt_", "videoplay", "recent_by_user");
            m_recent_ratings.Set("user_id", page_uid);

            // set up fanModule
            m_recent_fanof = new RemoteWidget("FansWidgetModule", "fan_", "videoplay", "recent_by_user");
            m_recent_ratings.Set("user_id", page_uid);

            // set up RelationsModule
            m_friends = new RemoteWidget("RelationsModule", "f_", "videoplay", "user");
            m_friends.Set("user_id", page_uid);

            // set up ActivitiesWidgetModule
            m_activities = new RemoteWidget("ActivitiesWidgetModule", "a_", "videoplay", "user");
            m_activities.Set("user_id", page_uid);

            // set up ActivitiesWidgetModule
            m_tagcloud = new RemoteWidget("TagCloudWidgetModule", "tc_", "videoplay", "user");
            m_tagcloud.Set("user_id", page_uid);

            // set up widget controller and make HTTP request to backend if required (e.g. if we're handling AJAX or a form post)
            m_rwc = new RemoteWidgetController(this, ConfigurationManager.AppSettings["WidgetServerUrl"], "w_", vp_user.Language);
            if (!vp_user.anon)
            {
                m_rwc.SetUser("videoplay", vp_user.id, vp_user.login,
                    vp_user.email, vp_user.url, vp_user.first_name, vp_user.last_name, vp_user.thumbnail_url);
            }
            m_rwc.Add(m_recent_reviews);
            m_rwc.Add(m_recent_comments);
            m_rwc.Add(m_recent_ratings);
            m_rwc.Add(m_recent_fanof);
            m_rwc.Add(m_friends);
            m_rwc.Add(m_activities);
            m_rwc.Add(m_tagcloud);
            m_rwc.SetupComplete();
        }
Esempio n. 3
0
        protected void Page_Load(object sender, EventArgs e)
        {
            vp_user = new VpSandboxUser(Page);
            // set up PeopleModule
            m_facewall = new RemoteWidget("FacewallWidgetModule", "fw_", "videoplay", "middle");
            m_facewall.Set("mode", "friends");

            m_facewall_side = new RemoteWidget("FacewallWidgetModule", "fws_", "videoplay", "side");
            m_facewall_side.Set("mode", "newest");

            // set up widget controller and make HTTP request to backend if required (e.g. if we're handling AJAX or a form post)
            m_rwc = new RemoteWidgetController(this, ConfigurationManager.AppSettings["WidgetServerUrl"], "w_", vp_user.Language);
            if (!vp_user.anon)
            {
                m_rwc.SetUser("videoplay", vp_user.id, vp_user.login,
                    vp_user.email, vp_user.url, vp_user.first_name, vp_user.last_name, vp_user.thumbnail_url);
            }
            m_rwc.Add(m_facewall);
            m_rwc.Add(m_facewall_side);
            m_rwc.SetupComplete();
        }
        protected void Page_Load(object sender, EventArgs e)
        {
            vp_user = new VpSandboxUser(Page);
            if (vp_user.anon)
            {
                // need a user here, so redirect to the fake login page
                Response.Redirect("../ChangeUser.aspx?ref=MyAccount/MyMessages.aspx", true);
            }

            // set up MessageModule
            m_messages = new RemoteWidget("ConversationModule", "m_", "videoplay", "user");

            // set up RelationsModule
            m_friends = new RemoteWidget("RelationsModule", "f_", "videoplay", "user");

            // set up widget controller and make HTTP request to backend if required (e.g. if we're handling AJAX or a form post)
            m_rwc = new RemoteWidgetController(this, ConfigurationManager.AppSettings["WidgetServerUrl"], "w_", vp_user.Language);
            Debug.Assert(!vp_user.anon);
            m_rwc.SetUser("videoplay", vp_user.id, vp_user.login,
                vp_user.email, vp_user.url, vp_user.first_name, vp_user.last_name, vp_user.thumbnail_url);
            m_rwc.Add(m_messages);
            m_rwc.Add(m_friends);
            m_rwc.SetupComplete();
        }
        protected void Page_Load(object sender, EventArgs e)
        {
            vp_user = new VpSandboxUser(Page);

            // set up BlogWidgetModule
            m_blog = new RemoteWidget("BlogWidgetModule", "b_", "videoplay", "user");
            /* m_blog.Set("blog_id", "2"); */
            m_blog.Set("blog_name", "Product Team Blog");

            // set up CommentModule
            m_comments = new RemoteWidget("CommentModule", "cm_", "videoplay", "item");
            m_comments.Set("subject_type", "blogpost");

            // set up widget controller and make HTTP request to backend if required (e.g. if we're handling AJAX or a form post)
            m_rwc = new RemoteWidgetController(this, ConfigurationManager.AppSettings["WidgetServerUrl"], "w_", vp_user.Language);
            if (!vp_user.anon)
            {
                m_rwc.SetUser("videoplay", vp_user.id, vp_user.login,
                    vp_user.email, vp_user.url, vp_user.first_name, vp_user.last_name, vp_user.thumbnail_url);
            }
            m_rwc.Add(m_blog);
            m_rwc.Add(m_comments);
            m_rwc.SetupComplete();
        }
        // add a widget to the list
        public void Add(RemoteWidget w)
        {
            // read parameters from Request
            w.CollectParams(m_page.Request);

            // assign an ID for the module
            string w_id = next_id.ToString();
            ++next_id;

            w.ID = w_id;

            // work out URLs that will flag a post to this module
            string url = m_postback_url_prefix + m_param_prefix;

            w.AjaxURL = url + "ajax=" + w.ParamPrefix;
            w.PostURL = url + "post=" + w.ParamPrefix;

            // see if the current request is a POST or AJAX call to this module
            if (m_post_target == w.ParamPrefix)
            {
                w.Method = "post";
                target = w;
            }
            else if (m_ajax_target == w.ParamPrefix)
            {
                w.Method = "ajax";
                target = w;
            }

            // and finally keep track of it so we can request it later from the srver
            m_widgets[w_id] = w;
        }
        protected void Page_Load(object sender, EventArgs e)
        {
            vp_user = new VpSandboxUser(Page);
            if (Request.QueryString["prodId"] == null)
            {
                Response.Redirect(Request.Url +
                    (Request.Url.ToString().Contains("?") ? "&" : "?") +
                    "prodId=123");
                Response.End();
            }

            if (Request.QueryString["Language"] == "French") {
                m_lang = "fr";
                m_alt_lang = "English";
            } else {
                m_lang = "en";
                m_alt_lang = "French";
            }

            string movie_id = Request.QueryString["prodId"]; // replace with videoplay movie ID
            string movie_type = "movie";
            string movie_name = "click";
            if (Request.QueryString["prodType"] != null)
            {
                movie_type = Request.QueryString["prodType"];
            }
            if (Request.QueryString["prodName"] != null)
            {
                movie_name = Request.QueryString["prodName"];
            }

            RemoteWidgetSubject movie = new RemoteWidgetSubject();
            movie["type"] = movie_type;
            movie["id"] = movie_id;
            movie["name"] = movie_name;

            movie["thumbnail"] = "Resource/lmg/thumbnail_2.gif"; // replace with thumbnail of current movie
            movie["thumbnail_w"] = 50;
            movie["thumbnail_h"] = 70;
            movie["genres"] = "Comedy, Kids/Family";
            movie["url"] = "/MediaDetail_Test.aspx?prodId="+movie_id;

            // set up ReviewModule
            m_reviews = new RemoteWidget("ReviewModule", "rv_", "videoplay", "item");
            m_reviews.Set("subject_type", movie_type);
            m_reviews.Set("subject_id", movie_id);

            // set up CommentModule
            m_comments = new RemoteWidget("CommentModule", "cm_", "videoplay", "item");
            m_comments.Set("subject_type", movie_type);
            m_comments.Set("subject_id", movie_id);

            // set up RatingModule
            m_ratings = new RemoteWidget("RatingModule", "rt_", "videoplay", "item");
            m_ratings.Set("subject_type", movie_type);
            m_ratings.Set("subject_id", movie_id);

            // set up FansModule
            m_fans = new RemoteWidget("FansWidgetModule", "fan_", "videoplay", "item");
            m_fans.Set("subject_type", movie_type);
            m_fans.Set("subject_id", movie_id);

            // set up TagCloudWidgetModule
            m_tagcloud = new RemoteWidget("TagCloudWidgetModule", "tags_", "videoplay", "item");
            m_tagcloud.Set("subject_type", movie_type);
            m_tagcloud.Set("subject_id", movie_id);

            // set up widget controller and make HTTP request to backend if required (e.g. if we're handling AJAX or a form post)
            m_rwc = new RemoteWidgetController(this, ConfigurationManager.AppSettings["WidgetServerUrl"], "w_", m_lang);
            if (!vp_user.anon)
            {
                m_rwc.SetUser("videoplay", vp_user.id, vp_user.login,
                    vp_user.email, vp_user.url, vp_user.first_name, vp_user.last_name, vp_user.thumbnail_url);
            }
            m_rwc.AddItem(movie);
            m_rwc.Add(m_reviews);
            m_rwc.Add(m_comments);
            m_rwc.Add(m_ratings);
            m_rwc.Add(m_fans);
            m_rwc.Add(m_tagcloud);
            m_rwc.SetupComplete(); // let m_rwc know we're done setting up modules, so it can do its work if necessary.
        }