Interface RecognizedParamsExtractor

    • Method Detail

      • rpeLogger

        default org.apache.commons.logging.Log rpeLogger()
      • getRecognizedParams

        default Params.RecognizedParams getRecognizedParams​(org.springframework.extensions.webscripts.WebScriptRequest req)
        Finds the formal set of params that any rest service could potentially have passed in as request params
        Parameters:
        req - WebScriptRequest
        Returns:
        RecognizedParams a POJO containing the params for use with the Params objects
      • getFilter

        default BeanPropertiesFilter getFilter​(String filterParams,
                                               List<String> selectList)
        Takes the web request and looks for a "fields" parameter (otherwise deprecated "properties" parameter). Parses the parameter and produces a list of bean properties to use as a filter A SimpleBeanPropertyFilter it returned that uses the bean properties. If no filter param is set then a default BeanFilter is returned that will never filter fields (ie. Returns all bean properties). If selectList is provided then it will take precedence (ie. be included) over the fields/properties filter for top-level entries (bean properties). For example, this will return entries from both select & properties, eg. select=abc,def&properties=id,name,ghi Note: it should be noted that API-generic "fields" clause does not currently work for sub-entries. Hence, even if the API-specific "select" clause allows selection of a sub-entries this cannot be used with "fields" filtering. For example, an API-specific method may implement and return "abc/blah", eg. select=abc/blah However the following will not return "abc/blah" if used with fields filtering, eg. select=abc/blah&fields=id,name,ghi If fields filtering is desired then it would require "abc" to be selected and returned as a whole, eg. select=abc&fields=id,name,ghi
        Parameters:
        filterParams -
        selectList -
        Returns:
      • getClause

        default List<String> getClause​(String param,
                                       String paramName)
        Gets the clause specificed in paramName
        Parameters:
        param -
        paramName -
        Returns:
        bean property names potentially using JSON Pointer syntax
      • getWhereClause

        default Query getWhereClause​(String whereParam)
                              throws InvalidQueryException
        Takes the "where" parameter and turns it into a Java Object that can be used for querying
        Parameters:
        whereParam - String
        Returns:
        Query a parsed version of the where clause, represented in Java
        Throws:
        InvalidQueryException
      • getSort

        default List<SortColumn> getSort​(String sortParams)
        Takes the Sort parameter as a String and parses it into a List of SortColumn objects. The format is a comma seperated list of "columnName sortDirection", e.g. "name DESC, age ASC". It is not case sensitive and the sort direction is optional It default to sort ASCENDING.
        Parameters:
        sortParams - - String passed in on the request
        Returns:
        - the sort columns or an empty list if the params were invalid.
      • findPaging

        default Paging findPaging​(org.springframework.extensions.webscripts.WebScriptRequest req)
        Find paging setings based on the request parameters.
        Parameters:
        req -
        Returns:
        Paging
      • getPaging

        default Paging getPaging​(String skip,
                                 String maxItems)
        Gets the default paging object
        Parameters:
        skip -
        maxItems -
        Returns:
      • getFilter

        default BeanPropertiesFilter getFilter​(String filterParams)
        Takes the web request and looks for a "fields" parameter (otherwise deprecated "properties" parameter). Parses the parameter and produces a list of bean properties to use as a filter A SimpleBeanPropertyFilter it returned that uses the bean properties. If no filter param is set then a default BeanFilter is returned that will never filter fields (ie. Returns all bean properties).
        Parameters:
        filterParams - String
        Returns:
        BeanPropertyFilter - if no parameter then returns a new ReturnAllBeanProperties class
      • getRelationFilter

        default Map<String,​BeanPropertiesFilter> getRelationFilter​(String filterParams)
        Takes the web request and looks for a "relations" parameter Parses the parameter and produces a list of bean properties to use as a filter A SimpleBeanPropertiesFilter it returned that uses the properties If no filter param is set then a default BeanFilter is returned that will never filter properties (ie. Returns all bean properties).
        Parameters:
        filterParams - String
        Returns:
        BeanPropertiesFilter - if no parameter then returns a new ReturnAllBeanProperties class
      • getRequestParameters

        default Map<String,​String[]> getRequestParameters​(org.springframework.extensions.webscripts.WebScriptRequest req)
        Finds all request parameters that aren't already know about (eg. not paging or filter params) and returns them for use.
        Parameters:
        req - - the WebScriptRequest object
        Returns:
        the request parameters