Package com.dotcms.repackage.javax.ws.rs.core

Examples of com.dotcms.repackage.javax.ws.rs.core.CacheControl


  @PUT
  public Response doPut(@Context HttpServletRequest request, @PathParam("params") String params) throws URISyntaxException {

    InitDataObject auth = init(null, true, request, false);
    CacheControl cc = new CacheControl();
    cc.setNoCache(true);
    User user = auth.getUser();
    String username = (user != null) ? user.getFullName() : " unknown ";
    ResponseBuilder builder = Response.ok("{\"result\":\"" + username + " PUT!\"}", "application/json");
    return builder.cacheControl(cc).build();
  }
View Full Code Here


  @POST
  public Response doPost(@Context HttpServletRequest request, @PathParam("params") String params) throws URISyntaxException {
    InitDataObject auth = init(null, true, request, false);
    User user = auth.getUser();
    String username = (user != null) ? user.getFullName() : " unknown ";
    CacheControl cc = new CacheControl();
    cc.setNoCache(true);
    ResponseBuilder builder = Response.ok("{\"result\":\"" + username + " POST!\"}", "application/json");
    return builder.cacheControl(cc).build();
  }
View Full Code Here

      DotDataException, DotSecurityException {
    // force authentication
    InitDataObject auth = init(null, true, request, true);
    User user = auth.getUser();
    String username = (user != null) ? user.getFullName() : " unknown ";
    CacheControl cc = new CacheControl();
    cc.setNoCache(true);
    ResponseBuilder builder = Response.ok("{\"result\":\"/test/" + username + " GET!\"}", "application/json");
    return builder.cacheControl(cc).build();

  }
View Full Code Here

  public Response loadRoot(@Context HttpServletRequest request, @PathParam("params") String params) throws DotStateException,
      DotDataException, DotSecurityException {
    InitDataObject auth = init(null, true, request, false);
    User user = auth.getUser();
    String username = (user != null) ? user.getFullName() : " unknown ";
    CacheControl cc = new CacheControl();
    cc.setNoCache(true);
    ResponseBuilder builder = Response.ok("{\"result\":\"" + username + " GET!\"}", "application/json");
    return builder.cacheControl(cc).build();

  }
View Full Code Here

        @Produces("application/json")
        public Response loadJson(@Context HttpServletRequest request,
                        @PathParam("params") String params) throws DotStateException,
                        DotDataException, DotSecurityException {

                CacheControl cc = new CacheControl();
                cc.setNoCache(true);

                ResponseBuilder builder = Response
                                .ok("{\"test\":\"test\"}", "application/json");
                return builder.cacheControl(cc).build();
View Full Code Here

      ResponseBuilder builder = Response.status(500);
      return builder.build();
    }

    ResponseBuilder builder = Response.ok(getJspResponse(request, portlet.getPortletId(), jspName), "text/html");
    CacheControl cc = new CacheControl();
    cc.setNoCache(true);

    return builder.cacheControl(cc).build();

  }
View Full Code Here

        jsonResponse.put( "identifier", "id" );
        jsonResponse.put( "label", "name" );
        jsonResponse.put( "items", jsonBundles.toArray() );
        jsonResponse.put( "numRows", bundles.size() );

        CacheControl nocache=new CacheControl();
        nocache.setNoCache(true);
        return Response.ok(jsonResponse.toString()).cacheControl(nocache).build();
    }
View Full Code Here

    Map<String, String> paramsMap = initData.getParamsMap();
    String roleId = paramsMap.get("id");

    RoleAPI roleAPI = APILocator.getRoleAPI();
   
    CacheControl cc = new CacheControl();
        cc.setNoCache( true );

    if(!UtilMethods.isSet(roleId) || roleId.equals("root")) {  // Loads Root Roles
      JSONArray jsonRoles = new JSONArray();
      JSONObject jsonRoleObject = new JSONObject();
      jsonRoleObject.put("id", "root");
View Full Code Here

      environmentBundle.put( "name", StringEscapeUtils.unescapeJava( e.getName() ));

      jsonEnvironments.add(environmentBundle);
    }

    CacheControl cc = new CacheControl();
    cc.setNoCache(true);
    return Response.ok(jsonEnvironments.toString(), MediaType.APPLICATION_JSON_TYPE).cacheControl(cc).build();
  }
View Full Code Here

TOP

Related Classes of com.dotcms.repackage.javax.ws.rs.core.CacheControl

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.