Package gov.niem.tools.api.search
Class SearchController
java.lang.Object
gov.niem.tools.api.search.SearchController
REST controller for database searches for NIEM and community model content.
-
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionorg.springframework.data.domain.Page<Property> getPropertySearch(jakarta.servlet.http.HttpServletRequest request, jakarta.servlet.http.HttpServletResponse response, String niemVersionNumber, String[] token, String[] substring, String[] prefix, String[] type, Boolean isAbstract, Boolean isElement, Namespace.Category[] namespaceCategory, SearchService.SortOrder sortOrder, int page) Search properties based on the given criteria.getPropertySearchCmf(jakarta.servlet.http.HttpServletRequest request, jakarta.servlet.http.HttpServletResponse response, String niemVersionNumber, String[] token, String[] substring, String[] prefix, String[] type, Boolean isAbstract, Boolean isElement, Namespace.Category[] namespaceCategory, SearchService.SortOrder sortOrder, Integer page, Config.AppMediaType mediaType) Search properties in the database based on the given criteria and return results in CMF.org.springframework.data.domain.Page<Type> getTypeSearch(jakarta.servlet.http.HttpServletRequest request, jakarta.servlet.http.HttpServletResponse response, String niemVersionNumber, String[] token, String[] substring, String[] prefix, Type.Category category, Namespace.Category[] namespaceCategory, SearchService.SortOrder sortOrder, int page) Search types based on given criteria.getTypeSearchCmf(jakarta.servlet.http.HttpServletRequest request, jakarta.servlet.http.HttpServletResponse response, String niemVersionNumber, String[] token, String[] substring, String[] prefix, Type.Category category, Namespace.Category[] namespaceCategory, SearchService.SortOrder sortOrder, Integer page, Config.AppMediaType mediaType) Search types based on given criteria and returns results in CMF.voidindex()
-
Constructor Details
-
SearchController
public SearchController()
-
-
Method Details
-
index
@GetMapping("/search/index") public void index() -
getPropertySearch
@GetMapping("/search/properties") @ResponseStatus(code=OK) public org.springframework.data.domain.Page<Property> getPropertySearch(jakarta.servlet.http.HttpServletRequest request, jakarta.servlet.http.HttpServletResponse response, @RequestParam(required=false) String niemVersionNumber, @RequestParam(required=false) String[] token, @RequestParam(required=false) String[] substring, @RequestParam(required=false) String[] prefix, @RequestParam(required=false) String[] type, @RequestParam(required=false) Boolean isAbstract, @RequestParam(required=false) Boolean isElement, @RequestParam(required=false) Namespace.Category[] namespaceCategory, @RequestParam(required=false) SearchService.SortOrder sortOrder, @RequestParam(required=false,defaultValue="0") int page) Search properties based on the given criteria.- Parameters:
niemVersionNumber- A base NIEM version number (e.g., "5.2") to search for NIEM and community content. Defaults to the current NIEM version if not provided.token- Search for full tokens in component names and definitions with stemming. Example: "arm" returns property names with "Arm", "Armed", and "Arming" but does not return "Alarm", "Firearm", "Harm", etc.substring- Search for partial text in component names and definitions. Example: "arm" returns property names with "Arm", "Armed", "Arming", "Alarm", "Firearm", "Harm", etc.prefix- Filter results on the given prefix(es)type- Filter results by substring matching on one of the given types. Example: ["text", "boolean"] matches properties with types that include nc:TextType and niem-xs:boolean.isAbstract- True if only abstract properties should be returned; false if only non-abstract (concrete) properties should be returned. Omit parameter to return either kind.isElement- True if only element properties should be returned; false if only attribute properties should be returned. Omit parameter to return either kind.page- Page number of results to return. Defaults to 0 (first page).
-
getPropertySearchCmf
@GetMapping("/search/properties/formats/cmf") @ResponseStatus(code=OK) public Object getPropertySearchCmf(jakarta.servlet.http.HttpServletRequest request, jakarta.servlet.http.HttpServletResponse response, @RequestParam(required=false) String niemVersionNumber, @RequestParam(required=false) String[] token, @RequestParam(required=false) String[] substring, @RequestParam(required=false) String[] prefix, @RequestParam(required=false) String[] type, @RequestParam(required=false) Boolean isAbstract, @RequestParam(required=false) Boolean isElement, @RequestParam(required=false) Namespace.Category[] namespaceCategory, @RequestParam(required=false) SearchService.SortOrder sortOrder, @RequestParam(required=false,defaultValue="0") Integer page, @RequestParam(required=false,defaultValue="json") Config.AppMediaType mediaType) throws Exception Search properties in the database based on the given criteria and return results in CMF.- Parameters:
niemVersionNumber- A base NIEM version number (e.g., "5.2") to search for NIEM and community content. Defaults to the current NIEM version if not provided.token- Search for full tokens in component names and definitions with stemming. Example: "arm" returns property names with "Arm", "Armed", and "Arming" but does not return "Alarm", "Firearm", "Harm", etc.substring- Search for partial text in component names and definitions. Example: "arm" returns property names with "Arm", "Armed", "Arming", "Alarm", "Firearm", "Harm", etc.prefix- Filter results on the given prefix(es)type- Filter results by substring matching on one of the given types. Example: ["text", "boolean"] matches properties with types that include nc:TextType and niem-xs:boolean.isAbstract- True if only abstract properties should be returned; false if only non-abstract (concrete) properties should be returned. Omit parameter to return either kind.isElement- True if only element properties should be returned; false if only attribute properties should be returned. Omit parameter to return either kind.page- Page number of results to return. Defaults to 0.- Throws:
Exception
-
getTypeSearch
@GetMapping("/search/types") @ResponseStatus(code=OK) public org.springframework.data.domain.Page<Type> getTypeSearch(jakarta.servlet.http.HttpServletRequest request, jakarta.servlet.http.HttpServletResponse response, @RequestParam(required=false) String niemVersionNumber, @RequestParam(required=false) String[] token, @RequestParam(required=false) String[] substring, @RequestParam(required=false) String[] prefix, @RequestParam(required=false) Type.Category category, @RequestParam(required=false) Namespace.Category[] namespaceCategory, @RequestParam(required=false) SearchService.SortOrder sortOrder, @RequestParam(required=false,defaultValue="0") int page) Search types based on given criteria.- Parameters:
niemVersionNumber- A base NIEM version number (e.g., "5.2") to search for NIEM and community content. Defaults to the current NIEM version if not provided.token- Search for full tokens in component names and definitions with stemming. Example: "arm" returns property names with "Arm", "Armed", and "Arming" but does not return "Alarm", "Firearm", "Harm", etc.substring- Search for partial text in component names and definitions. Example: "arm" returns property names with "Arm", "Armed", "Arming", "Alarm", "Firearm", "Harm", etc.prefix- Filter results on the given prefix(es)page- Page number of results to return. Defaults to 0.
-
getTypeSearchCmf
@GetMapping("/search/types/formats/cmf") @ResponseStatus(code=OK) public Object getTypeSearchCmf(jakarta.servlet.http.HttpServletRequest request, jakarta.servlet.http.HttpServletResponse response, @RequestParam(required=false) String niemVersionNumber, @RequestParam(required=false) String[] token, @RequestParam(required=false) String[] substring, @RequestParam(required=false) String[] prefix, @RequestParam(required=false) Type.Category category, @RequestParam(required=false) Namespace.Category[] namespaceCategory, @RequestParam(required=false) SearchService.SortOrder sortOrder, @RequestParam(required=false,defaultValue="0") Integer page, @RequestParam(required=false,defaultValue="json") Config.AppMediaType mediaType) throws Exception Search types based on given criteria and returns results in CMF.- Parameters:
niemVersionNumber- A base NIEM version number (e.g., "5.2") to search for NIEM and community content. Defaults to the current NIEM version if not provided.token- Search for full tokens in component names and definitions with stemming. Example: "arm" returns property names with "Arm", "Armed", and "Arming" but does not return "Alarm", "Firearm", "Harm", etc.substring- Search for partial text in component names and definitions. Example: "arm" returns property names with "Arm", "Armed", "Arming", "Alarm", "Firearm", "Harm", etc.prefix- Filter results on the given prefix(es)page- Page number of results to return. Defaults to 0.- Throws:
Exception
-