Class SimpleDocumentList<T extends SimpleDocument>

    • Constructor Detail

      • SimpleDocumentList

        public SimpleDocumentList​(int initialCapacity)
      • SimpleDocumentList

        public SimpleDocumentList()
      • SimpleDocumentList

        public SimpleDocumentList​(Collection<? extends T> c)
    • Method Detail

      • getQueryLanguage

        public String getQueryLanguage()
        Gets the language used to perform the JCR query in order to load the current list.
        Returns:
        the language is defined, null value otherwise.
      • setQueryLanguage

        public SimpleDocumentList<T> setQueryLanguage​(String queryLanguage)
        Sets the language used to perform the JCR query in order to load the current list.
        Parameters:
        queryLanguage - the language used to perform the JCR query in order to load the list.
        Returns:
        itself.
      • removeLanguageFallbacks

        public SimpleDocumentList<T> removeLanguageFallbacks()
        Removes from the current list all documents which content is in an other language than the one returned by getQueryLanguage(). If getQueryLanguage() returns null or an unknown languague, nothing is done.
        Returns:
        itself.
      • orderByLanguageAndLastUpdate

        public SimpleDocumentList<T> orderByLanguageAndLastUpdate​(String... languageOrderedByPriority)
        Orders the list by descending priority of the language and descending last update date. By default, if no language priority is given, then the language priority of the platform is taken into account. If a language priority is specified, then the language priorities of the platform are overridden.
        Parameters:
        languageOrderedByPriority - manual language priority definition ​​from the highest to the lowest.
        Returns:
        itself.
      • isManuallySorted

        protected boolean isManuallySorted()
        Indicates from the given list of documents if is manually sorted without taking care about AttachmentSettings.listFromYoungestToOldestAdd() setting.

        The given list MUST be provided by DocumentRepository listing methods which apply an ordering on the order metadata.

        In other words, it means that the documents MUST be ordered from lowest to greatest order index (SimpleDocument.getOrder()) when calling this method. Otherwise the result is not consistent.

        Returns:
        true if the list is sorted manually (and so the list is ordered on order document data), false otherwise.
      • sortYoungestToOldestAddIfEnabled

        public void sortYoungestToOldestAddIfEnabled()