daily pastebin goal
96%
SHARE
TWEET

Untitled

a guest Jan 12th, 2018 18 in 2 days
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
  1. AuthenticationUtil.setAdminUserAsFullyAuthenticatedUser();
  2. SearchParameters params = new SearchParameters();
  3. params.addStore(StoreRef.STORE_REF_WORKSPACE_SPACESSTORE);
  4. params.setLanguage(SearchService.LANGUAGE_LUCENE);
  5. params.setLimitBy(LimitBy.UNLIMITED);
  6. params.setQuery(QUERY_FIND_NOT_MARKED_NOTES);
  7. params.setQueryConsistency(QueryConsistency.EVENTUAL);
  8. List<NodeRef> partialList = new ArrayList<NodeRef>();
  9. ResultSet result = searchService.query(params);
  10. for (NodeRef node : result.getNodeRefs())
  11. {
  12.    if (nodeService.exists(node))
  13.    {
  14.       partialList.add(node);
  15.    } else if (logger.isTraceEnabled())
  16.    {
  17.       logger.trace(MessageFormat.format("Node {0} does not exist but a search found it.", node));
  18.    }
  19. }
  20. return partialList
RAW Paste Data
Top