Class FacetController

java.lang.Object
gov.niem.tools.api.db.facet.FacetController

@RestController @RequestMapping("stewards/{stewardKey}/models/{modelKey}/versions/{versionNumber}") public class FacetController extends Object
REST controller for facet information.
  • Constructor Details

    • FacetController

      public FacetController()
  • Method Details

    • getFacet

      @GetMapping("/types/{qname}/facets/{category}/{value}") public Facet getFacet(@PathVariable String stewardKey, @PathVariable String modelKey, @PathVariable String versionNumber, @PathVariable String qname, @PathVariable Facet.Category category, @PathVariable String value)
      Gets a facet with the given criteria.
    • getVersionFacets

      @GetMapping("/facets") public org.springframework.data.domain.Page<Facet> getVersionFacets(@PathVariable String stewardKey, @PathVariable String modelKey, @PathVariable String versionNumber, @PageableDefault(sort={"typeName","typePrefix","category","value"},size=100) org.springframework.data.domain.Pageable pageable)
      Gets all facets from the version with the given criteria.
    • getNamespaceFacets

      @GetMapping("/namespaces/{prefix}/facets") public org.springframework.data.domain.Page<Facet> getNamespaceFacets(@PathVariable String stewardKey, @PathVariable String modelKey, @PathVariable String versionNumber, @PathVariable String prefix, @PageableDefault(sort={"typeName","category","value"},size=100) org.springframework.data.domain.Pageable pageable)
      Gets all facets from the namespace with the given criteria.
    • getTypeFacets

      @GetMapping("/types/{qname}/facets") public org.springframework.data.domain.Page<Facet> getTypeFacets(@PathVariable String stewardKey, @PathVariable String modelKey, @PathVariable String versionNumber, @PathVariable String qname, @PageableDefault(sort={"category","value"},size=100) org.springframework.data.domain.Pageable pageable)
      Gets all facets from the type with the given criteria.
    • getPropertyFacets

      @GetMapping("/properties/{qname}/facets") public org.springframework.data.domain.Page<Facet> getPropertyFacets(@PathVariable String stewardKey, @PathVariable String modelKey, @PathVariable String versionNumber, @PathVariable String qname, @PageableDefault(sort={"category","value"},size=100) org.springframework.data.domain.Pageable pageable)
      Gets all facets from the type of the property with the given criteria.
    • getTypeFacetsCmf

      @GetMapping("/types/{qname}/facets/formats/cmf") public Object getTypeFacetsCmf(@PathVariable String stewardKey, @PathVariable String modelKey, @PathVariable String versionNumber, @PathVariable String qname, @PageableDefault(sort={"category","value"}) org.springframework.data.domain.Pageable pageable, @RequestParam(required=false,defaultValue="json") Config.AppMediaType mediaType) throws Exception
      Gets all facets in CMF from the type with the given criteria.
      Throws:
      Exception
    • countVersionFacets

      @GetMapping("/facets/count") public long countVersionFacets(@PathVariable String stewardKey, @PathVariable String modelKey, @PathVariable String versionNumber) throws EntityNotFoundException
      Count all facets in the version with the given fields.
      Throws:
      EntityNotFoundException
    • countNamespaceFacets

      @GetMapping("/namespaces/{prefix}/facets/count") public long countNamespaceFacets(@PathVariable String stewardKey, @PathVariable String modelKey, @PathVariable String versionNumber, @PathVariable String prefix) throws EntityNotFoundException
      Count all facets in the namespace with the given fields.
      Throws:
      EntityNotFoundException
    • countTypeFacets

      @GetMapping("/types/{qname}/facets/count") public long countTypeFacets(@PathVariable String stewardKey, @PathVariable String modelKey, @PathVariable String versionNumber, @PathVariable String qname) throws EntityNotFoundException
      Count all facets in the type with the given fields.
      Throws:
      EntityNotFoundException
    • countPropertyFacets

      @GetMapping("/properties/{qname}/facets/count") public long countPropertyFacets(@PathVariable String stewardKey, @PathVariable String modelKey, @PathVariable String versionNumber, @PathVariable String qname) throws EntityNotFoundException
      Count all facets in the type of the property with the given fields.
      Throws:
      EntityNotFoundException
    • getPrev

      @GetMapping("/types/{qname}/facets/{category}/{value}/prev") @ResponseStatus(code=OK) public Facet getPrev(@PathVariable String stewardKey, @PathVariable String modelKey, @PathVariable String versionNumber, @PathVariable String qname, @PathVariable Facet.Category category, @PathVariable String value, @RequestParam(required=false,defaultValue="false") boolean includePreRelease) throws Exception
      Get the previous version of the facet with the given fields.
      Parameters:
      includePreRelease - - True to return a result from a pre-release if applicable; false to iterate until an official version is reached.
      Throws:
      Exception
    • getNext

      @GetMapping("/types/{qname}/facets/{category}/{value}/next") @ResponseStatus(code=OK) public Facet getNext(@PathVariable String stewardKey, @PathVariable String modelKey, @PathVariable String versionNumber, @PathVariable String qname, @PathVariable Facet.Category category, @PathVariable String value, @RequestParam(required=false,defaultValue="false") boolean includePreRelease) throws Exception
      Get the next version of the facet with the given fields.
      Parameters:
      includePreRelease - - True to return a result from a pre-release if applicable; false to iterate until an official version is reached.
      Throws:
      Exception
    • getCurrent

      @GetMapping("/types/{qname}/facets/{category}/{value}/current") @ResponseStatus(code=OK) public Facet getCurrent(@PathVariable String stewardKey, @PathVariable String modelKey, @PathVariable String versionNumber, @PathVariable String qname, @PathVariable Facet.Category category, @PathVariable String value) throws Exception
      Get the current version of the facet with the given fields.
      Throws:
      Exception
    • getHistory

      @GetMapping("/types/{qname}/facets/{category}/{value}/history") @ResponseStatus(code=OK) public List<Facet> getHistory(@PathVariable String stewardKey, @PathVariable String modelKey, @PathVariable String versionNumber, @PathVariable String qname, @PathVariable Facet.Category category, @PathVariable String value, @RequestParam(required=false,defaultValue="false") boolean includePreRelease) throws Exception
      Get the history of the facet with the given fields.
      Parameters:
      includePreRelease - - True to return a result from a pre-release if applicable; false to iterate until an official version is reached.
      Throws:
      Exception