document.write('
Data hosted with ♥ by Pastebin.com - Download Raw - See Original
  1. /**
  2.  * Execute the query
  3.  *
  4.  * Removes any duplicates that may be present (ID search can cause duplicates -
  5.  * it is better to remove them here)
  6.  *
  7.  * @param sp                SearchParameters describing the search to execute.
  8.  * @param exceptionOnError  True to throw a runtime exception on error, false to return empty resultset
  9.  *
  10.  * @return Array of Node objects
  11.  */
  12. protected Object[] query(SearchParameters sp, boolean exceptionOnError){  
  13.     Collection<ScriptNode> set = null;
  14.    
  15.     // perform the search against the repo
  16.     ResultSet results = null;
  17.     try
  18.     {
  19.         results = this.services.getSearchService().query(sp);
  20.        
  21.         if (results.length() != 0)
  22.         {
  23.             set = new LinkedHashSet<ScriptNode>(results.length(), 1.0f);
  24.             for (ResultSetRow row: results)
  25.             {
  26.                 NodeRef nodeRef = row.getNodeRef();
  27.                 String [] fragments = row.getFragments();
  28.                 ScriptNode node = new ScriptNode(nodeRef, this.services, getScope());
  29.                 node.setFragments(fragments);
  30.                 set.add(node);
');