use of com.runwaysdk.query.QueryFactory in project geoprism-registry by terraframe.
the class ListType method markAllAsInvalid.
@Transaction
public static void markAllAsInvalid(ServerHierarchyType hierarchyType, ServerGeoObjectType type) {
ListTypeQuery query = new ListTypeQuery(new QueryFactory());
query.WHERE(query.getValid().EQ((Boolean) null));
query.OR(query.getValid().EQ(true));
try (OIterator<? extends ListType> iterator = query.getIterator()) {
while (iterator.hasNext()) {
ListType masterlist = iterator.next();
if (hierarchyType != null && type != null) {
masterlist.markAsInvalid(hierarchyType, type);
} else if (hierarchyType != null) {
masterlist.markAsInvalid(hierarchyType);
} else if (type != null) {
masterlist.markAsInvalid(type);
}
}
}
}
use of com.runwaysdk.query.QueryFactory in project geoprism-registry by terraframe.
the class ListType method list.
public static JsonArray list() {
JsonArray response = new JsonArray();
ListTypeQuery query = new ListTypeQuery(new QueryFactory());
try (OIterator<? extends ListType> it = query.getIterator()) {
SimpleDateFormat format = new SimpleDateFormat("yyyy-MM-dd");
it.getAll().stream().filter(list -> list.doesActorHaveReadPermission()).sorted((a, b) -> {
return a.getDisplayLabel().getValue().compareTo(b.getDisplayLabel().getValue());
}).forEach(list -> {
JsonObject object = new JsonObject();
object.addProperty("label", list.getDisplayLabel().getValue());
object.addProperty("oid", list.getOid());
object.addProperty("createDate", format.format(list.getCreateDate()));
object.addProperty("lasteUpdateDate", format.format(list.getLastUpdateDate()));
response.add(object);
});
}
return response;
}
use of com.runwaysdk.query.QueryFactory in project geoprism-registry by terraframe.
the class ListType method deleteAll.
@Transaction
public static void deleteAll(Universal universal) {
ListTypeQuery query = new ListTypeQuery(new QueryFactory());
query.WHERE(query.getUniversal().EQ(universal));
List<? extends ListType> lists = query.getIterator().getAll();
for (ListType list : lists) {
list.delete();
}
}
use of com.runwaysdk.query.QueryFactory in project geoprism-registry by terraframe.
the class ListType method deleteMdAttribute.
public static void deleteMdAttribute(Universal universal, AttributeType attributeType) {
ListTypeQuery query = new ListTypeQuery(new QueryFactory());
query.WHERE(query.getUniversal().EQ(universal));
List<? extends ListType> lists = query.getIterator().getAll();
for (ListType list : lists) {
list.removeAttributeType(attributeType);
}
}
use of com.runwaysdk.query.QueryFactory in project geoprism-registry by terraframe.
the class ListTypeAttributeGroup method remove.
public static void remove(MdAttributeConcreteDAOIF mdAttribute) {
ListTypeAttributeGroupQuery query = new ListTypeAttributeGroupQuery(new QueryFactory());
query.WHERE(query.getTargetAttribute().EQ(mdAttribute.getOid()));
query.OR(query.getSourceAttribute().EQ(mdAttribute.getOid()));
OIterator<? extends ListTypeAttributeGroup> it = query.getIterator();
try {
List<? extends ListTypeAttributeGroup> groups = it.getAll();
for (ListTypeAttributeGroup group : groups) {
group.delete();
}
} finally {
it.close();
}
}
Aggregations