]> gerrit.simantics Code Review - simantics/platform.git/blob - bundles/org.simantics.db.common/src/org/simantics/db/common/issue/IssueWithDescription.java
Export also dynamic issues to issue CSV export file
[simantics/platform.git] / bundles / org.simantics.db.common / src / org / simantics / db / common / issue / IssueWithDescription.java
1 package org.simantics.db.common.issue;
2
3 import java.util.Collection;
4
5 import org.simantics.databoard.Bindings;
6 import org.simantics.db.Resource;
7 import org.simantics.db.WriteGraph;
8 import org.simantics.db.exception.DatabaseException;
9 import org.simantics.layer0.Layer0;
10
11
12 public class IssueWithDescription extends AnonymousIssue {
13
14     public final String description;
15
16     public IssueWithDescription(Resource type, String description, Collection<Resource> contexts) {
17         super(type, contexts);
18         this.description = description;
19     }
20
21     public IssueWithDescription(Resource type, String description, Resource... contexts) {
22         super(type, contexts);
23         this.description = description;
24     }
25     
26     @Override
27     public Resource write(WriteGraph graph, Resource source)
28             throws DatabaseException {
29         Resource issue = super.write(graph, source);
30         Layer0 L0 = Layer0.getInstance(graph);
31         graph.claimLiteral(issue, L0.HasDescription, description, Bindings.STRING);
32         return issue;
33     }
34     
35 }