use of org.bimserver.database.queries.om.QueryException in project BIMserver by opensourceBIM.
the class QueryObjectProvider method fromJsonNode.
public static QueryObjectProvider fromJsonNode(DatabaseSession databaseSession, BimServer bimServer, JsonNode fullQuery, Set<Long> roids, PackageMetaData packageMetaData) throws JsonParseException, JsonMappingException, IOException, QueryException {
if (fullQuery instanceof ObjectNode) {
JsonQueryObjectModelConverter converter = new JsonQueryObjectModelConverter(packageMetaData);
Query query = converter.parseJson("query", (ObjectNode) fullQuery);
return new QueryObjectProvider(databaseSession, bimServer, query, roids, packageMetaData);
} else {
throw new QueryException("Query root must be of type object");
}
}
use of org.bimserver.database.queries.om.QueryException in project BIMserver by opensourceBIM.
the class ClientIfcModel method loadDeep.
private void loadDeep() throws ServerException, UserException, PublicInterfaceNotFoundException, QueryException {
if (modelState != ModelState.FULLY_LOADED && modelState != ModelState.LOADING) {
modelState = ModelState.LOADING;
Query query = new Query("test", getPackageMetaData());
QueryPart queryPart = query.createQueryPart();
queryPart.setIncludeAllFields(true);
ObjectNode queryNode = new JsonQueryObjectModelConverter(query.getPackageMetaData()).toJson(query);
Long topicId = bimServerClient.getServiceInterface().download(Collections.singleton(roid), queryNode.toString(), getJsonSerializerOid(), false);
waitForDonePreparing(topicId);
try {
processDownload(topicId);
bimServerClient.getServiceInterface().cleanupLongAction(topicId);
modelState = ModelState.FULLY_LOADED;
loadGeometry();
} catch (IfcModelInterfaceException | IOException e) {
LOGGER.error("", e);
} catch (QueryException e) {
LOGGER.error("", e);
} catch (GeometryException e) {
LOGGER.error("", e);
}
}
}
Aggregations