public class UGCCResourceProvider extends java.lang.Object implements CachingResourceProvider
SocialResourceProvider.PrefetchPerResult
Modifier and Type | Field and Description |
---|---|
static java.lang.Integer |
QUERY_MAX_LENGTH
Max length for url that can be sent to AS.
|
INC
JSRPQUERY, PARAM_BROWSER_LANGUAGE, PARAM_EXPECTED_LANGUAGE, PARAM_PAGE_LANGUAGE, PARAM_USER_PREFFERED_LANGUAGE, SOLRQUERY
LANGUAGES
OWNS_ROOTS, RESOURCE_TYPE_SYNTHETIC, ROOTS, SERVICE_NAME, USE_RESOURCE_ACCESS_SECURITY
Constructor and Description |
---|
UGCCResourceProvider(SocialDataService client,
java.lang.String providerBase,
Externalizer externalizer,
CryptoSupport cryptoSupport,
ProviderCache documentCache,
CountCache allCountCache,
CountCache visibleCountCache,
AbstractCache<java.lang.String,java.util.Map<java.lang.String,java.util.Map<java.lang.String,java.lang.Integer>>> facetCache,
StringListCache stringListCache,
AbstractSchemaMapper mapper,
SRPConfigurationFactory srpConfigFactory)
Creates a new Resource Provider.
|
Modifier and Type | Method and Description |
---|---|
void |
clearCache()
Clear the cache.
|
void |
commit(ResourceResolver resourceResolver)
Commit all transient changes: create, delete and updates
|
static java.lang.String |
convertResourceTypeFilter(java.lang.String resourceTypeFilter)
Convert resource filter query to Solr format.
|
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 childType)
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).
|
Resource |
create(ResourceResolver resourceResolver,
java.lang.String path,
java.util.Map<java.lang.String,java.lang.Object> properties)
Create a new resource at the given path.
|
void |
decrement(Resource resource,
java.lang.String property)
Subtract one from the specified counter property.
|
void |
delete(ResourceResolver resourceResolver,
java.lang.String path)
Delete the resource at the given path.
|
java.lang.String |
facetRangeFieldHash(FacetRangeField rangeField)
Hash a range field for use as cache key.
|
SocialResourceSearchResult<Resource> |
find(ResourceResolver resolver,
java.lang.String component,
java.lang.String luceneQuery,
java.util.List<SearchSortField> sortFields,
int offset,
int limit,
boolean requiresTotal)
Search in AS.
|
SocialResourceSearchResult<Resource> |
find(ResourceResolver resolver,
java.lang.String component,
java.lang.String luceneQuery,
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> rangeFields,
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> rangeFields,
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> countFields,
java.util.List<FacetRangeField> rangeFields,
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> countFields,
java.util.List<FacetRangeField> rangeFields,
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> countFields,
java.util.List<FacetRangeField> rangeFields,
java.lang.String resourceTypeFilter,
java.lang.String componentFilter,
int count,
boolean visibleOnly,
boolean includeChidren)
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 visibleOnly,
boolean includeChildren)
Search Collections findFacets for cloud storage resources.
|
java.util.Iterator<Resource> |
findResources(ResourceResolver resourceResolver,
java.lang.String queryString,
java.lang.String language)
Searches for resources using the given query formulated in the given
language.
|
java.lang.String |
getASIPath()
Get the repository path associated with this provider.
|
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.lang.String |
getJcrAclPath(java.lang.String path)
Get the path that gives the permissions for the provided path.
|
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)
Return a list of related posts, given a query.
|
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.
|
Resource |
getResource(ResourceResolver resourceResolver,
HttpServletRequest request,
java.lang.String path)
Deprecated.
|
Resource |
getResource(ResourceResolver resourceResolver,
java.lang.String path)
Returns a resource from this resource provider or
null if
the resource provider cannot find it. |
java.util.Map<java.lang.String,Resource> |
getResources(ResourceResolver resolver,
java.util.List<java.lang.String> paths)
Fetch a group of resources all managed by this resource provider
|
Resource |
getResourceWithoutCheck(ResourceResolver resourceResolver,
java.lang.String path)
Skip checking the provider base when getting a "special" resource.
|
SocialDataService |
getSocialDataService()
Get the data service for this provider.
|
boolean |
hasChanges(ResourceResolver resourceResolver)
Are there any transient changes?
|
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(Resource parent)
|
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) |
java.util.Iterator<ValueMap> |
queryResources(ResourceResolver resourceResolver,
java.lang.String query,
java.lang.String language)
Queries the storage using the given query formulated in the given
language.
|
void |
revert(ResourceResolver resourceResolver)
Revert all transient changes: create, delete and updates.
|
void |
setCloudConfig(Configuration cloudConfig)
Deprecated.
use setConfig
|
void |
setConfig(SocialResourceConfiguration socialConfiguration)
Set the config associated with this provider.
|
void |
update(Resource resource)
Mark that this resource has been updated.
|
public static final java.lang.Integer QUERY_MAX_LENGTH
public UGCCResourceProvider(SocialDataService client, java.lang.String providerBase, Externalizer externalizer, CryptoSupport cryptoSupport, ProviderCache documentCache, CountCache allCountCache, CountCache visibleCountCache, AbstractCache<java.lang.String,java.util.Map<java.lang.String,java.util.Map<java.lang.String,java.lang.Integer>>> facetCache, StringListCache stringListCache, AbstractSchemaMapper mapper, SRPConfigurationFactory srpConfigFactory)
client
- Adobe Cloud Storage API ClientproviderBase
- Base location of the provider.externalizer
- Used to externalize urls stored in Adobe Cloud StoragecryptoSupport
- a CryptoSupport impldocumentCache
- the cache for docsvisibleCountCache
- the cache for visible countsallCountCache
- the cache for all countsfacetCache
- the cache for facetsmapper
- the schema mapperstringListCache
- StringListCachesrpConfigFactory
- the configuration factory@Deprecated public Resource getResource(ResourceResolver resourceResolver, HttpServletRequest request, java.lang.String path)
getResource(ResourceResolver, String)
null
if
the resource provider cannot find it. The path should have one of the
ResourceProvider.ROOTS
strings as its prefix.
This method is called to resolve a resource for the given request. The properties of the request, such as request parameters, may be use to parameterize the resource resolution. An example of such parameterization is support for a JSR-311 style resource provider to support the parameterized URL patterns.
getResource
in interface ResourceProvider
resourceResolver
- The ResourceResolver
to which the returned
Resource
is attached.request
- The requestpath
- The resource pathnull
If this provider does not have a resource for
the path.public SocialDataService getSocialDataService()
public Resource getResource(ResourceResolver resourceResolver, java.lang.String path)
null
if
the resource provider cannot find it. The path should have one of the ResourceProvider.ROOTS
strings as its prefix.
The resource provider must not return cached instances for a resource as
the resource resolver will update the resource metadata of the resource
at the end of the resolution process and this metadata might be different
depending on the full path of resource resolution passed into the
resource resolver.getResource
in interface ResourceProvider
resourceResolver
- The ResourceResolver
to which the returned Resource
is attached.path
- The full path of the resource.null
If this provider does not have a resource for
the path.public Resource getResourceWithoutCheck(ResourceResolver resourceResolver, java.lang.String path)
resourceResolver
- the resolverpath
- the pathpublic Resource create(ResourceResolver resourceResolver, java.lang.String path, java.util.Map<java.lang.String,java.lang.Object> properties) throws PersistenceException
ModifyingResourceProvider.commit(ResourceResolver)
is called.
A resource provider should value ResourceResolver.PROPERTY_RESOURCE_TYPE
to set the resource type of a resource.create
in interface ModifyingResourceProvider
resourceResolver
- The current resource resolver.path
- The resource path.properties
- Optional propertiesPersistenceException
- If anything failspublic void delete(ResourceResolver resourceResolver, java.lang.String path) throws PersistenceException
ModifyingResourceProvider.commit(ResourceResolver)
is called.delete
in interface ModifyingResourceProvider
resourceResolver
- The current resource resolver.path
- The resource path.PersistenceException
- If anything failspublic void revert(ResourceResolver resourceResolver)
revert
in interface ModifyingResourceProvider
resourceResolver
- The current resource resolver.public void commit(ResourceResolver resourceResolver) throws PersistenceException
commit
in interface ModifyingResourceProvider
resourceResolver
- The current resource resolver.PersistenceException
- If anything failspublic boolean hasChanges(ResourceResolver resourceResolver)
hasChanges
in interface ModifyingResourceProvider
resourceResolver
- The current resource resolver.true
if there are pending changes.public long countChildren(Resource parent)
countChildren
in interface SocialResourceProvider
parent
- the parent resourcepublic long countChildren(Resource parent, boolean visibleOnly)
countChildren
in interface SocialResourceProvider
parent
- the parent resourcevisibleOnly
- if true, count only the 'visible' childrenpublic long countChildren(Resource parent, java.lang.String childType)
countChildren
in interface SocialResourceProvider
parent
- the parent resourcechildType
- The social base type (SocialUtils.PN_BASETYPE value) of children to count (can be null/empty)public java.util.Map<java.lang.String,java.lang.Long> countChildren(java.util.List<Resource> parent, java.lang.String baseType, boolean visibleOnly)
SocialResourceProvider
countChildren
in interface SocialResourceProvider
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' childrenpublic java.util.Iterator<Resource> listChildren(Resource parent)
Iterator
of Resource
objects loaded from
the children of the given Resource
. The returned Resource
instances
are attached to the same
ResourceResolver
as the given parent
resource.
This method may be called for resource providers whose root path list contains a path such that the resource path is a prefix of the list entry. This allows for the enumeration of deeply nested provided resources for which no actual parent hierarchy exists.
The returned iterator may in turn contain resources which do not actually exist but are required
to traverse the resource
tree. Such resources SHOULD be SyntheticResource
objects whose resource type MUST be set to
ResourceProvider.RESOURCE_TYPE_SYNTHETIC
.
As with ResourceProvider.getResource(ResourceResolver, String)
the returned Resource objects must
not be cached objects.
listChildren
in interface ResourceProvider
parent
- The Resource
whose children are requested.Iterator
of Resource
objects or null
if the resource
provider has no children for the given resource.public 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)
listChildren
in interface SocialResourceProvider
path
- path to parentresourceResolver
- resolver to useoffset
- offset to start atsize
- number to returnsortBy
- order to return children inpublic 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)
SocialResourceProvider
listChildren
in interface SocialResourceProvider
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 inpublic java.util.Iterator<Resource> findResources(ResourceResolver resourceResolver, java.lang.String queryString, java.lang.String language)
The semantic meaning of the query and language depend on the actual
implementation and storage used for the resources. For JCR repository
being used as storage, the query and language parameters are used to
create a JCR Query
through the QueryManager
.
The result returned is then based on the NodeIterator
provided by the query result.
findResources
in interface QueriableResourceProvider
resourceResolver
- The resource resolverqueryString
- The query string to use to find the resources.language
- The language in which the query is formulated.Iterator
of Resource
objects matching the
query. If no resources match, null
might be
returned instead of an empty iterator.public java.util.Iterator<ValueMap> queryResources(ResourceResolver resourceResolver, java.lang.String query, java.lang.String language)
The semantic meaning of the query and language depend on the actual
implementation and storage used for the resources. For JCR repository
being used as storage, the query and language parameters are used to
create a JCR Query
through the QueryManager
.
The result returned is then based on the RowIterator
provided by the query result. The map returned for each row is indexed by
the column name and the column value is the JCR Value
object
converted into the respective Java object, such as Boolean
for a value of property type Boolean.
queryResources
in interface QueriableResourceProvider
resourceResolver
- The resource resolverquery
- The query string to use to find the resources.language
- The language in which the query is formulated.Iterator
of Map
instances providing
access to the query result. If no resources match, null
might be returned instead of an empty iterator.public void update(Resource resource)
update
in interface CachingResourceProvider
resource
- the updated resource@Deprecated public void setCloudConfig(Configuration cloudConfig)
cloudConfig
- the cloud configpublic void setConfig(SocialResourceConfiguration socialConfiguration)
setConfig
in interface SocialResourceProvider
socialConfiguration
- the SRP configurationpublic java.lang.String getASIPath()
getASIPath
in interface SocialResourceProvider
public 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)
getMLTResults
in interface SocialResourceProvider
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.public java.lang.String getJcrAclPath(java.lang.String path)
path
- the provided pathpublic static java.lang.String convertResourceTypeFilter(java.lang.String resourceTypeFilter)
resourceTypeFilter
- the filterpublic 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)
SocialResourceProvider
getMLTResults
in interface SocialResourceProvider
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.public SocialResourceSearchResult<Resource> find(ResourceResolver resolver, java.lang.String component, java.lang.String luceneQuery, java.util.List<SearchSortField> sortFields, int offset, int limit, boolean requiresTotal)
find
in interface SocialResourceProvider
resolver
- resolver for permission checkingcomponent
- The component to filter onluceneQuery
- querysortFields
- sort fieldsoffset
- offset to return results fromlimit
- maximum number of results to returnrequiresTotal
- true iff the total number of documents is required.public SocialResourceSearchResult<Resource> find(ResourceResolver resolver, java.lang.String component, java.lang.String luceneQuery, 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)
SocialResourceProvider
find
in interface SocialResourceProvider
resolver
- The resource resolver.component
- The component for filtering onluceneQuery
- 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.public 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)
SocialResourceProvider
findFacets
in interface SocialResourceProvider
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)public 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)
SocialResourceProvider
findFacets
in interface SocialResourceProvider
resolver
- ResourceResolver for current search permissionsfieldNames
- Fields for which facet counts wantedresourceTypeFilter
- Resource type filtercomponentFilter
- Component filtercount
- maximum results to returnpublic 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)
SocialResourceProvider
findFacets
in interface SocialResourceProvider
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 visibilitypublic 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, boolean includeChildren)
SocialResourceProvider
findFacets
in interface SocialResourceProvider
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 visibilityincludeChildren
- Include subpaths for searchpublic java.util.Map<java.lang.String,java.util.Map<java.lang.String,java.lang.Integer>> findFacetRanges(ResourceResolver resolver, java.util.List<FacetRangeField> rangeFields, java.lang.String resourceTypeFilter, java.lang.String componentFilter, int count)
SocialResourceProvider
findFacetRanges
in interface SocialResourceProvider
resolver
- ResourceResolver for current search permissionsrangeFields
- Fields for which facet range counts wantedresourceTypeFilter
- Resource type filtercomponentFilter
- Component filtercount
- maximum results to returnpublic java.util.Map<java.lang.String,java.util.Map<java.lang.String,java.lang.Integer>> findFacetRanges(ResourceResolver resolver, java.util.List<FacetRangeField> rangeFields, java.lang.String resourceTypeFilter, java.lang.String componentFilter, int count, boolean visibleOnly)
SocialResourceProvider
findFacetRanges
in interface SocialResourceProvider
resolver
- ResourceResolver for current search permissionsrangeFields
- Fields for which facet range counts wantedresourceTypeFilter
- Resource type filtercomponentFilter
- Component filtercount
- maximum results to returnvisibleOnly
- whether to filter by visibilitypublic FacetSearchResult findFacets(ResourceResolver resolver, java.util.List<java.lang.String> countFields, java.util.List<FacetRangeField> rangeFields, java.lang.String resourceTypeFilter, java.lang.String componentFilter, int count)
SocialResourceProvider
findFacets
in interface SocialResourceProvider
resolver
- ResourceResolver for current search permissionscountFields
- Fields for which facet counts wantedrangeFields
- Fields for which facet range counts wantedresourceTypeFilter
- Resource type filtercomponentFilter
- Component filtercount
- maximum results to returnpublic FacetSearchResult findFacets(ResourceResolver resolver, java.util.List<java.lang.String> countFields, java.util.List<FacetRangeField> rangeFields, java.lang.String resourceTypeFilter, java.lang.String componentFilter, int count, boolean visibleOnly)
SocialResourceProvider
findFacets
in interface SocialResourceProvider
resolver
- ResourceResolver for current search permissionscountFields
- Fields for which facet counts wantedrangeFields
- Fields for which facet range counts wantedresourceTypeFilter
- Resource type filtercomponentFilter
- Component filtercount
- maximum results to returnvisibleOnly
- whether to filter by visibilitypublic FacetSearchResult findFacets(ResourceResolver resolver, java.util.List<java.lang.String> countFields, java.util.List<FacetRangeField> rangeFields, java.lang.String resourceTypeFilter, java.lang.String componentFilter, int count, boolean visibleOnly, boolean includeChidren)
SocialResourceProvider
findFacets
in interface SocialResourceProvider
resolver
- ResourceResolver for current search permissionscountFields
- Fields for which facet counts wantedrangeFields
- Fields for which facet range counts wantedresourceTypeFilter
- Resource type filtercomponentFilter
- Component filtercount
- maximum results to returnvisibleOnly
- whether to filter by visibilityincludeChidren
- Include results from paths subtreepublic void clearCache()
public void incrementBy(Resource resource, java.util.Map<java.lang.String,java.lang.Long> incrementMap) throws SlingIOException, PersistenceException
SocialResourceProvider
incrementBy
in interface SocialResourceProvider
resource
- the resource.incrementMap
- map with properties and their increment/decrement values.PersistenceException
- on errorSlingIOException
public void incrementBy(Resource resource, java.lang.String property, java.lang.Long increment) throws SlingIOException, PersistenceException
SocialResourceProvider
incrementBy
in interface SocialResourceProvider
resource
- - the resource to update.property
- - the name of the counter.increment
- - the amount to increase or decrease the counter.PersistenceException
- on errorSlingIOException
public void increment(Resource resource, java.lang.String property) throws PersistenceException
SocialResourceProvider
increment
in interface SocialResourceProvider
resource
- - the resource to update.property
- - the name of the counter.PersistenceException
- on errorpublic void decrement(Resource resource, java.lang.String property) throws PersistenceException
SocialResourceProvider
decrement
in interface SocialResourceProvider
resource
- - the resource to update.property
- - the name of the counter.PersistenceException
- on errorpublic long getCount(Resource resource, java.lang.String property)
SocialResourceProvider
getCount
in interface SocialResourceProvider
resource
- - the resource to query.property
- - the name of the counter.public java.util.List<java.lang.String> getLanguages()
SocialResourceProvider
getLanguages
in interface SocialResourceProvider
public java.lang.String getContentType()
SocialResourceProvider
getContentType
in interface SocialResourceProvider
public ProviderMetaData getMetaData()
SocialResourceProvider
getMetaData
in interface SocialResourceProvider
ProviderMetaData
public java.lang.String facetRangeFieldHash(FacetRangeField rangeField)
rangeField
- the range field to hashpublic java.util.Map<java.lang.String,Resource> getResources(ResourceResolver resolver, java.util.List<java.lang.String> paths)
SocialResourceProvider
getResources
in interface SocialResourceProvider
resolver
- the resolver to usepaths
- the list of resourcespublic java.io.InputStream getAttachmentInputStream(ResourceResolver resolver, java.lang.String path) throws java.io.IOException
SocialResourceProvider
getAttachmentInputStream
in interface SocialResourceProvider
resolver
- resolver to use to read the resourcepath
- path to the attachment resourcejava.io.IOException
- on errorpublic Resource move(ResourceResolver resolver, java.lang.String srcAbsPath, java.lang.String destAbsPath) throws PersistenceException
move
in interface SocialResourceProvider
PersistenceException
public int getCommentIndex(java.lang.String path, java.lang.String baseType, ResourceResolver resourceResolver, java.lang.String commentToCheck, boolean visibleOnly)
SocialResourceProvider
getCommentIndex
in interface SocialResourceProvider
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 documentspublic 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)
getCountAndListChildren
in interface SocialResourceProvider
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 documentspublic long countChildren(Resource parent, java.lang.String baseType, boolean visibleOnly)
countChildren
in interface SocialResourceProvider
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' childrenpublic 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)
listChildren
in interface SocialResourceProvider
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 documents"Copyright © 2010 - 2020 Adobe Systems Incorporated. All Rights Reserved"