X-Git-Url: https://gerrit.simantics.org/r/gitweb?p=simantics%2Fplatform.git;a=blobdiff_plain;f=bundles%2Forg.simantics.document.server%2Fsrc%2Forg%2Fsimantics%2Fdocument%2Fserver%2FFunctions.java;h=6ccffbe973ddecdeef07e4a8bcbdaebe3acf52e2;hp=8b68cc409cde83d0442ae081163c15e3dcf0071c;hb=1b5381e0fac40eb5b5f96da210070e3a3c03303c;hpb=3a10ce856f7124f83cf03d6e7f7576da237a7cbb diff --git a/bundles/org.simantics.document.server/src/org/simantics/document/server/Functions.java b/bundles/org.simantics.document.server/src/org/simantics/document/server/Functions.java index 8b68cc409..6ccffbe97 100644 --- a/bundles/org.simantics.document.server/src/org/simantics/document/server/Functions.java +++ b/bundles/org.simantics.document.server/src/org/simantics/document/server/Functions.java @@ -136,7 +136,7 @@ public class Functions { for(Variable property : procedural.getProperties(graph/*, DocumentationResource.URIs.Document_AttributeRelation*/)) { if(property instanceof StandardAssertedGraphPropertyVariable) { StandardAssertedGraphPropertyVariable ass = (StandardAssertedGraphPropertyVariable)property; - if("datadefinitions".equals(ass.property.name) || "commands".equals(ass.property.name)) { + if("datadefinitions".equals(ass.property.name) || "commands".equals(ass.property.name) || "pollingFunction".equals(ass.property.name)) { Object value = property.getPossibleValue(graph); if(value != null) map.put(ass.property.name, new ConstantPropertyVariable(parent, ass.property.name, value, null)); } @@ -160,15 +160,28 @@ public class Functions { PrimitivePropertyStatementsProcedure foo = new PrimitivePropertyStatementsProcedure(); dqs.forEachDirectPersistentStatement(graph, parent.getRepresents(graph), foo); - + for(Statement stm : foo.result) { Resource predicate = stm.getPredicate(); PropertyInfo info = graph.syncRequest(new PropertyInfoRequest(predicate)); + if(info.isHasProperty && info.hasClassification(DocumentationResource.URIs.Document_AttributeRelation)) { if(map == null) map = new HashMap(); Variable prop = new StandardGraphPropertyVariable(graph, parent, predicate); Object value = prop.getValue(graph); map.put(info.name, new ConstantPropertyVariable(parent, info.name, value, null)); + } else { + Resource definition = graph.getPossibleObject(predicate, DOC.Document_definesAttributeRelation); + if(definition != null) { + if(map == null) map = new HashMap(); + try { + PropertyInfo info2 = graph.syncRequest(new PropertyInfoRequest(definition)); + Variable prop = new StandardGraphPropertyVariable(graph, parent, definition); + map.put(info2.name, new PrimitiveValueVariable(parent, info2.name, prop)); + } catch (DatabaseException e) { + Logger.defaultLogError(e); + } + } } }