5 Replies Latest reply on Jun 3, 2013 11:39 AM by valery_yahorau

    Jive 6 migration Filters trouble.

    valery_yahorau

      Our project migrate from jive 4.5 to 6.0.

       

      In 4.5 we use filters for a lot of entite. For example for discussions(ForumThread).

      But threre is no methods with filter in jive 6.0 in ForumManager like was in jive 4.5 getThreads(JiveContainer container, ThreadResultFilter resultFilter).
      Any solutions for this issue ? How, for example, get recent 10 threads ?

       

      Also we have troubles with modValut of ForunThread, There is no modValut for ForumThread in jive 6.0.
      Thanks.
      Ryan Rutan

        • Stewart Wachs Have you hit a similar scenario in any of the migrations you or your team has done?
          • Re:

            Valery - Sorry, I'm not quite following. Can you describe what you're looking to accomplish? Once I hear back from you I'll share your question w/ my team of engineers. Thanks!

            • Re: Jive 6 migration Filters trouble.
              valery_yahorau

              Thanks for yours answers, but our team recieve this problem by using ThreadBrowseQueryBuilder of jive 6.0. This class provide the similar functionality like ThreadResultFilter in jive 4.5.

                • Re: Jive 6 migration Filters trouble.

                  Valery - What are you trying to accomplish w/ your use of ThreadBrowseQueryBuilder?

                    • Re: Jive 6 migration Filters trouble.
                      valery_yahorau

                      Stewart. For example i try to get 3 recent visible ForumThread from community and all sub-communities. In jive 4.5 we used method of  ForumManager : JiveIterator<ForumThread> getThreads(JiveContainer container, ThreadResultFilter resultFilter). In ThreadResultFilter we set the sortField and sortOrder and anothers parameters, but in jive 6.0 ForumManager hasn't method getThreads(JiveContainer container, ThreadResultFilter resultFilter) and i don't know how to do this. But I find class ThreadBrowseQueryBuilder and it provide the similar functionality like ThreadResultFilter in jive 4.5.

                       

                      Code in jive 4.5:

                         ThreadResultFilter filter = ThreadResultFilter.createDefaultThreadFilter();

                          filter.setNumResults(3);

                          filter.setRecursive(true);

                          filter.setSortField(JiveConstants.MODIFICATION_DATE);

                          filter.setSortOrder(ResultFilter.DESCENDING);

                          JiveIterator<ForumThread> recentThreads = this.forumManager.getThreads(this.container, filter);

                       

                      Code in jive 6.0:

                        BrowseSort modificationDateSort = new ModificationDateSort();

                        modificationDateSort.setOrder(SortOrder.DESCENDING);

                        ThreadBrowseQueryBuilder threadBrowseQueryBuilder = this.browseQueryBuilderFactory.getThreadBrowseQueryBuilder();

                        threadBrowseQueryBuilder.setContainer(container);

                        threadBrowseQueryBuilder.setRecursive(true);

                        threadBrowseQueryBuilder.setSort(modificationDateSort);

                       

                        Set<Status> statuses = new HashSet<Status>();

                        statuses.add(JiveContentObject.Status.PUBLISHED);

                        statuses.add(JiveContentObject.Status.ABUSE_VISIBLE);

                        threadBrowseQueryBuilder.setStatuses(statuses);

                        threadBrowseQueryBuilder.getContentIterator(0, 3, modificationDateSort);

                       

                      If you have any another idea how to do this please write about it.

                      1 person found this helpful