Package lumis.service.smartcontent
Class SmartContentUtil
- java.lang.Object
-
- lumis.service.smartcontent.SmartContentUtil
-
public class SmartContentUtil extends Object
Provides utility methods for the SmartContent Service- Since:
- 11.0.0
- Version:
- $Revision: 24476 $ $Date: 2021-04-28 11:28:23 -0300 (Wed, 28 Apr 2021) $
-
-
Field Summary
Fields Modifier and Type Field Description static String
INTERFACE_INSTANCE_PROPERTY_SEARCH_SCOPE_CHANNEL_IDS
static String
INTERFACE_INSTANCE_PROPERTY_SEARCH_SCOPE_SERVICE_INSTANCE_IDS
static String
INTERFACE_INSTANCE_PROPERTY_SEARCH_SCOPE_TIME_FRAME
-
Constructor Summary
Constructors Constructor Description SmartContentUtil()
-
Method Summary
All Methods Static Methods Concrete Methods Modifier and Type Method Description static List<ISearchHit>
chooseSearchByInterfaceType(SessionConfig sessionConfig, String interfaceType, TabularSource<?> source, ITransaction transaction)
Choose a method use for an specific interface.static List<ISearchHit>
getInterestingContent(SessionConfig sessionConfig, TabularSource<?> source, ITransaction transaction)
Get contents that must be interesting for user by running a query on elasticSearch.static List<ISearchHit>
getLastContentNotRead(SessionConfig sessionConfig, TabularSource<?> source, ITransaction transaction)
Get last contents that wasn't read by me.static List<ISearchHit>
getLastContentRead(SessionConfig sessionConfig, TabularSource<?> source, ITransaction transaction)
Get last contents read by me, by running a query on elasticSearch.static List<ISearchHit>
getMostLikedOrCommentedOrViewsRecommendedContents(SessionConfig sessionConfig, TabularSource<?> source, String type, ITransaction transaction)
Get most like, commented or viewed recommend contents.static List<ISearchHit>
getMostLikedOrCommnentedOrViewsContents(SessionConfig sessionConfig, TabularSource<?> source, String type, ITransaction transaction)
Get most like, commented or viewed contents.static List<ISearchHit>
getRecommendToMe(SessionConfig sessionConfig, TabularSource<?> source, ITransaction transaction)
Get contents recommend to me by running a query on elasticSearch.static SearchFieldClause
getStartTimeFrameFieldClause(SessionConfig sessionConfig, Source<?> source, ITransaction transaction)
Returns the field clause that filters by the start of the time frame.
-
-
-
Field Detail
-
INTERFACE_INSTANCE_PROPERTY_SEARCH_SCOPE_CHANNEL_IDS
public static final String INTERFACE_INSTANCE_PROPERTY_SEARCH_SCOPE_CHANNEL_IDS
- See Also:
- Constant Field Values
-
INTERFACE_INSTANCE_PROPERTY_SEARCH_SCOPE_SERVICE_INSTANCE_IDS
public static final String INTERFACE_INSTANCE_PROPERTY_SEARCH_SCOPE_SERVICE_INSTANCE_IDS
- See Also:
- Constant Field Values
-
INTERFACE_INSTANCE_PROPERTY_SEARCH_SCOPE_TIME_FRAME
public static final String INTERFACE_INSTANCE_PROPERTY_SEARCH_SCOPE_TIME_FRAME
- See Also:
- Constant Field Values
-
-
Method Detail
-
getStartTimeFrameFieldClause
public static SearchFieldClause getStartTimeFrameFieldClause(SessionConfig sessionConfig, Source<?> source, ITransaction transaction) throws PortalException
Returns the field clause that filters by the start of the time frame.- Parameters:
sessionConfig
- the session configuration.source
- the source from data provider.- Returns:
- a search field clause.
- Throws:
PortalException
- Since:
- 11.0.0
-
getMostLikedOrCommnentedOrViewsContents
public static List<ISearchHit> getMostLikedOrCommnentedOrViewsContents(SessionConfig sessionConfig, TabularSource<?> source, String type, ITransaction transaction) throws PortalException
Get most like, commented or viewed contents. This method uses the elasticSearch API.- Parameters:
sessionConfig
- the session configuration.source
- the source from data provider.type
- that define which kind of search will be performed.transaction
- the current transaction.- Returns:
- a list containing the result of the search.
- Throws:
PortalException
- Since:
- 11.0.0
-
getMostLikedOrCommentedOrViewsRecommendedContents
public static List<ISearchHit> getMostLikedOrCommentedOrViewsRecommendedContents(SessionConfig sessionConfig, TabularSource<?> source, String type, ITransaction transaction) throws PortalException
Get most like, commented or viewed recommend contents. This method uses the elasticSearch API.- Parameters:
sessionConfig
- the session configuration.source
- the source from data provider.type
- that define which kind of search will be performed.transaction
- the current transaction.- Returns:
- a list containing the result of the search.
- Throws:
PortalException
- Since:
- 11.0.0
-
getRecommendToMe
public static List<ISearchHit> getRecommendToMe(SessionConfig sessionConfig, TabularSource<?> source, ITransaction transaction) throws PortalException
Get contents recommend to me by running a query on elasticSearch. This method uses the elasticSearch API.- Parameters:
sessionConfig
- the session configuration.source
- the source from data provider.transaction
- the current transaction.- Returns:
- a list containing the result of the search.
- Throws:
PortalException
- Since:
- 11.0.0
-
getLastContentNotRead
public static List<ISearchHit> getLastContentNotRead(SessionConfig sessionConfig, TabularSource<?> source, ITransaction transaction) throws PortalException
Get last contents that wasn't read by me.- Parameters:
sessionConfig
- the session configuration.source
- the source from data provider.transaction
- the transaction.- Returns:
- a list containing the result of the search.
- Throws:
PortalException
- Since:
- 11.0.0
-
getLastContentRead
public static List<ISearchHit> getLastContentRead(SessionConfig sessionConfig, TabularSource<?> source, ITransaction transaction) throws PortalException
Get last contents read by me, by running a query on elasticSearch. This method uses the elasticSearch API.- Parameters:
sessionConfig
- the session configuration.source
- the source from data provider.transaction
- the current transaction.- Returns:
- a list containing the result of the search.
- Throws:
PortalException
- Since:
- 11.0.0
-
chooseSearchByInterfaceType
public static List<ISearchHit> chooseSearchByInterfaceType(SessionConfig sessionConfig, String interfaceType, TabularSource<?> source, ITransaction transaction) throws PortalException
Choose a method use for an specific interface.- Parameters:
sessionConfig
- the session configuration.interfaceType
- the interface type that is used to choose the correct search method.source
- the source from data provider.transaction
- the current transaction.- Returns:
- a list containing the result of the search.
- Throws:
PortalException
- Since:
- 11.0.0
-
getInterestingContent
public static List<ISearchHit> getInterestingContent(SessionConfig sessionConfig, TabularSource<?> source, ITransaction transaction) throws PortalException
Get contents that must be interesting for user by running a query on elasticSearch. This method uses the elasticSearch API.- Parameters:
sessionConfig
- the session configurationsource
- the source from data providertransaction
- the transaction- Returns:
- list of hits
- Throws:
PortalException
- Since:
- 11.0.0
-
-