Class SmartContentUtil


  • public class SmartContentUtil
    extends java.lang.Object
    Provides utility methods for the SmartContent Service
    Since:
    11.0.0
    Version:
    $Revision$ $Date$
    • Field Detail

      • INTERFACE_INSTANCE_PROPERTY_SEARCH_SCOPE_CHANNEL_IDS

        public static final java.lang.String INTERFACE_INSTANCE_PROPERTY_SEARCH_SCOPE_CHANNEL_IDS
        See Also:
        Constant Field Values
      • INTERFACE_INSTANCE_PROPERTY_SEARCH_SCOPE_SERVICE_INSTANCE_IDS

        public static final java.lang.String INTERFACE_INSTANCE_PROPERTY_SEARCH_SCOPE_SERVICE_INSTANCE_IDS
        See Also:
        Constant Field Values
      • INTERFACE_INSTANCE_PROPERTY_SEARCH_SCOPE_TIME_FRAME

        public static final java.lang.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 java.util.List<ISearchHit> getMostLikedOrCommnentedOrViewsContents​(SessionConfig sessionConfig,
                                                                                         TabularSource<?> source,
                                                                                         java.lang.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 java.util.List<ISearchHit> getMostLikedOrCommentedOrViewsRecommendedContents​(SessionConfig sessionConfig,
                                                                                                   TabularSource<?> source,
                                                                                                   java.lang.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 java.util.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 java.util.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 java.util.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 java.util.List<ISearchHit> chooseSearchByInterfaceType​(SessionConfig sessionConfig,
                                                                             java.lang.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 java.util.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