Package play.mvc.Http

Examples of play.mvc.Http.Context


    }

    @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() + ")";
//      }
View Full Code Here


     * @return
     */
    @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);
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

  static String backupDir = DbManagerService.backupDir;
  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);
View Full Code Here

    return ok(ret);
  }

  public static Result getUser(String username){
    if (Logger.isTraceEnabled()) Logger.trace("Method Start");
    Context ctx=Http.Context.current.get();

    ODocument user=null;
    try {
      user = com.baasbox.service.user.UserService.getUserProfilebyUsername(username);
    } catch (SqlInjectionException e1) {
View Full Code Here

  public static Result getCollections(){
    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));
View Full Code Here

    public static Result list(){
        if (Logger.isTraceEnabled()) Logger.trace("Method Start");
        Result result;
        try {
          Context ctx=Http.Context.current.get();
      QueryParams criteria = (QueryParams) ctx.args.get(IQueryParametersKeys.QUERY_PARAMETERS);
            List<ODocument> documents = ScriptingService.list(criteria);
            String json = JSONFormats.prepareResponseToJson(documents, JSONFormats.Formats.DOCUMENT);
            result = ok(json);
        } catch (SqlInjectionException e) {
View Full Code Here

    return ok(JSONFormats.prepareResponseToJson(link, Formats.LINK));
  }
 
  @With ({UserCredentialWrapFilter.class,ConnectToDBFilter.class,ExtractQueryParameters.class})
  public static Result getLinks() throws IOException{
    Context ctx=Http.Context.current.get();
    QueryParams criteria = (QueryParams) ctx.args.get(IQueryParametersKeys.QUERY_PARAMETERS);
    List<ODocument> listOfLinks;
    try {
      listOfLinks = LinkService.getLink(criteria);
    } catch (InvalidCriteriaException e) {
View Full Code Here

      return ok(ret);
    }
   
  @With ({UserOrAnonymousCredentialsFilter.class,ConnectToDBFilter.class,ExtractQueryParameters.class})
  public static Result getAllFile() throws IOException{
    Context ctx=Http.Context.current.get();
    QueryParams criteria = (QueryParams) ctx.args.get(IQueryParametersKeys.QUERY_PARAMETERS);
    List<ODocument> listOfFiles;
    try {
      listOfFiles = FileService.getFiles(criteria);
    } catch (InvalidCriteriaException e) {
View Full Code Here

      try {
        ODocument doc=FileService.getById(id);
        if (doc==null) return notFound(id + " file was not found");
        String filename=(String)doc.field("fileName");
       
        Context ctx=Http.Context.current.get();
        Boolean download = BooleanUtils.toBoolean(ctx.request().getQueryString(QUERY_STRING_FIELD_DOWNLOAD));
        String resize = ctx.request().getQueryString(QUERY_STRING_FIELD_RESIZE);
        boolean resizeIsEmpty=StringUtils.isEmpty(resize);
        Integer sizeId = Ints.tryParse(ctx.request().getQueryString(QUERY_STRING_FIELD_RESIZE_ID)+"");
       
        byte[] output;
        if (sizeId!=null){
          output = FileService.getResizedPicture(id, sizeId);
          String[] fileName=((String)doc.field("fileName")).split("\\.");
View Full Code Here

TOP

Related Classes of play.mvc.Http.Context

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.