Search in sources :

Example 11 with DataNotFoundException

use of com.runwaysdk.dataaccess.cache.DataNotFoundException in project geoprism-registry by terraframe.

the class ListTypeService method removeVersion.

@Request(RequestType.SESSION)
public void removeVersion(String sessionId, String oid) {
    try {
        ListTypeVersion version = ListTypeVersion.get(oid);
        if (version.getWorking()) {
            throw new UnsupportedOperationException("Working versions cannot be deleted");
        }
        this.enforceWritePermissions(version.getEntry().getListType());
        version.delete();
        ((Session) Session.getCurrentSession()).reloadPermissions();
    } catch (DataNotFoundException e) {
    // Do nothing
    }
}
Also used : DataNotFoundException(com.runwaysdk.dataaccess.cache.DataNotFoundException) ListTypeVersion(net.geoprism.registry.ListTypeVersion) Session(com.runwaysdk.session.Session) Request(com.runwaysdk.session.Request)

Example 12 with DataNotFoundException

use of com.runwaysdk.dataaccess.cache.DataNotFoundException in project geoprism-registry by terraframe.

the class TaskTest method testDeleteTask.

@Test
@Request
public void testDeleteTask() {
    createInstanceData(chineseSession.getSessionId());
    JsonObject chinaJO = getTaskByName(TestTaskType.TestGeoObjectSplitOrphanedChildren.getTemplateKey(), TaskService.getTasksForCurrentUser(chineseSession.getSessionId()).get("resultSet").getAsJsonArray());
    TaskService.deleteTask(chineseSession.getSessionId(), chinaJO.get("id").getAsString());
    try {
        Task.get(chinaJO.get("id").getAsString());
        Assert.fail();
    } catch (DataNotFoundException e) {
    }
}
Also used : DataNotFoundException(com.runwaysdk.dataaccess.cache.DataNotFoundException) JsonObject(com.google.gson.JsonObject) Test(org.junit.Test) Request(com.runwaysdk.session.Request)

Aggregations

DataNotFoundException (com.runwaysdk.dataaccess.cache.DataNotFoundException)12 Request (com.runwaysdk.session.Request)5 MdAttributeConcreteDAOIF (com.runwaysdk.dataaccess.MdAttributeConcreteDAOIF)4 Classifier (net.geoprism.ontology.Classifier)4 JsonObject (com.google.gson.JsonObject)3 Transaction (com.runwaysdk.dataaccess.transaction.Transaction)3 JsonArray (com.google.gson.JsonArray)2 AttributeDoesNotExistException (com.runwaysdk.dataaccess.AttributeDoesNotExistException)2 MdAttributeMomentDAOIF (com.runwaysdk.dataaccess.MdAttributeMomentDAOIF)2 MdAttributeMultiTermDAOIF (com.runwaysdk.dataaccess.MdAttributeMultiTermDAOIF)2 MdAttributeTermDAOIF (com.runwaysdk.dataaccess.MdAttributeTermDAOIF)2 MdBusinessDAOIF (com.runwaysdk.dataaccess.MdBusinessDAOIF)2 MdAttributePointDAOIF (com.runwaysdk.gis.dataaccess.MdAttributePointDAOIF)2 Session (com.runwaysdk.session.Session)2 MdAttributeLineString (com.runwaysdk.system.gis.metadata.MdAttributeLineString)2 MdAttributeMultiLineString (com.runwaysdk.system.gis.metadata.MdAttributeMultiLineString)2 MdAttributeMultiPoint (com.runwaysdk.system.gis.metadata.MdAttributeMultiPoint)2 MdAttributePoint (com.runwaysdk.system.gis.metadata.MdAttributePoint)2 MdBusiness (com.runwaysdk.system.metadata.MdBusiness)2 HashMap (java.util.HashMap)2