Package edu.wpi.cs.wpisuitetng.modules

Examples of edu.wpi.cs.wpisuitetng.modules.Model


   */
  public synchronized String create(String[] args, String content,Cookie[] cook) throws WPISuiteException
  {
    Session s = getSessionFromCookies(cook);

    Model m;
    m = (Model) map.get(args[0]+args[1]).makeEntity(s,content);
       
        return m.toJSON();
  }
View Full Code Here


   */
  public synchronized String update(String[] args, String content,Cookie[] cook) throws WPISuiteException
  {
    Session s = getSessionFromCookies(cook);

    Model m;
    m = (Model) map.get(args[0]+args[1]).update(s, content);
   
    return m.toJSON();
 
  }
View Full Code Here

    }
    User theUser = s1.getUser();
    Project[] model = this.getEntity(id);
    if(model[0].getPermission(theUser).equals(Permission.WRITE) ||
       theUser.getRole().equals(Role.ADMIN)){
      Model m = data.delete(data.retrieve(project, "idNum", id).get(0));
      logger.log(Level.INFO, "ProjectManager deleting project <" + id + ">");
     
      return (m != null) ? true : false;
    }
    else{
View Full Code Here

  @Override
  public boolean deleteEntity(Session s1 ,String id) throws WPISuiteException {

    if(s1.getUser().getRole().equals(Role.ADMIN))
    {
      Model m = data.delete(data.retrieve(user, "username", id).get(0));
      logger.log(Level.INFO, "UserManager deleting user <" + id + ">");
      return (m != null) ? true : false;
    }
    else
    {
View Full Code Here

  }
 
  public Model save(String json, Class<? extends Model> type)
  {
    Gson gson = new Gson();
    Model m = gson.fromJson(json, type);
    Model[] n = retrieve(type, m);
    if(n == null)
      models.add(m);
    return (n == null) ? m : n[0];
  }
View Full Code Here

TOP

Related Classes of edu.wpi.cs.wpisuitetng.modules.Model

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.