public class MediaObjectDAO extends SolrDAO
MAX_DOCUMENT_COUNT, SOLR_COMMIT_WITHIN, SOLR_FIELD_ID
Constructor and Description |
---|
MediaObjectDAO() |
Modifier and Type | Method and Description |
---|---|
java.util.List<java.lang.String> |
getMediaObjectIds(UserIdentity authenticatedUser,
DataGroups dataGroups,
Limits limits,
java.util.EnumSet<CAContentCore.ServiceType> serviceTypes,
long[] userIdFilter,
MediaObjectList mediaObjectTerms) |
MediaObjectList |
getMediaObjects(DataGroups dataGroups,
Limits limits,
java.util.EnumSet<MediaUrlValidator.MediaType> mediaTypes,
java.util.EnumSet<CAContentCore.ServiceType> serviceTypes,
java.util.Collection<java.lang.String> mediaObjectIds,
long[] userIdFilter) |
org.apache.solr.client.solrj.response.QueryResponse |
getSuggestions(UserIdentity authenticatedUser,
DataGroups dataGroups,
Limits limits,
java.lang.String query)
Suggestion/Autocomplete from Solr
|
boolean |
insert(MediaObjectList objects) |
boolean |
remove(java.util.Collection<java.lang.String> mediaobjectIds)
This will also automatically remove any associations between the given media objects and their photos.
|
void |
resolveObjectIds(MediaObjectList mediaObjects)
Sets all missing ids for the given media objects if ids are found.
|
MediaObjectList |
search(UserIdentity authenticatedUser,
DataGroups dataGroups,
Limits limits,
java.util.EnumSet<MediaUrlValidator.MediaType> mediaTypes,
java.util.EnumSet<CAContentCore.ServiceType> serviceTypes,
SortOptions sortOptions,
long[] userIdFilter,
MediaObjectList mediaObjectTerms)
Note that because of solr limitations, the media object count cannot exceed MAX_FILTER_COUNT.
|
boolean |
update(MediaObjectList objects) |
boolean |
updateIfNewer(MediaObjectList objects) |
getSolrTemplate, setApplicationContext
public MediaObjectDAO()
public boolean insert(MediaObjectList objects)
objects
- public void resolveObjectIds(MediaObjectList mediaObjects)
mediaObjects
- public boolean updateIfNewer(MediaObjectList objects)
objects
- public boolean update(MediaObjectList objects)
objects
- public boolean remove(java.util.Collection<java.lang.String> mediaobjectIds)
mediaobjectIds
- public MediaObjectList getMediaObjects(DataGroups dataGroups, Limits limits, java.util.EnumSet<MediaUrlValidator.MediaType> mediaTypes, java.util.EnumSet<CAContentCore.ServiceType> serviceTypes, java.util.Collection<java.lang.String> mediaObjectIds, long[] userIdFilter) throws java.lang.IllegalArgumentException
dataGroups
- limits
- mediaTypes
- target media types for the retrievalserviceTypes
- mediaObjectIds
- userIdFilter
- java.lang.IllegalArgumentException
- on bad query termspublic java.util.List<java.lang.String> getMediaObjectIds(UserIdentity authenticatedUser, DataGroups dataGroups, Limits limits, java.util.EnumSet<CAContentCore.ServiceType> serviceTypes, long[] userIdFilter, MediaObjectList mediaObjectTerms)
authenticatedUser
- dataGroups
- limits
- serviceTypes
- userIdFilter
- mediaObjectTerms
- list of terms to use for search. Note: if the objects have mediaObjectIds set, these will be directly used as filterpublic MediaObjectList search(UserIdentity authenticatedUser, DataGroups dataGroups, Limits limits, java.util.EnumSet<MediaUrlValidator.MediaType> mediaTypes, java.util.EnumSet<CAContentCore.ServiceType> serviceTypes, SortOptions sortOptions, long[] userIdFilter, MediaObjectList mediaObjectTerms) throws java.lang.IllegalArgumentException
authenticatedUser
- dataGroups
- limits
- mediaTypes
- list of target media types for the searchserviceTypes
- sortOptions
- userIdFilter
- mediaObjectTerms
- list of terms to use for search. Note: if the objects have mediaObjectIds set, these will be directly used as filterjava.lang.IllegalArgumentException
- on bad valuespublic org.apache.solr.client.solrj.response.QueryResponse getSuggestions(UserIdentity authenticatedUser, DataGroups dataGroups, Limits limits, java.lang.String query)
authenticatedUser
- dataGroups
- filters based on MediaObjectType. For applicable values see MediaObject.MediaObjectType.fromDataGroups(DataGroups)
.limits
- query
- the term to be searched for.Copyright © 2015 Tampere University of Technology, Pori Department.