@Path("{businessId}") public LocationResource getBusinessResource(@PathParam("businessId") Long businessId) { Business business; try { business = businessRepo.getById(businessId); } catch (com.googlecode.objectify.NotFoundException e) { throw new NotFoundException(); } if (business.isTrash()) { if (HttpMethods.WRITE_METHODS.contains(servletRequest.getMethod())) { throw new IllegalAccessException("Can not modified trashed resource."); } } Account account = (Account) servletRequest.getAttribute("net.eatsense.domain.Account"); CheckIn checkIn = (CheckIn) servletRequest.getAttribute("net.eatsense.domain.CheckIn"); LocationResource businessResource = resourceContext.getResource(LocationResource.class); businessResource.setAccount(account); businessResource.setBusiness(business); businessResource.setCheckIn(checkIn); return businessResource; }
/** * Returns a dynamic instance of MulchLevelResource used for entity navigation. * * @param id identifier for the parent entity * @return an instance of MulchLevelResource */ @Path("mulchLevels/") public MulchLevelResource getMulchLevelsResource() { MulchLevelsResourceSub mulchLevelsResourceSub = resourceContext.getResource(MulchLevelsResourceSub.class); mulchLevelsResourceSub.setParent(getEntity()); return mulchLevelsResourceSub; }
/** * Returns a dynamic instance of PrivacyPreferencesResource used for entity navigation. * * @return an instance of PrivacyPreferencesResource */ @Secured({"ROLE_USER", "USER_ACCESS"}) @Path("{id}/") public PrivacyPreferencesResource getPrivacyPreferencesResource(@PathParam("id") Long id) { PrivacyPreferencesResource resource = resourceContext.getResource(PrivacyPreferencesResource.class); resource.setId(id); return resource; }
/** * Returns a dynamic instance of NetworkResource used for entity navigation. * * @return an instance of NetworkResource */ @Path("{id}/") public service.NetworkResource getNetworkResource(@PathParam("id") String id) { NetworkResource resource = resourceContext.getResource(NetworkResource.class); resource.setId(id); return resource; }
@Path("subresource") public SpringAopSubResource getSubResource() { return _resourceContext.getResource(SpringAopSubResource.class); }