1 package org.simantics.district.network.ui.techtype.requests;
3 import org.simantics.databoard.Bindings;
4 import org.simantics.db.ReadGraph;
5 import org.simantics.db.Resource;
6 import org.simantics.db.common.procedure.adapter.TransientCacheListener;
7 import org.simantics.db.common.request.ResourceRead2;
8 import org.simantics.db.exception.DatabaseException;
9 import org.simantics.district.network.ontology.DistrictNetworkResource;
11 public class PossibleTechTypeTableData extends ResourceRead2<String> {
12 public PossibleTechTypeTableData(Resource model, Resource componentType) {
13 super(model, componentType);
17 public String perform(ReadGraph graph) throws DatabaseException {
18 DistrictNetworkResource DN = DistrictNetworkResource.getInstance(graph);
20 Resource ttt = graph.syncRequest(new PossibleTechTypeTable(resource, resource2), TransientCacheListener.instance());
21 return ttt != null ? graph.getPossibleRelatedValue2(ttt, DN.TechType_TechTypeTable_HasData, Bindings.STRING) : null;