Package com.baasbox.util

Examples of com.baasbox.util.QueryParams


  public F.Promise<SimpleResult>  call(Context ctx) throws Throwable {
    if (Logger.isTraceEnabled()) Logger.trace("Method Start");
    Http.Context.current.set(ctx);   
    if (Logger.isDebugEnabled()) Logger.debug("ExtractQueryParameters for resource " + Http.Context.current().request());
   
    QueryParams qryp =QueryParams.getParamsFromQueryString(Http.Context.current().request());
    if (Logger.isDebugEnabled()) Logger.debug("ExtractQueryParameters " + qryp);
   
    ctx.args.put(IQueryParametersKeys.QUERY_PARAMETERS, qryp);
    if (Logger.isTraceEnabled()) Logger.trace("Method End");
    return delegate.call(ctx);
View Full Code Here


  }
 
  private void changePushTokenFieldName(ODatabaseRecordTx db)  {
    Logger.info("..changing 'deviceId' to 'pushToken' field name..:");
    UserDao dao = UserDao.getInstance();
    QueryParams criteria = QueryParams.getInstance();
    try {
      List<ODocument> users = UserService.getUsers(criteria);
      for (ODocument user:users){
        ODocument userSystemProperties = user.field(UserDao.ATTRIBUTES_SYSTEM);
        if (userSystemProperties!=null){
View Full Code Here

  }
   
  private void addProfileSections(ODatabaseRecordTx db) {
    Logger.info("...adding missing profile section..:");
    UserDao dao = UserDao.getInstance();
    QueryParams criteria = QueryParams.getInstance();
    try {
      List<ODocument> users = UserService.getUsers(criteria);
      Logger.info(" found " + users.size() + " users");
      for (ODocument user:users){
          ORID userRid = ((ODocument)user.field("user")).getIdentity();
View Full Code Here

    @With ({UserCredentialWrapFilter.class,ConnectToDBFilter.class,ExtractQueryParameters.class}) 
    public static Result getUsers() {
      if (Logger.isTraceEnabled()) Logger.trace("Method Start");
      Context ctx=Http.Context.current.get();
      QueryParams criteria = (QueryParams) ctx.args.get(IQueryParametersKeys.QUERY_PARAMETERS);
//      String where="user.name not in ?" ;
//      if (!StringUtils.isEmpty(criteria.getWhere())) {
//        where += " and (" + criteria.getWhere() + ")";
//      }
//      Object[] params = criteria.getParams();
View Full Code Here

          return badRequest("The 'username' field is missing in the URL, please check the documentation");
       
        if (!UserService.exists(username))
          return badRequest("Username " + username + " not found!");
       
        QueryParams criteria = QueryParams.getInstance().where("user.name=?").params(new String [] {username});
        ODocument user;
     
        try {
          List<ODocument> users = UserService.getUsers(criteria);
          user = UserService.getUsers(criteria).get(0);
View Full Code Here

     */
    @With ({UserCredentialWrapFilter.class,ConnectToDBFilter.class,ExtractQueryParameters.class})
    public static Result followers(boolean justCountThem, String username){
    if (StringUtils.isEmpty(username)) username=DbHelper.currentUsername();
    Context ctx=Http.Context.current.get();
    QueryParams criteria = (QueryParams) ctx.args.get(IQueryParametersKeys.QUERY_PARAMETERS);
    List<ODocument> listOfFollowers=new ArrayList<ODocument>();
    long count=0;
    try {
      if (justCountThem) count = FriendShipService.getCountFriendsOf(username, criteria);
      else listOfFollowers = FriendShipService.getFriendsOf(username, criteria);
View Full Code Here

    @With ({UserCredentialWrapFilter.class,ConnectToDBFilter.class,ExtractQueryParameters.class})
    public static Result following (String username){
      if (StringUtils.isEmpty(username)) username=DbHelper.currentUsername();
          try {
              Context ctx=Http.Context.current.get();
              QueryParams criteria = (QueryParams) ctx.args.get(IQueryParametersKeys.QUERY_PARAMETERS);
              List<ODocument> following = FriendShipService.getFollowing(username, criteria);
              return ok(prepareResponseToJson(following));
          } catch (SqlInjectionException e) {
              return internalServerError(ExceptionUtils.getFullStackTrace(e));
          }
View Full Code Here

  public  void save(ODocument document) throws InvalidModelException{
    super.save(document);
  }
 
  public ODocument getByName (String name) throws SqlInjectionException{
    QueryParams criteria=QueryParams.getInstance().where("name=?").params(new String[]{name});
    List<ODocument> listOfAssets = this.get(criteria);
    if (listOfAssets==null || listOfAssets.size()==0) return null;
    return listOfAssets.get(0);
  }
View Full Code Here

  static String fileSeparator = DbManagerService.fileSeparator;

  public static Result getUsers(){
    if (Logger.isTraceEnabled()) Logger.trace("Method Start");
    Context ctx=Http.Context.current.get();
    QueryParams criteria = (QueryParams) ctx.args.get(IQueryParametersKeys.QUERY_PARAMETERS);
    List<ODocument> users=null;
    String ret="{[]}";
    try{
      users = com.baasbox.service.user.UserService.getUsers(criteria);
    }catch (SqlInjectionException e ){
View Full Code Here

    if (Logger.isTraceEnabled()) Logger.trace("Method Start");

    List<ImmutableMap> result=null;
    try {
      Context ctx=Http.Context.current.get();
      QueryParams criteria = (QueryParams) ctx.args.get(IQueryParametersKeys.QUERY_PARAMETERS);
      List<ODocument> collections = CollectionService.getCollections(criteria);
      result = StatisticsService.collectionsDetails(collections);
    } catch (Exception e){
      Logger.error(ExceptionUtils.getFullStackTrace(e));
      return internalServerError(e.getMessage());
View Full Code Here

TOP

Related Classes of com.baasbox.util.QueryParams

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.