use of com.runwaysdk.session.Session in project geoprism-registry by terraframe.
the class ListTypeService method createVersion.
@Request(RequestType.SESSION)
public JsonObject createVersion(String sessionId, String oid, String metadata) {
ListTypeEntry entry = ListTypeEntry.get(oid);
ListType listType = entry.getListType();
if (!listType.isValid()) {
throw new InvalidMasterListException();
}
this.enforceWritePermissions(listType);
String version = entry.publish(metadata);
((Session) Session.getCurrentSession()).reloadPermissions();
return JsonParser.parseString(version).getAsJsonObject();
// return entry.toJSON(false);
}
use of com.runwaysdk.session.Session in project geoprism-registry by terraframe.
the class ListTypeService method remove.
@Request(RequestType.SESSION)
public void remove(String sessionId, String oid) {
try {
ListType listType = ListType.get(oid);
this.enforceWritePermissions(listType);
listType.delete();
((Session) Session.getCurrentSession()).reloadPermissions();
} catch (DataNotFoundException e) {
// Do nothing
}
}
use of com.runwaysdk.session.Session in project geoprism-registry by terraframe.
the class RegistryService method createGeoObjectType.
/**
* Creates a {@link GeoObjectType} from the given JSON.
*
* @param sessionId
* @param gtJSON
* JSON of the {@link GeoObjectType} to be created.
* @return newly created {@link GeoObjectType}
*/
@Request(RequestType.SESSION)
public GeoObjectType createGeoObjectType(String sessionId, String gtJSON) {
ServerGeoObjectType type = null;
type = new ServerGeoObjectTypeConverter().create(gtJSON);
((Session) Session.getCurrentSession()).reloadPermissions();
// If this did not error out then add to the cache
ServiceFactory.getMetadataCache().addGeoObjectType(type);
NotificationFacade.queue(new GlobalNotificationMessage(MessageType.TYPE_CACHE_CHANGE, null));
return type.getType();
}
use of com.runwaysdk.session.Session in project geoprism-registry by terraframe.
the class UndirectedGraphTypeService method create.
@Request(RequestType.SESSION)
public JsonObject create(String sessionId, String json) {
JsonObject object = JsonParser.parseString(json).getAsJsonObject();
UndirectedGraphType type = UndirectedGraphType.create(object);
((Session) Session.getCurrentSession()).reloadPermissions();
return type.toJSON();
}
use of com.runwaysdk.session.Session in project geoprism-registry by terraframe.
the class LocalizationService method uninstallLocaleInTransaction.
@Transaction
private void uninstallLocaleInTransaction(LocaleView view) {
com.runwaysdk.localization.LocalizationFacade.uninstall(view.getLocale());
new WMSService().createAllWMSLayers(true);
// Refresh the users session
((Session) Session.getCurrentSession()).reloadPermissions();
// Refresh the entire metadata cache
ServiceFactory.getRegistryService().refreshMetadataCache();
}
Aggregations