Esempio n. 1
0
        // tool gadgets
        public PreparedGadget(GadgetSpec gadgetSpec, OpenSocialManager openSocialManager)
        {
            this.gadgetSpec        = gadgetSpec;
            this.openSocialManager = openSocialManager;
            this.securityToken     = SocketSendReceive(openSocialManager.GetViewerURI(), openSocialManager.GetOwnerURI(), gadgetSpec.GetGadgetURL());

            // look at the view requirements and what page we are on to set some things
            GadgetViewRequirements viewReqs = GetGadgetViewRequirements();

            if (viewReqs != null)
            {
                this.view      = viewReqs.GetView();
                this.chromeId  = viewReqs.GetChromeId();
                this.optParams = viewReqs.GetOptParams();
            }
            else  // must be a sandbox gadget
            {
                this.view      = "";
                this.chromeId  = "gadgets-test-" + gadgetSpec.GetAppId();
                this.optParams = "{}";
            }
        }
Esempio n. 2
0
        // tool gadgets
        public PreparedGadget(GadgetSpec gadgetSpec, OpenSocialManager openSocialManager)
        {
            this.gadgetSpec        = gadgetSpec;
            this.openSocialManager = openSocialManager;
            this.securityToken     = openSocialManager.GetSecurityToken(gadgetSpec.GetGadgetURL());

            // look at the view requirements and what page we are on to set some things
            GadgetViewRequirements viewReqs = GetGadgetViewRequirements();

            if (viewReqs != null)
            {
                this.view      = viewReqs.GetView();
                this.chromeId  = viewReqs.GetChromeIdBase() + "-" + GetAppId();
                this.optParams = viewReqs.GetOptParams();
            }
            else  // must be a sandbox gadget
            {
                this.view      = "sandbox";
                this.chromeId  = "gadgets-sandbox-" + GetAppId();
                this.optParams = "{}";
            }
        }
Esempio n. 3
0
        public string GetOptParams()
        {
            GadgetViewRequirements reqs = GetGadgetViewRequirements();

            return(reqs != null?reqs.GetOptParams() : "{}");
        }