*******************************************************************************/\r
package org.simantics.sysdyn.ui.function;\r
\r
-import java.io.IOException;\r
import java.util.ArrayList;\r
import java.util.Collection;\r
import java.util.HashSet;\r
import org.simantics.diagram.stubs.DiagramResource;\r
import org.simantics.layer0.Layer0;\r
import org.simantics.operation.Layer0X;\r
-import org.simantics.scl.runtime.function.FunctionImpl4;\r
import org.simantics.scl.runtime.function.FunctionImpl5;\r
-import org.simantics.sysdyn.SysdynResource;\r
import org.simantics.workbench.search.NamedResource;\r
-import org.simantics.workbench.search.QueryResult;\r
import org.simantics.workbench.search.SearchResult;\r
import org.simantics.workbench.search.Searching;\r
\r
-//import fi.vtt.apros.AprosBuiltins;\r
-import freemarker.template.TemplateException;\r
-\r
/**\r
* modulesSearchFunction:\r
- * (ReadGraph, query : String, maxResults : Integer) -> QueryResult\r
+ * (IProgressMonitor, ReadGraph, model : Resource, query : String, maxResults : Integer) -> QueryResult\r
* \r
* @author Tuukka Lehtonen\r
*/\r
\r
public static final Collection<SearchResult> generateSearchResults(ReadGraph graph,\r
Collection<Map<String, Object>> results) throws DatabaseException {\r
- System.out.println(results.size());\r
- Layer0 L0 = Layer0.getInstance(graph);\r
- SysdynResource SR = SysdynResource.getInstance(graph);\r
+ Layer0 L0 = Layer0.getInstance(graph);\r
DiagramResource DIA = DiagramResource.getInstance(graph);\r
\r
Collection<SearchResult> result = new ArrayList<SearchResult>(results.size());\r
for (Map<String, Object> r : results) {\r
Resource resource = (Resource) r.get(Dependencies.FIELD_RESOURCE);\r
\r
- // Ignore non-AprosModules\r
- /*if (!graph.isInstanceOf(resource, APROS.AprosModule))\r
- continue;\r
-\r
- // Ignore attached default modules.\r
- if (graph.hasStatement(resource, APROS.AttachedModule))\r
- continue;*/\r
-\r
// Prevent index corruption from producing duplicate results.\r
if (!processed.add(resource))\r
continue;\r