Class 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 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
    • Constructor Detail

      • SmartContentUtil

        public SmartContentUtil()
    • 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 configuration
        source - the source from data provider
        transaction - the transaction
        Returns:
        list of hits
        Throws:
        PortalException
        Since:
        11.0.0