use of net.geoprism.registry.model.ServerGeoObjectIF in project geoprism-registry by terraframe.
the class LocationService method search.
@Request(RequestType.SESSION)
public List<GeoObject> search(String sessionId, String text, Date date) {
final GeoObjectPermissionService pService = new GeoObjectPermissionService();
List<ServerGeoObjectIF> results = new SearchService().search(text, date, 20L);
return results.stream().collect(() -> new LinkedList<GeoObject>(), (list, element) -> {
ServerGeoObjectType type = element.getType();
GeoObject geoObject = element.toGeoObject(date);
geoObject.setWritable(pService.canCreateCR(type.getOrganization().getCode(), type));
list.add(geoObject);
}, (listA, listB) -> {
});
}
use of net.geoprism.registry.model.ServerGeoObjectIF in project geoprism-registry by terraframe.
the class RegistryService method search.
@Request(RequestType.SESSION)
public List<GeoObject> search(String sessionId, String typeCode, String text, Date date) {
List<GeoObject> objects = new LinkedList<GeoObject>();
if (date == null) {
date = ValueOverTime.INFINITY_END_DATE;
}
ServerGeoObjectType type = ServerGeoObjectType.get(typeCode);
ServerGeoObjectQuery query = this.service.createQuery(type, date);
query.setRestriction(new ServerSynonymRestriction(text, date));
query.setLimit(20);
List<ServerGeoObjectIF> results = query.getResults();
for (ServerGeoObjectIF result : results) {
objects.add(result.toGeoObject(date));
}
return objects;
}
use of net.geoprism.registry.model.ServerGeoObjectIF in project geoprism-registry by terraframe.
the class RegistryService method createGeoObject.
@Request(RequestType.SESSION)
public GeoObject createGeoObject(String sessionId, String jGeoObj, Date startDate, Date endDate) {
GeoObject geoObject = GeoObject.fromJSON(adapter, jGeoObj);
ServerGeoObjectIF object = service.apply(geoObject, startDate, endDate, true, false);
return object.toGeoObject(startDate);
}
use of net.geoprism.registry.model.ServerGeoObjectIF in project geoprism-registry by terraframe.
the class RegistryService method newGeoObjectInstanceOverTime.
@Request(RequestType.SESSION)
public String newGeoObjectInstanceOverTime(String sessionId, String typeCode) {
final ServerGeoObjectType type = ServerGeoObjectType.get(typeCode);
ServerGeoObjectIF go = service.newInstance(type);
go.setInvalid(false);
final GeoObjectOverTime goot = go.toGeoObjectOverTime();
ServerParentTreeNodeOverTime pot = go.getParentsOverTime(null, true);
HierarchyService.filterHierarchiesFromPermissions(type, pot);
/**
* Serialize the GeoObject and add it to the response
*/
JsonObject response = new JsonObject();
response.add("geoObject", goot.toJSON());
response.add("hierarchies", pot.toJSON());
return response.toString();
}
use of net.geoprism.registry.model.ServerGeoObjectIF in project geoprism-registry by terraframe.
the class RegistryService method getChildGeoObjects.
@Request(RequestType.SESSION)
public ChildTreeNode getChildGeoObjects(String sessionId, String parentCode, String parentGeoObjectTypeCode, String[] childrenTypes, Boolean recursive, Date date) {
ServerGeoObjectIF object = this.service.getGeoObjectByCode(parentCode, parentGeoObjectTypeCode, true);
if (date != null) {
object.setDate(date);
}
ServerChildTreeNode node = object.getChildGeoObjects(childrenTypes, recursive, date);
return node.toNode(true);
}
Aggregations