Package com.ikanow.infinit.e.data_model.api

Examples of com.ikanow.infinit.e.data_model.api.ResponsePojo.toApi()


     if (!rp.getResponse().isSuccess()) {
       if (rp.getResponse().getMessage().contains("ermission")) { // likely to be a permissions error
         RESTTools.logRequest(this);
       }
     }//TOTEST (TODO-2194)
     return new StringRepresentation(rp.toApi(), MediaType.APPLICATION_JSON);
  }   
}
View Full Code Here


     if (!rp.getResponse().isSuccess()) {
       if (rp.getResponse().getMessage().contains("ermission")) { // likely to be a permissions error
         RESTTools.logRequest(this);
       }
     }//TOTEST (TODO-2194)
     return new StringRepresentation(rp.toApi(), MediaType.APPLICATION_JSON);
  }
 
  /**
   * Attempts to test if json is UTF-8, throws an exception
   * if it detects a different charset
View Full Code Here

     }
    
    
     Date endTime = new Date();
     rp.getResponse().setTime(endTime.getTime() - startTime.getTime());
     return new StringRepresentation(rp.toApi(), MediaType.APPLICATION_JSON);
  }
}
View Full Code Here

           //(OBSOLETE)
           rp = this.search.getAliasSuggestions(cookieLookup, term, field, communityIdStrList);
         }
       }
     } // (end if login valid)
     data = rp.toApi();

     return new StringRepresentation(data, mediaType);
  }
}
View Full Code Here

       rp.getResponse().setTime(endTime.getTime() - startTime.getTime());
       if (!rp.getResponse().isSuccess()) {
         RESTTools.logRequest(this);
       }//TOTEST (TODO-2194)
     }
     return new StringRepresentation(rp.toApi(), MediaType.APPLICATION_JSON);
  }

}
View Full Code Here

     if (!rp.getResponse().isSuccess()) {
       if (rp.getResponse().getMessage().contains("ermission")) { // likely to be a permissions error
         RESTTools.logRequest(this);
       }
     }//TOTEST (TODO-2194)
     return new StringRepresentation(rp.toApi(), MediaType.APPLICATION_JSON);
  }
}
View Full Code Here

          else {
            rp.setData(toAdd, new DocumentPojoApiMap());
          }//TESTED
         
          //Test deserialization:
          rp.toApi();
        }
        catch (Exception e) {
          //e.printStackTrace();
          StringBuffer sb = new StringBuffer();
          Globals.populateStackTrace(sb, e);
View Full Code Here

      if ((!action.equals("keepalive")) && ((null == user) || !user.equals("ping"))) {
        // (not a keepalive) and (user!=ping)
        RESTTools.logRequest(this);
      }
    }//TOTEST (TODO-2194)
    return new StringRepresentation(rp.toApi(), MediaType.APPLICATION_JSON);
  }   
}
View Full Code Here

    ////////////////////////////////////////////////
    //CANONICAL EXAMPLE:
    Set<ObjectId> communities = new HashSet<ObjectId>();
    communities.add(new ObjectId("a0000000000000000000000a"));
    rp1.setData(sp, new SourcePojoApiMap(null, communities, communities));
    String sRPSingleObject = rp1.toApi();
    System.out.println("RPa=" + sRPSingleObject); // ("chris" removed, toApi handles RepsonsePojo specially)
    ////////////////////////////////////////////////
    System.out.println("RPb=" + ResponsePojo.toApi(rp1, rp1.getMapper())); // ("chris" removed because of mapper)
    System.out.println("RPc=" + ResponsePojo.toApi(rp1)); // ("chris" removed, toApi handles RepsonsePojo specially)
   
View Full Code Here

    //CHECK THIS DOESN'T COMPILE
    //rp1.setData(list); // (Not allowed SourcePojo isn't a BaseApiPojo)

    sp2.addToCommunityIds(new ObjectId("a0000000000000000000000a")); // (alex will be allowed again)
    rp1.setData(list, new SourcePojoApiMap(null, communities, communities));
    String sRPList = rp1.toApi();
    sp2.setCommunityIds(null);
   
    //API:  And get as a list
    String listJson =  BaseApiPojo.getDefaultBuilder().create().toJson(rp1.getData());
    System.out.println("RP=" + listJson); // include "alex" and "chris" - no mapping applied
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.