예제 #1
0
파일: Renderer.cs 프로젝트: s7loves/pesta
 public Renderer() 
 {
     processor = Processor.Instance;
     renderer = new HtmlRenderer();
     containerConfig = JsonContainerConfig.Instance;
     lockedDomainService = HashLockedDomainService.Instance;
 }
예제 #2
0
  /**
 * @param messageBundleFactory Used for injecting message bundles into gadget output.
 */
  public RenderingContentRewriter()
  {
      messageBundleFactory = DefaultMessageBundleFactory.Instance;
      containerConfig = JsonContainerConfig.Instance;
      featureRegistry = GadgetFeatureRegistry.Instance;
      urlGenerator = DefaultUrlGenerator.Instance;
  }
예제 #3
0
파일: Processor.cs 프로젝트: s7loves/pesta
 private Processor()
 {
     gadgetSpecFactory = DefaultGadgetSpecFactory.Instance;
     substituter = new VariableSubstituter();
     blacklist = new BasicGadgetBlacklist("");
     containerConfig = JsonContainerConfig.Instance;
 }
예제 #4
0
        /**
        * Create a LockedDomainService
        * @param config per-container configuration
        * @param embedHost host name to use for embedded content
        * @param enabled whether this service should do anything at all.
        */
        public HashLockedDomainService(ContainerConfig config, bool enabled)
        {
            this.enabled = enabled;
            lockedSuffixes = new Dictionary<string,string>();
            required = new Dictionary<string,bool>();
            ICollection<String> containers = config.GetContainers();
            if (enabled) 
            {
                foreach(String container in containers) 
                {
                    String suffix = config.Get(container, LOCKED_DOMAIN_SUFFIX_KEY);
                    if (suffix == null)
                    {

                    } 
                    else 
                    {
                        lockedSuffixes.Add(container, suffix);
                    }
                    String require = config.Get(container, LOCKED_DOMAIN_REQUIRED_KEY);
                    required.Add(container, "true".Equals(require));
                }
            }
        }
예제 #5
0
파일: HttpUtil.cs 프로젝트: s7loves/pesta
 /**
 * Fetches js configuration for the given feature set & container.
 *
 * @param config The configuration to extract js config from.
 * @param context The request context.
 * @param features A set of all features needed.
 */
 public static JsonObject GetJsConfig(ContainerConfig config, GadgetContext context, HashSet<string> features)
 {
     JsonObject containerFeatures = config.GetJsonObject(context.getContainer(),
                                                         "gadgets.features");
     JsonObject retv = new JsonObject();
     if (containerFeatures != null)
     {
         foreach (string feat in features)
         {
             if (containerFeatures.Contains(feat))
             {
                 retv.Put(feat, containerFeatures[feat]);
             }
         }
     }
     return retv;
 }