use of net.geoprism.registry.model.ClassificationType in project geoprism-registry by terraframe.
the class ClassificationService method removeChild.
@Request(RequestType.SESSION)
public void removeChild(String sessionId, String classificationCode, String parentCode, String childCode) {
ClassificationType type = ClassificationType.getByCode(classificationCode);
Classification parent = Classification.get(type, parentCode);
Classification child = Classification.get(type, childCode);
parent.removeChild(child);
}
use of net.geoprism.registry.model.ClassificationType in project geoprism-registry by terraframe.
the class ClassificationService method remove.
@Request(RequestType.SESSION)
public void remove(String sessionId, String classificationCode, String code) {
ClassificationType type = ClassificationType.getByCode(classificationCode);
Classification classification = Classification.get(type, code);
classification.delete();
}
use of net.geoprism.registry.model.ClassificationType in project geoprism-registry by terraframe.
the class ClassificationTypeTest method testPage.
@Test
@Request
public void testPage() {
ClassificationType classificationType = ClassificationType.apply(createMock());
try {
Page<ClassificationType> page = ClassificationType.page(new JsonObject());
Assert.assertEquals(new Long(1), page.getCount());
ClassificationType result = page.getResults().get(0);
Assert.assertEquals(classificationType.getOid(), result.getOid());
} finally {
classificationType.delete();
}
}
use of net.geoprism.registry.model.ClassificationType in project geoprism-registry by terraframe.
the class ClassificationTypeTest method testUpdate.
@Test
@Request
public void testUpdate() {
ClassificationType type = ClassificationType.apply(createMock());
try {
String label = "Updated";
JsonObject json = type.toJSON();
json.add(MdClassificationInfo.DISPLAY_LABEL, new LocalizedValue(label).toJSON());
type = ClassificationType.apply(json);
Assert.assertEquals(label, type.getDisplayLabel().getValue());
} finally {
type.delete();
}
}
Aggregations