Examples of Fetcher


Examples of org.stringtree.Fetcher

        context.put("value", "thing");
    }
   
    public void select(StringKeeper context) {
        String type = context.get("type");
        Fetcher source = (Fetcher) context.getObject(MojasefConstants.TEMPLATE_SOURCE + "." + type);
        context.put(Templater.TEMPLATE_SOURCE, source);
        context.put("value", "wotsit");
        context.put(MojasefConstants.PAGE_TEMPLATE, "home");
    }
View Full Code Here

Examples of org.stringtree.Fetcher

  private String getString(String name) {
        return FetcherStringHelper.getString(this, name);
    }

    private Iterator<String> listCookies() {
    Fetcher cookies = ListableHelper.subset(this, new StringPrefixFilter(HTTPConstants.RESPONSE_COOKIE));
    return ListableHelper.list(cookies);
  }
View Full Code Here

Examples of org.stringtree.Fetcher

    Fetcher cookies = ListableHelper.subset(this, new StringPrefixFilter(HTTPConstants.RESPONSE_COOKIE));
    return ListableHelper.list(cookies);
  }

  private Iterator<String> listHeaders() {
    Fetcher headers = ListableHelper.subset(this, new StringPrefixFilter(HTTPConstants.RESPONSE_HEADER));
    return ListableHelper.list(headers);
  }
View Full Code Here

Examples of org.stringtree.Fetcher

            System.err.println("Server.appCall unable to locate " + MojasefConstants.HTTP_APPLICATION);
        }
    }
   
    public void request(RequestContext req, OutputCollector res, Object dfl) {
        Fetcher context = new FallbackFetcher(req, common);
       
        try {
            Object file = null;
            res.start();
            String leaf = (String)context.getObject(MojasefConstants.REQUEST_LOCALPATH);
            if (leaf.indexOf(".") > 0) {
                Fetcher pub = (Fetcher)context.getObject(MojasefConstants.FILE_FETCHER);
                file = pub.getObject(leaf);
            }
            if (file != null) {
                String type = mimetype(leaf);
                req.put(HTTPConstants.RESPONSE_CONTENT_TYPE, type);
                res.write((byte[])file);
View Full Code Here

Examples of org.stringtree.Fetcher

  }

  public Object getObject(String name) {
    Object ret = context.getObject(Templater.TEMPLATE + "." + name);
        if (null == ret) {
            Fetcher fetcher = (Fetcher)context.getObject(MojasefConstants.TEMPLATE_SOURCE);
            if (null != fetcher) {
                ret = fetcher.getObject(name);
            }
        }
       
        return ret;
  }
View Full Code Here

Examples of org.stringtree.Fetcher

      put(MojasefConstants.SYSTEM_TIMESTAMP, new LiveDate());
  }
 
  protected void setTemplateFinder() {
        Fetcher source = (Fetcher) getObject(MojasefConstants.TEMPLATE_SOURCE);
        if (null == source) {
          if (null != templates) {
              source = templates;
          } else {
            source = this;
View Full Code Here

Examples of org.stringtree.Fetcher

        put(Templater.TEMPLATE, new ContextTemplateFetcher(this));
        put(Templater.TEMPLATER, templater);
  }
   
    protected void setFileFinder() {
        Fetcher fileFetcher = (Fetcher) getObject(MojasefConstants.FILE_FETCHER);
        if (null == fileFetcher) {
            if (pub == null) {
                pub = new ContextFileFetcher(this);
            }
            put(MojasefConstants.FILE_FETCHER, pub);
View Full Code Here

Examples of org.stringtree.Fetcher

    }

    @SuppressWarnings("unchecked")
    private void setApplicationContext() {
        Repository original = realRepository();
        Fetcher peelback = new PeelbackFetcher(original);
        Object object = peelback.getObject("http.application.context");
        if (null != object) {
            if (object instanceof Fetcher) {
                setOther(new FallbackRepository((Fetcher)object, original));
            } else if (object instanceof Map) {
                setOther(new FallbackRepository(new MapFetcher((Map<String, Object>)object), original));
View Full Code Here
TOP
Copyright © 2018 www.massapi.com. All rights reserved.
All source code are property of their respective owners. Java is a trademark of Sun Microsystems, Inc and owned by ORACLE Inc. Contact coftware#gmail.com.