use of com.runwaysdk.dataaccess.ProgrammingErrorException in project geoprism-registry by terraframe.
the class VectorTileBuilder method writeVectorLayers.
@Override
public List<Layer> writeVectorLayers(Envelope envelope, Envelope bounds) {
try (ResultSet resultSet = this.getResultSet()) {
List<Layer> layers = new LinkedList<Layer>();
layers.add(this.writeVectorLayer("context", bounds, resultSet));
return layers;
} catch (JSONException | IOException | SQLException e) {
throw new ProgrammingErrorException(e);
}
}
use of com.runwaysdk.dataaccess.ProgrammingErrorException in project geoprism-registry by terraframe.
the class XMLImporter method importXMLDefinitions.
@Transaction
public List<ServerElement> importXMLDefinitions(Organization organization, InputStream istream) {
TransactionState state = TransactionState.getCurrentTransactionState();
state.putTransactionObject("transaction-state", this.cache);
LinkedList<ServerElement> list = new LinkedList<ServerElement>();
try {
DocumentBuilderFactory factory = DocumentBuilderFactory.newInstance();
DocumentBuilder dBuilder = factory.newDocumentBuilder();
Document doc = dBuilder.parse(istream);
list.addAll(this.createTypes(organization, doc));
list.addAll(this.createHierarchies(organization, doc));
list.addAll(this.createDirectedAcyclicGraphTypes(doc));
list.addAll(this.createUndirectedGraphTypes(doc));
} catch (ParserConfigurationException | IOException | SAXException e) {
throw new ProgrammingErrorException(e);
}
return list;
}
use of com.runwaysdk.dataaccess.ProgrammingErrorException in project geoprism-registry by terraframe.
the class TestGeoObjectInfo method getGeometry.
public Geometry getGeometry() {
if (this.getWkt() == null) {
return null;
}
try {
final WKTReader reader = new WKTReader(new GeometryFactory());
Geometry geometry = reader.read(this.getWkt());
geometry.setSRID(4326);
return geometry;
} catch (ParseException e) {
throw new ProgrammingErrorException(e);
}
}
use of com.runwaysdk.dataaccess.ProgrammingErrorException in project geoprism-registry by terraframe.
the class GeoRegistryUtil method parseDate.
public static Date parseDate(String date, boolean throwClientException) {
if (date != null && date.length() > 0) {
try {
SimpleDateFormat format = new SimpleDateFormat(GeoObjectImportConfiguration.DATE_FORMAT);
format.setTimeZone(SYSTEM_TIMEZONE);
return format.parse(date);
} catch (ParseException e) {
if (throwClientException) {
throw new RuntimeException("Unable to parse the date [" + date + "]. The date format must be [" + GeoObjectImportConfiguration.DATE_FORMAT + "]");
} else {
throw new ProgrammingErrorException(e);
}
}
}
return null;
}
use of com.runwaysdk.dataaccess.ProgrammingErrorException in project geoprism-registry by terraframe.
the class GeoRegistryUtil method exportMasterListExcel.
@Transaction
public static InputStream exportMasterListExcel(String oid, String filterJson) {
MasterListVersion version = MasterListVersion.get(oid);
MdBusinessDAOIF mdBusiness = MdBusinessDAO.get(version.getMdBusinessOid());
List<? extends MdAttributeConcreteDAOIF> mdAttributes = mdBusiness.definesAttributesOrdered().stream().filter(mdAttribute -> version.isValid(mdAttribute)).collect(Collectors.toList());
if (filterJson.contains("invalid")) {
mdAttributes = mdAttributes.stream().filter(mdAttribute -> !mdAttribute.definesAttribute().equals("invalid")).collect(Collectors.toList());
}
try {
MasterListExcelExporter exporter = new MasterListExcelExporter(version, mdBusiness, mdAttributes, filterJson, null);
return exporter.export();
} catch (IOException e) {
throw new ProgrammingErrorException(e);
}
}
Aggregations