Class AbstractIdentifiableController<T extends de.digitalcollections.model.identifiable.Identifiable>

    • Constructor Detail

      • AbstractIdentifiableController

        public AbstractIdentifiableController()
    • Method Detail

      • extractNamespaceAndId

        public static org.apache.commons.lang3.tuple.Pair<String,​String> extractNamespaceAndId​(javax.servlet.http.HttpServletRequest request)
                                                                                              throws ValidationException
        Extract the namespace and identifier from the HttpServletRequest
        Parameters:
        request - the HttpServletRequest
        Returns:
        Pair of namespace and identifier
        Throws:
        ValidationException - in case of a missing namespace or malformed parameter
      • find

        protected de.digitalcollections.model.list.paging.PageResponse<T> find​(int pageNumber,
                                                                               int pageSize,
                                                                               List<de.digitalcollections.model.list.sorting.Order> sortBy,
                                                                               String searchTerm,
                                                                               String labelTerm,
                                                                               Locale labelLanguage,
                                                                               Object... filterCriteria)
        The usual find implementation

        For filterCriteria we use a varargs parameter instead of a Map<String, FilterCriterion<?>>, because the beautiful shorthand Map.of does not support null values and so it would make things unnecessary difficult inside the extending class.

        Do not mess things up by passing null for filterCriteria if there are not any. Since it is varargs you can just omit this parameter.

        Parameters:
        pageNumber -
        pageSize -
        sortBy -
        searchTerm -
        labelTerm -
        labelLanguage -
        filterCriteria - must be pairs of a String, the expression, and the corresponding FilterCriterion
        Returns:
      • addLabelFilter

        protected void addLabelFilter​(de.digitalcollections.model.list.paging.PageRequest pageRequest,
                                      String labelTerm,
                                      Locale labelLanguage)