/** * Return the href for the profile link of a given baseUri and domain type mapping. * * @param configuration is the source of the app's baseUri. * @param mapping provides the resource's path. * @return */ public static String getPath(RepositoryRestConfiguration configuration, ResourceMapping mapping) { String path = getRootPath(configuration); return mapping == null ? path : path + mapping.getPath(); } }
/** * Add a link to the {@link ProfileController}'s base URI to the app's root URI. * * @param resource * @return */ @Override public RepositoryLinksResource process(RepositoryLinksResource resource) { resource.add(new Link(ProfileController.getRootPath(this.configuration), PROFILE_REL)); return resource; } }
/** * List a profile link for each exported repository. * * @return */ @RequestMapping(value = PROFILE_ROOT_MAPPING, method = GET) HttpEntity<ResourceSupport> listAllFormsOfMetadata() { ResourceSupport profile = new ResourceSupport(); profile.add(new Link(getRootPath(this.configuration)).withSelfRel()); for (Class<?> domainType : this.repositories) { ResourceMetadata mapping = this.mappings.getMetadataFor(domainType); if (mapping.isExported()) { profile.add(new Link(getPath(this.configuration, mapping), mapping.getRel())); } } return new ResponseEntity<ResourceSupport>(profile, HttpStatus.OK); }
/** * Return the href for the profile link of a given baseUri and domain type mapping. * * @param configuration is the source of the app's baseUri. * @param mapping provides the resource's path. * @return */ public static String getPath(RepositoryRestConfiguration configuration, ResourceMapping mapping) { String path = getRootPath(configuration); return mapping == null ? path : path + mapping.getPath(); } }
/** * Add a link to the {@link ProfileController}'s base URI to the app's root URI. * * @param resource * @return */ @Override public RepositoryLinksResource process(RepositoryLinksResource resource) { resource.add(new Link(ProfileController.getRootPath(this.configuration), PROFILE_REL)); return resource; } }
/** * List a profile link for each exported repository. * * @return */ @RequestMapping(value = PROFILE_ROOT_MAPPING, method = GET) HttpEntity<ResourceSupport> listAllFormsOfMetadata() { ResourceSupport profile = new ResourceSupport(); profile.add(new Link(getRootPath(this.configuration)).withSelfRel()); for (Class<?> domainType : this.repositories) { ResourceMetadata mapping = this.mappings.getMetadataFor(domainType); if (mapping.isExported()) { profile.add(new Link(getPath(this.configuration, mapping), mapping.getRel())); } } return new ResponseEntity<ResourceSupport>(profile, HttpStatus.OK); }