Package widgets.shout.models

Examples of widgets.shout.models.Shout


    return "Shows latest shouts";
  }

  public Object endpoint(String name, Params params) throws Exception {
    if(params._contains("create")) {
      Shout s = new Shout(params.get("author"),params.get("text"));
      s.save();     
      return true;
    } else {
      Feed out = new Feed();
      List<Shout> shouts = Shout.find("order by posted desc").fetch(5);
      long limit = 1000 * 60 * 60 * 24 * 5; // 5 days in ms
      for(Shout s : shouts) {
        if( new Date().getTime() - s.posted.getTime() > limit)
          s.delete();
        else
          out.add(s.author, s.body, "");
      }
      return out; 
     
View Full Code Here

TOP

Related Classes of widgets.shout.models.Shout

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.