1 package org.simantics.document.server.request;
3 import java.util.ArrayList;
4 import java.util.Collections;
5 import java.util.Comparator;
8 import org.simantics.db.ReadGraph;
9 import org.simantics.db.common.request.UnaryRead;
10 import org.simantics.db.exception.DatabaseException;
11 import org.simantics.db.layer0.variable.Variable;
12 import org.simantics.db.layer0.variable.Variables;
13 import org.simantics.document.server.JSONObject;
15 public class URIDocumentRequest extends UnaryRead<String, List<JSONObject>> {
17 public URIDocumentRequest(String var) {
22 public List<JSONObject> perform(ReadGraph graph) throws DatabaseException {
24 Variable var = Variables.getPossibleVariable(graph, parameter);
26 Variables.getPossibleVariable(graph, parameter);
27 return Collections.emptyList();
30 ArrayList<JSONObject> result = new ArrayList<JSONObject>(graph.syncRequest(new DocumentRequest(var)));
31 Collections.sort(result, new Comparator<JSONObject>() {
34 public int compare(JSONObject o1, JSONObject o2) {
35 return o1.id.compareTo(o2.id);