Class AbstractIdentifiableController<T extends de.digitalcollections.model.identifiable.Identifiable>
- java.lang.Object
-
- de.digitalcollections.cudami.server.controller.identifiable.AbstractIdentifiableController<T>
-
- Direct Known Subclasses:
CollectionController,CorporateBodyController,DigitalObjectController,EntityController,FamilyNameController,FileResourceMetadataController,GeoLocationController,GivenNameController,HeadwordEntryController,HumanSettlementController,IdentifiableController,ImageFileResourceController,ItemController,LinkedDataFileResourceController,PersonController,ProjectController,TopicController,WebpageController,WebsiteController,WorkController
public abstract class AbstractIdentifiableController<T extends de.digitalcollections.model.identifiable.Identifiable> extends Object
-
-
Constructor Summary
Constructors Constructor Description AbstractIdentifiableController()
-
Method Summary
All Methods Static Methods Instance Methods Abstract Methods Concrete Methods Modifier and Type Method Description protected voidaddLabelFilter(de.digitalcollections.model.list.paging.PageRequest pageRequest, String labelTerm, Locale labelLanguage)static org.apache.commons.lang3.tuple.Pair<String,String>extractNamespaceAndId(javax.servlet.http.HttpServletRequest request)Extract the namespace and identifier from the HttpServletRequestprotected 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 implementationorg.springframework.http.ResponseEntity<T>getByIdentifier(javax.servlet.http.HttpServletRequest request)protected abstract IdentifiableService<T>getService()
-
-
-
Method Detail
-
getByIdentifier
public org.springframework.http.ResponseEntity<T> getByIdentifier(javax.servlet.http.HttpServletRequest request) throws IdentifiableServiceException, ValidationException
-
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 implementationFor
filterCriteriawe use a varargs parameter instead of aMap<String, FilterCriterion<?>>, because the beautiful shorthandMap.ofdoes not support null values and so it would make things unnecessary difficult inside the extending class.Do not mess things up by passing
nullforfilterCriteriaif 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 aString, the expression, and the correspondingFilterCriterion- Returns:
-
getService
protected abstract IdentifiableService<T> getService()
-
-