Package com.trendrr.oss

Examples of com.trendrr.oss.DynMap


   * @see com.trendrr.strest.contrib.sessions.SessionPersistence#loadSession(java.lang.String)
   */
  @Override
  public Map<String, Object> loadSession(String sessionId) {
    log.info("Loading session (not really): " + sessionId);
    return new DynMap();
  }
View Full Code Here


  /* (non-Javadoc)
   * @see com.trendrr.strest.doc.AbstractDocTag#process(com.trendrr.strest.doc.StrestDocParser, java.lang.String)
   */
  @Override
  public Object process(StrestDocParser parser, String value) {
    DynMap mp = new DynMap();
   
   
   
    //look for @default
    String defval = this.tagValue("default", value);
    if (defval != null) {
      mp.put("default", defval);
      value = this.removeTag("default", value);
    }
   
    mp.put("required", this.containsTag("required", value));
    value = this.removeTag("required", value);
   
    int ind = value.indexOf(' ');
    if (ind == -1) {
      //only the param in this one.
      mp.put(this.tagName(), value);
      return mp;
    }
    String param = value.substring(0, ind).trim();
    mp.put(this.tagName(), param);
    value = value.substring(ind).trim();
   

   
    mp.put("description", value);
    return mp;
  }
View Full Code Here

   
   
   
    rend.init("/java/trendrr-api/templates", 10);
   
    DynMap params = new DynMap();
    params.put("test", "NOTHING");
    System.out.println(rend.renderTemplateFile("/docs/index.html", null));
 
   
  }
View Full Code Here

      }
    }
  }
 
  public void init(String templateDir, long timeout) {
    DynMap config = new DynMap();
    config.put("templating.base_dir", templateDir);
    config.put("templating.cache_timeout", timeout);
    init(config);
  }
View Full Code Here

   
  }
 
  public void parseAndSave(String docDirectory, String saveDirectory) {
    List<DynMap> routes = this.parseDirectory(docDirectory);
    DynMap index = this.createIndex(routes);
    //save the index.
    try {
      String filename = saveDirectory + "/strestdoc_index";
      for (TemplateRenderer rend : this.renderers) {
        FileHelper.saveBytes(filename + rend.getFileExtension(), rend.renderIndex(index));
View Full Code Here

   * @return
   */
  public DynMap createIndex(List<DynMap> routes) {
   
   
    DynMap categories = new DynMap();
   
    for (DynMap route : routes) {
      String category = route.get(String.class, "category", "default");
      categories.putIfAbsent(category, new ArrayList<DynMap>());
      DynMap mp = this.createIndexEntry(route);
      if (mp == null)
        continue;
      categories.get(List.class, category).add(mp);
    }

   
    List<DynMap> catList = new ArrayList<DynMap>();
    //now sort the lists.
    for (String cat : categories.keySet()) {
      List<DynMap> rt = categories.getList(DynMap.class, cat);
      DynMap ct = this.createIndexCategory(cat, rt);
      if (ct != null) {
        catList.add(ct);
      }
    }
   
    Collections.sort(catList, new Comparator<DynMap>() {
      @Override
      public int compare(DynMap o1, DynMap o2) {
        return o1.getString("category").compareTo(o2.getString("category"));
      }
    });
    DynMap index = new DynMap();
    index.put("categories", catList);
    return index;
  }
View Full Code Here

        String r1 = o1.getString("route", "");
        String r2 = o2.getString("route", "");
        return r1.compareToIgnoreCase(r2);
      }
    });
    DynMap cat = new DynMap();
    cat.put("category", category);
    cat.put("routes", routes);
    return cat;
  }
View Full Code Here

   * return null to skip this entry in the index.
   * @param route
   * @return
   */
  public DynMap createIndexEntry(DynMap route) {
    DynMap mp = new DynMap();
    mp.put("route", route.get("route"));
    String abs = route.get(String.class, "abstract");
    if (abs == null) {
      abs = route.get(String.class, "description", "");
      System.out.println(abs);
      abs = abs.substring(0, Math.min(this.abstractLength, abs.length()));
    }
    mp.put("abstract", abs);
   
    if (route.containsKey("method")) {
      mp.put("method", route.get("method"));
    }
    return mp;
  }
View Full Code Here

public class FlashSocketPolicyServer {

  protected Log log = LogFactory.getLog(FlashSocketPolicyServer.class);
 
  public static void main(String ...strings) {
    FlashSocketPolicyServer.instance(new DynMap());
   
  }
View Full Code Here

        this.bootstrap = new ServerBootstrap(
                new NioServerSocketChannelFactory(
                    bossExecutor,
                    workerExecutor));

        final DynMap cfg = config;
        // Set up the event pipeline factory.
        bootstrap.setPipelineFactory(new ChannelPipelineFactory() {
     
      @Override
      public ChannelPipeline getPipeline() throws Exception {
View Full Code Here

TOP

Related Classes of com.trendrr.oss.DynMap

Copyright © 2018 www.massapicom. 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.