use of com.runwaysdk.dataaccess.ProgrammingErrorException in project geoprism-registry by terraframe.
the class GeoRegistryUtil method exportMasterListShapefile.
@Transaction
public static InputStream exportMasterListShapefile(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 {
MasterListShapefileExporter exporter = new MasterListShapefileExporter(version, mdBusiness, mdAttributes, filterJson);
return exporter.export();
} catch (IOException e) {
throw new ProgrammingErrorException(e);
}
}
use of com.runwaysdk.dataaccess.ProgrammingErrorException in project geoprism-registry by terraframe.
the class GeoRegistryUtil method exportListTypeExcel.
@Transaction
public static InputStream exportListTypeExcel(String oid, String json) {
ListTypeVersion version = ListTypeVersion.get(oid);
MdBusinessDAOIF mdBusiness = MdBusinessDAO.get(version.getMdBusinessOid());
JsonObject criteria = (json != null) ? JsonParser.parseString(json).getAsJsonObject() : new JsonObject();
List<? extends MdAttributeConcreteDAOIF> mdAttributes = mdBusiness.definesAttributesOrdered().stream().filter(mdAttribute -> version.isValid(mdAttribute)).collect(Collectors.toList());
if (json.contains("invalid")) {
mdAttributes = mdAttributes.stream().filter(mdAttribute -> !mdAttribute.definesAttribute().equals("invalid")).collect(Collectors.toList());
}
try {
ListTypeExcelExporter exporter = new ListTypeExcelExporter(version, mdBusiness, mdAttributes, null, criteria);
return exporter.export();
} catch (IOException e) {
throw new ProgrammingErrorException(e);
}
}
use of com.runwaysdk.dataaccess.ProgrammingErrorException in project geoprism-registry by terraframe.
the class ListTypeVersion method downloadShapefile.
public InputStream downloadShapefile() {
String filename = this.getOid() + ".zip";
final ListType list = this.getListType();
final File directory = list.getShapefileDirectory();
directory.mkdirs();
final File file = new File(directory, filename);
try {
return new FileInputStream(file);
} catch (FileNotFoundException e) {
throw new ProgrammingErrorException(e);
}
}
use of com.runwaysdk.dataaccess.ProgrammingErrorException in project geoprism-registry by terraframe.
the class MasterListVersion method downloadShapefile.
public InputStream downloadShapefile() {
String filename = this.getOid() + ".zip";
final MasterList list = this.getMasterlist();
final File directory = list.getShapefileDirectory();
directory.mkdirs();
final File file = new File(directory, filename);
try {
return new FileInputStream(file);
} catch (FileNotFoundException e) {
throw new ProgrammingErrorException(e);
}
}
use of com.runwaysdk.dataaccess.ProgrammingErrorException in project geoprism-registry by terraframe.
the class ETLService method importEdgeJson.
@Request(RequestType.SESSION)
public void importEdgeJson(String sessionId, String relationshipType, String graphTypeCode, Date startDate, Date endDate, InputStream stream) {
try {
GraphType graphType = GraphType.getByCode(relationshipType, graphTypeCode);
EdgeJsonImporter importer = new EdgeJsonImporter(stream, graphType, startDate, endDate);
importer.importData();
} catch (JsonSyntaxException | IOException e) {
throw new ProgrammingErrorException(e);
}
}
Aggregations