Search in sources :

Example 26 with Request

use of com.runwaysdk.session.Request in project geoprism-registry by terraframe.

the class BusinessTypeService method edit.

@Request(RequestType.SESSION)
public JsonObject edit(String sessionId, String oid) {
    BusinessType type = BusinessType.get(oid);
    type.lock();
    return type.toJSON(true);
}
Also used : BusinessType(net.geoprism.registry.BusinessType) Request(com.runwaysdk.session.Request)

Example 27 with Request

use of com.runwaysdk.session.Request in project geoprism-registry by terraframe.

the class BusinessTypeService method apply.

/**
 * Creates a {@link BusinessType} from the given JSON.
 *
 * @param sessionId
 * @param ptJSON
 *          JSON of the {@link BusinessType} to be created.
 * @return newly created {@link BusinessType}
 */
@Request(RequestType.SESSION)
public JsonObject apply(String sessionId, String ptJSON) {
    BusinessType type = BusinessType.apply(JsonParser.parseString(ptJSON).getAsJsonObject());
    ((Session) Session.getCurrentSession()).reloadPermissions();
    return type.toJSON();
}
Also used : BusinessType(net.geoprism.registry.BusinessType) Session(com.runwaysdk.session.Session) Request(com.runwaysdk.session.Request)

Example 28 with Request

use of com.runwaysdk.session.Request in project geoprism-registry by terraframe.

the class BusinessTypeService method unlock.

@Request(RequestType.SESSION)
public void unlock(String sessionId, String oid) {
    BusinessType type = BusinessType.get(oid);
    type.unlock();
}
Also used : BusinessType(net.geoprism.registry.BusinessType) Request(com.runwaysdk.session.Request)

Example 29 with Request

use of com.runwaysdk.session.Request in project geoprism-registry by terraframe.

the class ChangeRequestService method deleteChangeRequest.

@Request(RequestType.SESSION)
public String deleteChangeRequest(String sessionId, String requestId) {
    ChangeRequest request = ChangeRequest.get(requestId);
    if (!this.permService.getPermissions(request).containsAll(Arrays.asList(ChangeRequestPermissionAction.DELETE))) {
        throw new CGRPermissionException();
    }
    request.delete();
    return requestId;
}
Also used : CGRPermissionException(net.geoprism.registry.CGRPermissionException) ChangeRequest(net.geoprism.registry.action.ChangeRequest) Request(com.runwaysdk.session.Request) ChangeRequest(net.geoprism.registry.action.ChangeRequest)

Example 30 with Request

use of com.runwaysdk.session.Request in project geoprism-registry by terraframe.

the class ChangeRequestService method setActionStatus.

@Request(RequestType.SESSION)
public void setActionStatus(String sessionId, String actionOid, String status) {
    AbstractAction action = AbstractAction.get(actionOid);
    if (!this.permService.getPermissions(action.getAllRequest().next()).containsAll(Arrays.asList(ChangeRequestPermissionAction.WRITE_APPROVAL_STATUS))) {
        throw new CGRPermissionException();
    }
    action.appLock();
    action.clearApprovalStatus();
    action.addApprovalStatus(AllGovernanceStatus.valueOf(status));
    action.apply();
}
Also used : CGRPermissionException(net.geoprism.registry.CGRPermissionException) AbstractAction(net.geoprism.registry.action.AbstractAction) Request(com.runwaysdk.session.Request) ChangeRequest(net.geoprism.registry.action.ChangeRequest)

Aggregations

Request (com.runwaysdk.session.Request)340 Test (org.junit.Test)145 JsonObject (com.google.gson.JsonObject)85 ServerGeoObjectIF (net.geoprism.registry.model.ServerGeoObjectIF)73 ServerGeoObjectType (net.geoprism.registry.model.ServerGeoObjectType)73 LocalizedValue (org.commongeoregistry.adapter.dataaccess.LocalizedValue)53 ServerHierarchyType (net.geoprism.registry.model.ServerHierarchyType)40 JsonArray (com.google.gson.JsonArray)36 Date (java.util.Date)33 ChangeRequest (net.geoprism.registry.action.ChangeRequest)32 OAuthClientRequest (org.apache.oltu.oauth2.client.request.OAuthClientRequest)31 QueryFactory (com.runwaysdk.query.QueryFactory)30 ValueOverTime (com.runwaysdk.dataaccess.graph.attributes.ValueOverTime)26 ValueOverTimeCollection (com.runwaysdk.dataaccess.graph.attributes.ValueOverTimeCollection)22 ListType (net.geoprism.registry.ListType)21 SimpleDateFormat (java.text.SimpleDateFormat)19 Classification (net.geoprism.registry.model.Classification)19 VertexServerGeoObject (net.geoprism.registry.model.graph.VertexServerGeoObject)19 ClassificationTypeTest (net.geoprism.registry.classification.ClassificationTypeTest)17 TransitionEvent (net.geoprism.registry.graph.transition.TransitionEvent)17