@ProviderType public interface SocialResourceProvider extends ResourceProvider, ModifyingResourceProvider, QueriableResourceProvider
Modifier and Type | Interface and Description |
---|---|
static interface |
SocialResourceProvider.PrefetchPerResult
Used with SocialResourcePrefetch to specify additional resources to fetch.
|
Modifier and Type | Field and Description |
---|---|
static java.lang.String |
JSRPQUERY
JSRP Query language.
|
static java.lang.String |
PARAM_BROWSER_LANGUAGE
browser language param.
|
static java.lang.String |
PARAM_EXPECTED_LANGUAGE
expected language param, this is explicitly set in the search widget, acts as a user override.
|
static java.lang.String |
PARAM_PAGE_LANGUAGE
page language param.
|
static java.lang.String |
PARAM_USER_PREFFERED_LANGUAGE
User preferred language param, read from user profile
|
static java.lang.String |
SOLRQUERY
Used in factory.
|
LANGUAGES
OWNS_ROOTS, RESOURCE_TYPE_SYNTHETIC, ROOTS, SERVICE_NAME, USE_RESOURCE_ACCESS_SECURITY
Modifier and Type | Method and Description |
---|---|
java.util.Map<java.lang.String,java.lang.Long> |
countChildren(java.util.List<Resource> parent,
java.lang.String baseType,
boolean visibleOnly)
return counts of all children or filtered (visible) children (not hidden due to denied/flagged as hidden).
|
long |
countChildren(Resource parent)
return count of all children (one level).
|
long |
countChildren(Resource parent,
boolean visibleOnly)
return count of all children or filtered (visible) children (not hidden due to denied/flagged as hidden).
|
long |
countChildren(Resource parent,
java.lang.String baseType)
return count of all children of specific type (one level).
|
long |
countChildren(Resource parent,
java.lang.String baseType,
boolean visibleOnly)
return count of all children or filtered (visible) children (not hidden due to denied/flagged as hidden).
|
void |
decrement(Resource resource,
java.lang.String property)
Subtract one from the specified counter property.
|
SocialResourceSearchResult<Resource> |
find(ResourceResolver resolver,
java.lang.String component,
java.lang.String query,
java.util.List<SearchSortField> sortFields,
int offset,
int limit,
boolean requiresTotal)
Return a result list of resources given a component and a query.
|
SocialResourceSearchResult<Resource> |
find(ResourceResolver resolver,
java.lang.String component,
java.lang.String query,
java.util.List<SearchSortField> sortFields,
int offset,
int limit,
boolean requiresTotal,
java.lang.String fieldLanguage,
java.util.Map<java.lang.String,java.lang.Object> signals)
Return a result list of resources given a component and a query.
|
java.util.Map<java.lang.String,java.util.Map<java.lang.String,java.lang.Integer>> |
findFacetRanges(ResourceResolver resolver,
java.util.List<FacetRangeField> facetRanges,
java.lang.String resourceTypeFilter,
java.lang.String componentFilter,
int count)
Search Collections findFacets for cloud storage resources.
|
java.util.Map<java.lang.String,java.util.Map<java.lang.String,java.lang.Integer>> |
findFacetRanges(ResourceResolver resolver,
java.util.List<FacetRangeField> facetRanges,
java.lang.String resourceTypeFilter,
java.lang.String componentFilter,
int count,
boolean visibleOnly)
Search Collections findFacets for cloud storage resources.
|
FacetSearchResult |
findFacets(ResourceResolver resolver,
java.util.List<java.lang.String> fieldNames,
java.util.List<FacetRangeField> facetRanges,
java.lang.String resourceTypeFilter,
java.lang.String componentFilter,
int count)
Search Collections findFacets for cloud storage resources.
|
FacetSearchResult |
findFacets(ResourceResolver resolver,
java.util.List<java.lang.String> fieldNames,
java.util.List<FacetRangeField> facetRanges,
java.lang.String resourceTypeFilter,
java.lang.String componentFilter,
int count,
boolean visibleOnly)
Search Collections findFacets for cloud storage resources.
|
FacetSearchResult |
findFacets(ResourceResolver resolver,
java.util.List<java.lang.String> fieldNames,
java.util.List<FacetRangeField> facetRanges,
java.lang.String resourceTypeFilter,
java.lang.String componentFilter,
int count,
boolean visibleOnly,
boolean includeChildren)
Search Collections findFacets for cloud storage resources.
|
SocialResourceSearchResult<java.util.Map<java.lang.String,java.lang.Object>> |
findFacets(ResourceResolver resolver,
java.util.List<java.lang.String> parentFilter,
java.util.List<java.lang.String> fieldNames,
java.util.List<FacetRangeField> facetRanges,
java.lang.String scoredQueryString,
int maxFacetCount,
java.util.List<SearchSortField> sortFields,
int offset,
int pageSize)
A faceted search function that can handle both range and non-range properties.
|
java.util.Map<java.lang.String,java.util.Map<java.lang.String,java.lang.Integer>> |
findFacets(ResourceResolver resolver,
java.util.List<java.lang.String> fieldNames,
java.lang.String resourceTypeFilter,
java.lang.String componentFilter,
int count)
Search Collections findFacets for cloud storage resources.
|
java.util.Map<java.lang.String,java.util.Map<java.lang.String,java.lang.Integer>> |
findFacets(ResourceResolver resolver,
java.util.List<java.lang.String> fieldNames,
java.lang.String resourceTypeFilter,
java.lang.String componentFilter,
int count,
boolean visibleOnly)
Search Collections findFacets for cloud storage resources.
|
java.util.Map<java.lang.String,java.util.Map<java.lang.String,java.lang.Integer>> |
findFacets(ResourceResolver resolver,
java.util.List<java.lang.String> fieldNames,
java.lang.String resourceTypeFilter,
java.lang.String componentFilter,
int count,
boolean isVisibleOnly,
boolean includeChildren)
Search Collections findFacets for cloud storage resources.
|
java.lang.String |
getASIPath()
Get the ASI path (provider root).
|
java.io.InputStream |
getAttachmentInputStream(ResourceResolver resolver,
java.lang.String path)
Return an attachment resource as an InputStream.
|
int |
getCommentIndex(java.lang.String path,
java.lang.String baseType,
ResourceResolver resourceResolver,
java.lang.String commentToCheck,
boolean visibleOnly)
Get index of a given reply amongst all replies of a post.
|
java.lang.String |
getContentType()
Return the content type for pulling.
|
long |
getCount(Resource resource,
java.lang.String property)
Return the value of the counter.
|
SocialResourceSearchResult<Resource> |
getCountAndListChildren(java.lang.String path,
java.lang.String baseType,
ResourceResolver resourceResolver,
int offset,
int size,
java.util.List<java.util.Map.Entry<java.lang.String,java.lang.Boolean>> sortBy,
boolean visibleOnly)
Get a count of the children of the resource at the path, filtered by child base type and visibility if
requested.
|
java.util.List<java.lang.String> |
getLanguages()
Return a list of the languages that this provider can use to query resources.
|
ProviderMetaData |
getMetaData()
Gets details about the provider.
|
java.util.Iterator<Resource> |
getMLTResults(ResourceResolver resolver,
java.lang.String query,
java.lang.String statusFilter,
java.lang.String resourceTypeFilter,
java.lang.String componentFilter,
java.lang.String[] mltFields,
int maxResults,
int minTermFreq,
int minDocFreq)
Deprecated.
Solr and Lucene only use the first mltField when using a stream as the document (our use case) See:
https://issues.apache.org/jira/browse/SOLR-5351?
|
java.util.Iterator<Resource> |
getMLTResults(ResourceResolver resolver,
java.lang.String query,
java.lang.String statusFilter,
java.lang.String resourceTypeFilter,
java.lang.String componentFilter,
java.lang.String mltField,
int maxResults,
int minTermFreq,
int minDocFreq)
Return a list of related posts, given a query.
|
java.util.Map<java.lang.String,Resource> |
getResources(ResourceResolver resolver,
java.util.List<java.lang.String> resources)
Fetch a group of resources all managed by this resource provider
|
void |
increment(Resource resource,
java.lang.String property)
Add one to the specified counter property.
|
void |
incrementBy(Resource resource,
java.util.Map<java.lang.String,java.lang.Long> incrementMap)
Add an arbitrary increment to the specified properties.
|
void |
incrementBy(Resource resource,
java.lang.String property,
java.lang.Long increment)
Add an arbitrary increment to the specified counter property.
|
java.util.Iterator<Resource> |
listChildren(java.lang.String path,
ResourceResolver resourceResolver,
int offset,
int size,
java.util.List<java.util.Map.Entry<java.lang.String,java.lang.Boolean>> sortBy)
Get a list of the children of the resource at the path.
|
java.util.Iterator<Resource> |
listChildren(java.lang.String path,
java.lang.String baseType,
ResourceResolver resourceResolver,
int offset,
int size,
java.util.List<java.util.Map.Entry<java.lang.String,java.lang.Boolean>> sortBy)
Get a list of the children of the resource at the path.
|
java.util.Iterator<Resource> |
listChildren(java.lang.String path,
java.lang.String baseType,
ResourceResolver resourceResolver,
int offset,
int size,
java.util.List<java.util.Map.Entry<java.lang.String,java.lang.Boolean>> sortBy,
boolean visibleOnly)
Get a list of the children of the resource at the path.
|
Resource |
move(ResourceResolver resolver,
java.lang.String srcAbsPath,
java.lang.String destAbsPath) |
void |
setConfig(SocialResourceConfiguration config)
Set the configuration for the provider.
|
commit, create, delete, hasChanges, revert
findResources, queryResources
getResource, getResource, listChildren
static final java.lang.String SOLRQUERY
static final java.lang.String JSRPQUERY
static final java.lang.String PARAM_USER_PREFFERED_LANGUAGE
static final java.lang.String PARAM_BROWSER_LANGUAGE
static final java.lang.String PARAM_PAGE_LANGUAGE
static final java.lang.String PARAM_EXPECTED_LANGUAGE
int getCommentIndex(java.lang.String path, java.lang.String baseType, ResourceResolver resourceResolver, java.lang.String commentToCheck, boolean visibleOnly)
path
- path to parentbaseType
- base type of children to return (SocialUtils.PN_BASETYPE value) can be null/emptyresourceResolver
- resolver to usecommentToCheck
- comment whose index need to be foundvisibleOnly
- whether to (true) return only visible documents, or (false) all documentsjava.util.Iterator<Resource> listChildren(java.lang.String path, ResourceResolver resourceResolver, int offset, int size, java.util.List<java.util.Map.Entry<java.lang.String,java.lang.Boolean>> sortBy)
path
- path to parentresourceResolver
- resolver to useoffset
- offset to start atsize
- number to returnsortBy
- order to return children injava.util.Iterator<Resource> listChildren(java.lang.String path, java.lang.String baseType, ResourceResolver resourceResolver, int offset, int size, java.util.List<java.util.Map.Entry<java.lang.String,java.lang.Boolean>> sortBy)
path
- path to parentbaseType
- base type of children to return (SocialUtils.PN_BASETYPE value) can be null/emptyresourceResolver
- resolver to useoffset
- offset to start atsize
- number to returnsortBy
- order to return children injava.util.Iterator<Resource> listChildren(java.lang.String path, java.lang.String baseType, ResourceResolver resourceResolver, int offset, int size, java.util.List<java.util.Map.Entry<java.lang.String,java.lang.Boolean>> sortBy, boolean visibleOnly)
path
- path to parentbaseType
- base type of children to return (SocialUtils.PN_BASETYPE value) can be null/emptyresourceResolver
- resolver to useoffset
- offset to start atsize
- number to returnsortBy
- order to return children invisibleOnly
- whether to (true) return only visible documents, or (false) all documentsSocialResourceSearchResult<Resource> getCountAndListChildren(java.lang.String path, java.lang.String baseType, ResourceResolver resourceResolver, int offset, int size, java.util.List<java.util.Map.Entry<java.lang.String,java.lang.Boolean>> sortBy, boolean visibleOnly)
path
- path to parentbaseType
- base type of children to return (SocialUtils.PN_BASETYPE value) can be null/emptyresourceResolver
- resolver to useoffset
- offset to start atsize
- number to returnsortBy
- order to return children invisibleOnly
- whether to (true) return only visible documents, or (false) all documentslong countChildren(Resource parent)
parent
- the parent resourcelong countChildren(Resource parent, java.lang.String baseType)
parent
- the parent resourcebaseType
- The social base type (SocialUtils.PN_BASETYPE value) of children to count (can be null/empty)long countChildren(Resource parent, boolean visibleOnly)
parent
- the parent resourcevisibleOnly
- if true, count only the 'visible' childrenlong countChildren(Resource parent, java.lang.String baseType, boolean visibleOnly)
parent
- the parent resourcebaseType
- The social base type (SocialUtils.PN_BASETYPE value) of children to count (can be null/empty)visibleOnly
- if true, count only the 'visible' childrenjava.util.Map<java.lang.String,java.lang.Long> countChildren(java.util.List<Resource> parent, java.lang.String baseType, boolean visibleOnly)
parent
- the parent resourcesbaseType
- The social base type (SocialUtils.PN_BASETYPE value) of children to count (can be null/empty)visibleOnly
- if true, count only the 'visible' childrenvoid setConfig(SocialResourceConfiguration config)
config
- The configurationjava.lang.String getASIPath()
@Deprecated java.util.Iterator<Resource> getMLTResults(ResourceResolver resolver, java.lang.String query, java.lang.String statusFilter, java.lang.String resourceTypeFilter, java.lang.String componentFilter, java.lang.String[] mltFields, int maxResults, int minTermFreq, int minDocFreq)
resolver
- The resource resolver.query
- The string to search for.statusFilter
- The filter on the status.resourceTypeFilter
- The resource type to filter on.componentFilter
- The path of the component we want to search on.mltFields
- Resource properties to search on. NOTE: Only first one is usedmaxResults
- The maximum results returned.minTermFreq
- The frequency which terms will be ignored in the source docminDocFreq
- The frequency at which words will be ignored which do not occur in at least this many docs.java.util.Iterator<Resource> getMLTResults(ResourceResolver resolver, java.lang.String query, java.lang.String statusFilter, java.lang.String resourceTypeFilter, java.lang.String componentFilter, java.lang.String mltField, int maxResults, int minTermFreq, int minDocFreq)
resolver
- The resource resolver.query
- The string to search for.statusFilter
- The filter on the status.resourceTypeFilter
- The resource type to filter on.componentFilter
- The path of the component we want to search on.mltField
- Resource property to search on.maxResults
- The maximum results returned.minTermFreq
- The frequency which terms will be ignored in the source docminDocFreq
- The frequency at which words will be ignored which do not occur in at least this many docs.SocialResourceSearchResult<Resource> find(ResourceResolver resolver, java.lang.String component, java.lang.String query, java.util.List<SearchSortField> sortFields, int offset, int limit, boolean requiresTotal)
resolver
- The resource resolver.component
- The component for filtering onquery
- The lucene querysortFields
- fields to use in sort and sort directionoffset
- starting offset to return results atlimit
- maximum number of results to returnrequiresTotal
- true iff the total number of matches needs to be returned in the
SocialResourceSearchResultSocialResourceSearchResult<Resource> find(ResourceResolver resolver, java.lang.String component, java.lang.String query, java.util.List<SearchSortField> sortFields, int offset, int limit, boolean requiresTotal, java.lang.String fieldLanguage, java.util.Map<java.lang.String,java.lang.Object> signals)
resolver
- The resource resolver.component
- The component for filtering onquery
- The lucene querysortFields
- fields to use in sort and sort directionoffset
- starting offset to return results atlimit
- maximum number of results to returnrequiresTotal
- true iff the total number of matches needs to be returned in the
SocialResourceSearchResultfieldLanguage
- search will be queried against verbatim_fieldLanguage. This can be changed in the SOLR
request handler.signals
- Map containing field names with a map of values, user preferred language, browser language, page
language and user selected language in the search widget. These values are used by SOLR request
handler to determine the language of query string.java.util.Map<java.lang.String,java.util.Map<java.lang.String,java.lang.Integer>> findFacets(ResourceResolver resolver, java.util.List<java.lang.String> fieldNames, java.lang.String resourceTypeFilter, java.lang.String componentFilter, int count, boolean visibleOnly)
resolver
- ResourceResolver for current search permissionsfieldNames
- Fields for which facet counts wantedresourceTypeFilter
- Resource type filtercomponentFilter
- Component filtercount
- maximum results to returnvisibleOnly
- whether to filter by visibilityjava.util.Map<java.lang.String,java.util.Map<java.lang.String,java.lang.Integer>> findFacets(ResourceResolver resolver, java.util.List<java.lang.String> fieldNames, java.lang.String resourceTypeFilter, java.lang.String componentFilter, int count)
resolver
- ResourceResolver for current search permissionsfieldNames
- Fields for which facet counts wantedresourceTypeFilter
- Resource type filtercomponentFilter
- Component filtercount
- maximum results to returnjava.util.Map<java.lang.String,java.util.Map<java.lang.String,java.lang.Integer>> findFacets(ResourceResolver resolver, java.util.List<java.lang.String> fieldNames, java.lang.String resourceTypeFilter, java.lang.String componentFilter, int count, boolean isVisibleOnly, boolean includeChildren)
resolver
- ResourceResolver for current search permissionsfieldNames
- Fields for which facet counts wantedresourceTypeFilter
- Resource type filtercomponentFilter
- Component filtercount
- maximum results to returnisVisibleOnly
- whether to filter by visibilityincludeChildren
- Include subpaths for searchFacetSearchResult findFacets(ResourceResolver resolver, java.util.List<java.lang.String> fieldNames, java.util.List<FacetRangeField> facetRanges, java.lang.String resourceTypeFilter, java.lang.String componentFilter, int count, boolean visibleOnly)
resolver
- ResourceResolver for current search permissionsfieldNames
- Fields for which facet counts wantedfacetRanges
- Fields for which facet range counts wantedresourceTypeFilter
- Resource type filtercomponentFilter
- Component filtercount
- maximum results to returnvisibleOnly
- whether to filter by visibilityFacetSearchResult findFacets(ResourceResolver resolver, java.util.List<java.lang.String> fieldNames, java.util.List<FacetRangeField> facetRanges, java.lang.String resourceTypeFilter, java.lang.String componentFilter, int count, boolean visibleOnly, boolean includeChildren)
resolver
- ResourceResolver for current search permissionsfieldNames
- Fields for which facet counts wantedfacetRanges
- Fields for which facet range counts wantedresourceTypeFilter
- Resource type filtercomponentFilter
- Component filtercount
- maximum results to returnvisibleOnly
- whether to filter by visibilityincludeChildren
- Include results from paths subtreeFacetSearchResult findFacets(ResourceResolver resolver, java.util.List<java.lang.String> fieldNames, java.util.List<FacetRangeField> facetRanges, java.lang.String resourceTypeFilter, java.lang.String componentFilter, int count)
resolver
- ResourceResolver for current search permissionsfieldNames
- Fields for which facet counts wantedfacetRanges
- Fields for which facet range counts wantedresourceTypeFilter
- Resource type filtercomponentFilter
- Component filtercount
- maximum results to returnjava.util.Map<java.lang.String,java.util.Map<java.lang.String,java.lang.Integer>> findFacetRanges(ResourceResolver resolver, java.util.List<FacetRangeField> facetRanges, java.lang.String resourceTypeFilter, java.lang.String componentFilter, int count, boolean visibleOnly)
resolver
- ResourceResolver for current search permissionsfacetRanges
- Fields for which facet range counts wantedresourceTypeFilter
- Resource type filtercomponentFilter
- Component filtercount
- maximum results to returnvisibleOnly
- whether to filter by visibilityjava.util.Map<java.lang.String,java.util.Map<java.lang.String,java.lang.Integer>> findFacetRanges(ResourceResolver resolver, java.util.List<FacetRangeField> facetRanges, java.lang.String resourceTypeFilter, java.lang.String componentFilter, int count)
resolver
- ResourceResolver for current search permissionsfacetRanges
- Fields for which facet range counts wantedresourceTypeFilter
- Resource type filtercomponentFilter
- Component filtercount
- maximum results to returnjava.util.List<java.lang.String> getLanguages()
java.lang.String getContentType()
void increment(Resource resource, java.lang.String property) throws PersistenceException
resource
- - the resource to update.property
- - the name of the counter.PersistenceException
- on errorvoid decrement(Resource resource, java.lang.String property) throws PersistenceException
resource
- - the resource to update.property
- - the name of the counter.PersistenceException
- on errorvoid incrementBy(Resource resource, java.lang.String property, java.lang.Long increment) throws PersistenceException
resource
- - the resource to update.property
- - the name of the counter.increment
- - the amount to increase or decrease the counter.PersistenceException
- on errorvoid incrementBy(Resource resource, java.util.Map<java.lang.String,java.lang.Long> incrementMap) throws PersistenceException
resource
- the resource.incrementMap
- map with properties and their increment/decrement values.PersistenceException
- on errorlong getCount(Resource resource, java.lang.String property)
resource
- - the resource to query.property
- - the name of the counter.ProviderMetaData getMetaData()
ProviderMetaData
java.util.Map<java.lang.String,Resource> getResources(ResourceResolver resolver, java.util.List<java.lang.String> resources)
resolver
- the resolver to useresources
- the list of resourcesjava.io.InputStream getAttachmentInputStream(ResourceResolver resolver, java.lang.String path) throws java.io.IOException
resolver
- resolver to use to read the resourcepath
- path to the attachment resourcejava.io.IOException
- on errorResource move(ResourceResolver resolver, java.lang.String srcAbsPath, java.lang.String destAbsPath) throws PersistenceException
PersistenceException
SocialResourceSearchResult<java.util.Map<java.lang.String,java.lang.Object>> findFacets(ResourceResolver resolver, java.util.List<java.lang.String> parentFilter, java.util.List<java.lang.String> fieldNames, java.util.List<FacetRangeField> facetRanges, java.lang.String scoredQueryString, int maxFacetCount, java.util.List<SearchSortField> sortFields, int offset, int pageSize)
resolver
- ResourceResolver for current search permissionsparentFilter
- the paths to the parents (probably components) being searchedfieldNames
- the non-range properties that should be facetedfacetRanges
- the range properties that should be facetedscoredQueryString
- the query string that should be used wrt scoring the results.maxFacetCount
- the number of facets to return for each of the properties being facetedsortFields
- the sort criteria for the returned resultsoffset
- which page to returnpageSize
- the size of the page (0 if only facets should be returned)Copyright © 2010 - 2020 Adobe. All Rights Reserved