1 /*******************************************************************************
2 * Copyright (c) 2007, 2010 Association for Decentralized Information Management
4 * All rights reserved. This program and the accompanying materials
5 * are made available under the terms of the Eclipse Public License v1.0
6 * which accompanies this distribution, and is available at
7 * http://www.eclipse.org/legal/epl-v10.html
10 * VTT Technical Research Centre of Finland - initial API and implementation
11 *******************************************************************************/
12 package org.simantics.issues.common;
14 import java.util.List;
17 import org.simantics.db.ReadGraph;
18 import org.simantics.db.Resource;
19 import org.simantics.db.common.request.ObjectsWithType;
20 import org.simantics.db.common.request.ResourceRead;
21 import org.simantics.db.exception.DatabaseException;
22 import org.simantics.operation.Layer0X;
23 import org.simantics.scl.db.SCLFunctions;
24 import org.simantics.scl.runtime.tuple.Tuple0;
25 import org.simantics.simulation.ontology.SimulationResource;
27 import gnu.trove.set.hash.THashSet;
30 * @author Antti Villberg
32 public class AllActiveIssues extends ResourceRead<Set<Resource>> {
34 public AllActiveIssues(Resource project) {
39 public Set<Resource> perform(ReadGraph graph) throws DatabaseException {
41 Layer0X L0X = Layer0X.getInstance(graph);
42 SimulationResource SIMU = SimulationResource.getInstance(graph);
43 Set<Resource> result = new THashSet<Resource>();
45 for (Resource model : graph.syncRequest(new ObjectsWithType(resource, L0X.Activates, SIMU.Model))) {
46 result.addAll(graph.syncRequest(new AllModelIssues(model, false)));
49 List<Resource> libraries = SCLFunctions.evaluateDB("Simantics/SharedOntologies", "getSharedOntologies", Tuple0.INSTANCE);
51 for (Resource library : libraries) {
52 result.addAll(graph.syncRequest(new AllModelIssues(library, false)));