Package com.day.cq.personalization
Interface TargetedContentManager
-
@ProviderType public interface TargetedContentManager
A service which provides access to campaigns, experiences and targeted content.
-
-
Method Summary
All Methods Instance Methods Abstract Methods Deprecated Methods Modifier and Type Method Description java.util.List<Location>
findLocations(ResourceResolver resolver, java.lang.String... locationName)
Finds the actual content paths for a given list of location names.java.util.List<Location>
getCampaignLocations(ResourceResolver resolver, java.lang.String campaignPath)
Retrieves the list of locations for this campaign.java.util.List<Page>
getCampaigns(ResourceResolver resourceResolver)
Returns a list of campaigns sorted by priority.java.util.List<Page>
getCampaigns(ResourceResolver resolver, java.lang.String location)
Returns a list of campaigns which hold offers with the specifiedlocation
value.JSONObject
getTeaserInfo(ResourceResolver resolver, java.lang.String campaignPath, java.lang.String location)
Deprecated.usegetTeasers(ResourceResolver, String, String)
insteadJSONObject
getTeaserInfo(SlingHttpServletRequest request, java.lang.String campaignPath, java.lang.String location)
Deprecated.usegetTeasers(SlingHttpServletRequest, String)
insteadjava.util.List<Teaser>
getTeasers(ResourceResolver resolver, java.lang.String location, java.lang.String pageUrl)
Deprecated.usegetTeasers(SlingHttpServletRequest, String)
insteadjava.util.List<Teaser>
getTeasers(SlingHttpServletRequest request, java.lang.String location)
Returns a list of teasers that are available for a location
-
-
-
Method Detail
-
getTeaserInfo
JSONObject getTeaserInfo(ResourceResolver resolver, java.lang.String campaignPath, java.lang.String location)
Deprecated.usegetTeasers(ResourceResolver, String, String)
insteadReturns a JSON array of active teasers for a particular campaignPath (legacy teasers) or location. The JSON for each teaser includes:- path
- name
- title
- campainName (misspelled for legacy reasons)
- thumbnail
- id
- segments[]
- tags[]
- name
- title
- titlePath
- path
- tagID
- Parameters:
resolver
- A resourceResolver from the request (for access control).campaignPath
- A campaign path for a legacy teaser (or null).location
- A named destination (or null for a legacy teaser).- Returns:
- JSONObject as described
-
getTeaserInfo
JSONObject getTeaserInfo(SlingHttpServletRequest request, java.lang.String campaignPath, java.lang.String location)
Deprecated.usegetTeasers(SlingHttpServletRequest, String)
insteadReturns a JSON array of active teasers for a particular campaignPath (legacy teasers) or location.- Parameters:
request
- A sling servlet request. Cannot benull
campaignPath
- A campaign path for a legacy teaser (or null).location
- A named destination (or null for a legacy teaser).- Returns:
- JSONObject as described in
getTeaserInfo(ResourceResolver, String, String)
.
-
getTeasers
java.util.List<Teaser> getTeasers(ResourceResolver resolver, java.lang.String location, java.lang.String pageUrl)
Deprecated.usegetTeasers(SlingHttpServletRequest, String)
insteadReturns a list of teasers that are available for a location- Parameters:
resolver
- aResourceResolver
used to access the repository. Cannot benull
location
- the name of the location for which to return the teasers. Cannot benull
pageUrl
- the url of the page for which to retrieve the teasers. This url includes the extensions and the selectors. Ifnull
or empty string then the teasers url won't contain the selectors and the default teaser won't be in the list of teasers returned by this method- Returns:
- a list of
Teaser
objects or an empty list if no teasers are found
-
getTeasers
java.util.List<Teaser> getTeasers(SlingHttpServletRequest request, java.lang.String location)
Returns a list of teasers that are available for a location- Parameters:
request
- aSlingHttpServletRequest
. Cannot benull
location
- the name of the location for which to return the teasers. Cannot benull
- Returns:
- a list of
Teaser
objects or an empty list if no teasers are found
-
getCampaigns
java.util.List<Page> getCampaigns(ResourceResolver resourceResolver) throws RepositoryException
Returns a list of campaigns sorted by priority.- Parameters:
resourceResolver
- A resourceResolver from the request (for access control).- Returns:
- returns a list of campaigns sorted by priority.
- Throws:
RepositoryException
- if an error occurs during repository operations.
-
getCampaigns
java.util.List<Page> getCampaigns(ResourceResolver resolver, java.lang.String location) throws RepositoryException
Returns a list of campaigns which hold offers with the specifiedlocation
value.- Parameters:
resolver
- ResourceResolver bound to the users sessionlocation
- A named destination- Returns:
- A list of campaigns holding activities offers with the specified
location
- Throws:
RepositoryException
- if an error occurs during repository operations.
-
findLocations
java.util.List<Location> findLocations(ResourceResolver resolver, java.lang.String... locationName)
Finds the actual content paths for a given list of location names.- Parameters:
resolver
- aResourceResolver
used to access the repositorylocationName
- one or more location names for which to retrieve the path- Returns:
- a
List
ofLocation
objects an empty list if no paths were found.
-
getCampaignLocations
java.util.List<Location> getCampaignLocations(ResourceResolver resolver, java.lang.String campaignPath)
Retrieves the list of locations for this campaign.- Parameters:
resolver
- aResourceResolver
used to access the repocampaignPath
- the path to the campaign- Returns:
- a
List
ofLocation
objects or an empty list if the campaign doesn't have any locations (i.e . offers)
-
-