\r
import org.simantics.db.ReadGraph;\r
import org.simantics.db.Resource;\r
-import org.simantics.db.common.utils.ListUtils;\r
import org.simantics.db.common.utils.NameUtils;\r
import org.simantics.db.exception.DatabaseException;\r
import org.simantics.db.layer0.variable.Variable;\r
import org.simantics.issues.common.Issue;\r
+import org.simantics.issues.common.IssueUtils;\r
import org.simantics.issues.common.StandardIssue;\r
-import org.simantics.issues.ontology.IssueResource;\r
import org.simantics.layer0.Layer0;\r
import org.simantics.scl.reflection.annotations.SCLValue;\r
import org.simantics.sysdyn.SysdynResource;\r
* @throws DatabaseException\r
*/\r
@SCLValue(type = "ReadGraph -> Resource -> Variable -> String")\r
- public static String missingLinkIssueDescription(ReadGraph graph, Resource converter, Variable issue)\r
+ public static String missingLinkIssueDescription(ReadGraph graph, Resource converter, Variable property)\r
throws DatabaseException {\r
- IssueResource ISSUE = IssueResource.getInstance(graph);\r
- Resource issueResource = issue.getRepresents(graph);\r
- Resource list = graph.getSingleObject(issueResource, ISSUE.Sources_DependencyTracker_Issue_HasContexts);\r
- List<Resource> contexts = ListUtils.toList(graph, list);\r
+ \r
+ List<Resource> contexts = IssueUtils.getContextsForProperty(graph, property);\r
String result = "Missing a link to ";\r
if (contexts.size() > 0) {\r
Resource component = contexts.get(1);\r
result = result + name;\r
}\r
return result;\r
+ \r
}\r
\r
/**\r
* @throws DatabaseException\r
*/\r
@SCLValue(type = "ReadGraph -> Resource -> Variable -> String")\r
- public static String unusedDependencyIssueDescription(ReadGraph graph, Resource converter, Variable issue)\r
+ public static String unusedDependencyIssueDescription(ReadGraph graph, Resource converter, Variable property)\r
throws DatabaseException {\r
- IssueResource ISSUE = IssueResource.getInstance(graph);\r
- Resource issueResource = issue.getRepresents(graph);\r
- Resource list = graph.getSingleObject(issueResource, ISSUE.Sources_DependencyTracker_Issue_HasContexts);\r
- List<Resource> contexts = ListUtils.toList(graph, list);\r
+ \r
+ List<Resource> contexts = IssueUtils.getContextsForProperty(graph, property);\r
String result = "Unused dependency: ";\r
if (contexts.size() > 0) {\r
Resource component = contexts.get(1);\r
* @throws DatabaseException\r
*/\r
@SCLValue(type = "ReadGraph -> Resource -> Variable -> String")\r
- public static String noSuchVariableIssueDescription(ReadGraph graph, Resource converter, Variable issue)\r
+ public static String noSuchVariableIssueDescription(ReadGraph graph, Resource converter, Variable property)\r
throws DatabaseException {\r
- IssueResource ISSUE = IssueResource.getInstance(graph);\r
- Resource issueResource = issue.getRepresents(graph);\r
- Resource list = graph.getSingleObject(issueResource, ISSUE.Sources_DependencyTracker_Issue_HasContexts);\r
- List<Resource> contexts = ListUtils.toList(graph, list);\r
+ \r
+ List<Resource> contexts = IssueUtils.getContextsForProperty(graph, property);\r
Resource component = contexts.get(0);\r
\r
// Find all variables that are linked to component with arrows\r
\r
import org.simantics.db.ReadGraph;\r
import org.simantics.db.Resource;\r
-import org.simantics.db.common.utils.ListUtils;\r
import org.simantics.db.exception.DatabaseException;\r
import org.simantics.db.layer0.variable.Variable;\r
import org.simantics.issues.common.Issue;\r
+import org.simantics.issues.common.IssueUtils;\r
import org.simantics.issues.common.StandardIssue;\r
-import org.simantics.issues.ontology.IssueResource;\r
import org.simantics.scl.reflection.annotations.SCLValue;\r
import org.simantics.sysdyn.SysdynResource;\r
\r
}\r
\r
@SCLValue(type = "ReadGraph -> Resource -> Variable -> String")\r
- public static String expressionIssueDescription(ReadGraph graph, Resource converter, Variable issue) throws DatabaseException {\r
- IssueResource ISSUE = IssueResource.getInstance(graph);\r
- Resource issueResource = issue.getRepresents(graph);\r
- Resource list = graph.getSingleObject(issueResource, ISSUE.Sources_DependencyTracker_Issue_HasContexts);\r
- List<Resource> contexts = ListUtils.toList(graph, list);\r
+ public static String expressionIssueDescription(ReadGraph graph, Resource converter, Variable property) throws DatabaseException {\r
+ \r
+ List<Resource> contexts = IssueUtils.getContextsForProperty(graph, property);\r
Resource component = contexts.get(0);\r
\r
// There should be an error\r