X-Git-Url: https://gerrit.simantics.org/r/gitweb?a=blobdiff_plain;f=bundles%2Forg.simantics.document.server%2Fsrc%2Forg%2Fsimantics%2Fdocument%2Fserver%2FFunctions.java;h=ebaa5fc0a30d5151cbdb206f560b9aaae617d0be;hb=68ce0966a57f5153b133c6283fdbae10f683b745;hp=0a7e004f7dcab5e75740d176100c78d59c3dfb47;hpb=8a609b2a6559fef3d2f21224253d87c414473187;p=simantics%2Fplatform.git 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 0a7e004f7..ebaa5fc0a 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 @@ -25,7 +25,7 @@ import org.simantics.db.Statement; import org.simantics.db.WriteGraph; import org.simantics.db.common.primitiverequest.Adapter; import org.simantics.db.common.procedure.adapter.TransientCacheListener; -import org.simantics.db.common.request.UnaryRead; +import org.simantics.db.common.request.BinaryRead; import org.simantics.db.common.request.UniqueRead; import org.simantics.db.common.request.WriteResultRequest; import org.simantics.db.common.utils.Logger; @@ -756,12 +756,12 @@ public class Functions { final List effects = ServerSCLHandlerValueRequest.getEffects(graph, anyFunction); - final Function1 fn = anyFunction.getValue(graph); - String expression = anyFunction.getPropertyValue(graph, "expression"); + Function1 fn = anyFunction.getValue(graph); + //String expression = anyFunction.getPropertyValue(graph, "expression"); final Session session = graph.getSession(); - return new AbstractResponseHandler(expression) { + return new AbstractResponseHandler(fn) { private String formatError(RequestProcessor proc, Throwable t) { @@ -1256,11 +1256,11 @@ public class Functions { return true; } } else { - Variable parentCp = graph.sync(new UnaryRead(conn) { + Variable parentCp = graph.sync(new BinaryRead(widget, conn) { @Override public Variable perform(ReadGraph graph) throws DatabaseException { DocumentationResource DOC = DocumentationResource.getInstance(graph); - Collection descs = parameter.getConnectionPointDescriptors(graph, null); + Collection descs = parameter2.getConnectionPointDescriptors(graph, parameter, null); for(VariableConnectionPointDescriptor desc : descs) { if (DOC.Relations_partN.equals(desc.getConnectionPointResource(graph))) { @@ -1312,5 +1312,33 @@ public class Functions { LOGGER.debug("", e); return e.getMessage(); } + + static class StandardDocumentProperties implements DocumentProperties { + + @Override + public Collection getKeys(ReadGraph graph, Variable context) throws DatabaseException { + + DocumentationResource DOC = DocumentationResource.getInstance(graph); + StandardGraphPropertyVariable asd = new StandardGraphPropertyVariable(graph, context, DOC.Properties_primitiveProperties); + Map ps = primitiveProperties.getVariables(graph, asd, null); + return ps.keySet(); + + } + + @Override + public Object getValue(ReadGraph graph, Variable context, String key) throws DatabaseException { + + DocumentationResource DOC = DocumentationResource.getInstance(graph); + StandardGraphPropertyVariable asd = new StandardGraphPropertyVariable(graph, context, DOC.Properties_primitiveProperties); + Map ps = primitiveProperties.getVariables(graph, asd, null); + return ps.get(key).getValue(graph); + + } + + } + + public static DocumentProperties primitiveProperties() throws DatabaseException { + return new StandardDocumentProperties(); + } } \ No newline at end of file