Class PublicationCriteria


  • public class PublicationCriteria
    extends Object
    Class that permits to set publication search criteria for publication services.
    Author:
    silveryocha
    • Method Detail

      • onAllComponentInstances

        public static PublicationCriteria onAllComponentInstances()
        Initializes the criteria.

        Please be careful against performances...

        Returns:
        an instance of criteria.
      • onComponentInstanceIds

        public static PublicationCriteria onComponentInstanceIds​(String... componentInstanceIds)
        Initializes the criteria with component instance ids.

        By security, if no ids are given, the service using the criteria will return directly an empty list instead of performing the sql query.

        Parameters:
        componentInstanceIds - identifiers of component instances.
        Returns:
        an instance of criteria.
      • onComponentInstanceIds

        public static PublicationCriteria onComponentInstanceIds​(Collection<String> componentInstanceIds)
        Initializes the criteria with component instance ids.

        By security, if no ids are given, the service using the criteria will return directly an empty list instead of performing the sql query.

        Parameters:
        componentInstanceIds - identifiers of component instances.
        Returns:
        an instance of criteria.
      • excludingTrashNodeOnComponentInstanceIds

        public static PublicationCriteria excludingTrashNodeOnComponentInstanceIds​(String... componentInstanceIds)
        Additionally filter on the trash node.
      • excludingTrashNodeOnComponentInstanceIds

        public static PublicationCriteria excludingTrashNodeOnComponentInstanceIds​(Collection<String> componentInstanceIds)
        Additionally filter on the trash node.
      • ofStatus

        public PublicationCriteria ofStatus​(String... statuses)
        Sets the criteria of component node ids.
        Parameters:
        statuses - statuses of publications.
        Returns:
        itself.
      • mustHaveAtLeastOneNodeFather

        public PublicationCriteria mustHaveAtLeastOneNodeFather()
        Indicates that the publication MUST be linked to a node.
        Returns:
        itself.
      • takingAliasesIntoAccount

        public PublicationCriteria takingAliasesIntoAccount()
        Indicates that publications can be retrieved from the aliases data.
        Returns:
        itself.
      • onNodes

        public PublicationCriteria onNodes​(String... nodeIds)
        Sets the criteria of component node ids.
        Parameters:
        nodeIds - identifiers of nodes.
        Returns:
        itself.
      • onNodes

        public PublicationCriteria onNodes​(Collection<String> nodeIds)
        Sets the criteria of component node ids.
        Parameters:
        nodeIds - identifiers of nodes.
        Returns:
        itself.
      • excludingNodes

        public PublicationCriteria excludingNodes​(String... nodeIds)
        Sets the criteria of component node ids.
        Parameters:
        nodeIds - identifiers of nodes.
        Returns:
        itself.
      • excludingNodes

        public PublicationCriteria excludingNodes​(Collection<String> nodeIds)
        Sets the criteria of component node ids.
        Parameters:
        nodeIds - identifiers of nodes.
        Returns:
        itself.
      • visibleAt

        public PublicationCriteria visibleAt​(OffsetDateTime visibilityDate)
        The local date from which the publication are visible.
        Parameters:
        visibilityDate - a local date.
        Returns:
        itself.
      • nonVisibleAt

        public PublicationCriteria nonVisibleAt​(OffsetDateTime invisibilityDate)
        The local date from which the publication are not visible.
        Parameters:
        invisibilityDate - a local date.
        Returns:
        itself.
      • lastUpdatedSince

        public PublicationCriteria lastUpdatedSince​(OffsetDateTime lastUpdatedSince)
        The local date from which the publication have been updated.
        Parameters:
        lastUpdatedSince - a local date.
        Returns:
        itself.
      • limitTo

        public PublicationCriteria limitTo​(int limit)
        Limit to a given number of result.
        Parameters:
        limit - a number of result (<= 0 means no limit).
        Returns:
        itself.
      • paginateBy

        public PublicationCriteria paginateBy​(PaginationPage pagination)
        Sets the criteria of pagination.
        Parameters:
        pagination - the pagination.
        Returns:
        itself.
      • orderByDescendingBeginDate

        public PublicationCriteria orderByDescendingBeginDate()
        Configures the order by begin date.
        Returns:
        itself.
      • orderByDescendingLastUpdateDate

        public PublicationCriteria orderByDescendingLastUpdateDate()
        Configures the order by begin date.
        Returns:
        itself.
      • isAliasesTakenIntoAccount

        public boolean isAliasesTakenIntoAccount()
      • getComponentInstanceIds

        public List<String> getComponentInstanceIds()