// OntologyGadgets public PreparedGadget(GadgetSpec gadgetSpec, OpenSocialManager openSocialManager, string view, string optParams) { this.gadgetSpec = gadgetSpec; this.openSocialManager = openSocialManager; this.securityToken = openSocialManager.GetSecurityToken(gadgetSpec.GetGadgetURL()); this.view = view; this.chromeId = "gadgets-ontology-" + GetAppId(); this.optParams = optParams == null || optParams.Trim() == string.Empty ? "{}" : optParams; }
// 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 = "{}"; } }