use of com.runwaysdk.session.Session in project geoprism-registry by terraframe.
the class LocalizationService method editLocaleInTransaction.
@Transaction
private LocaleView editLocaleInTransaction(LocaleView view) {
if (view.isDefaultLocale) {
LocalizedValueStore lvs = LocalizedValueStore.getByKey(DefaultLocaleView.LABEL);
lvs.lock();
lvs.getStoreValue().setLocaleMap(view.getLabel().getLocaleMap());
lvs.apply();
view.getLabel().setValue(lvs.getStoreValue().getValue());
return view;
} else {
SupportedLocaleIF supportedLocale = (SupportedLocale) com.runwaysdk.localization.LocalizationFacade.getSupportedLocale(view.getLocale());
supportedLocale.appLock();
view.populate(supportedLocale);
supportedLocale.apply();
// Refresh the users session
((Session) Session.getCurrentSession()).reloadPermissions();
// Refresh the entire metadata cache
ServiceFactory.getRegistryService().refreshMetadataCache();
return LocaleView.fromSupportedLocale(supportedLocale);
}
}
use of com.runwaysdk.session.Session in project geoprism-registry by terraframe.
the class ServerGeoObjectType method createAttributeType.
public AttributeType createAttributeType(AttributeType attributeType) {
MdAttributeConcrete mdAttribute = this.createMdAttributeFromAttributeType(attributeType);
attributeType = new AttributeTypeConverter().build(MdAttributeConcreteDAO.get(mdAttribute.getOid()));
this.type.addAttribute(attributeType);
// If this did not error out then add to the cache
this.refreshCache();
// Refresh the users session
if (Session.getCurrentSession() != null) {
((Session) Session.getCurrentSession()).reloadPermissions();
}
return attributeType;
}
use of com.runwaysdk.session.Session in project geoprism-registry by terraframe.
the class BusinessTypeService method remove.
@Request(RequestType.SESSION)
public void remove(String sessionId, String oid) {
BusinessType type = BusinessType.get(oid);
type.delete();
((Session) Session.getCurrentSession()).reloadPermissions();
}
use of com.runwaysdk.session.Session in project geoprism-registry by terraframe.
the class DirectedAcyclicGraphTypeService method create.
@Request(RequestType.SESSION)
public JsonObject create(String sessionId, String json) {
JsonObject object = JsonParser.parseString(json).getAsJsonObject();
DirectedAcyclicGraphType type = DirectedAcyclicGraphType.create(object);
((Session) Session.getCurrentSession()).reloadPermissions();
return type.toJSON();
}
use of com.runwaysdk.session.Session 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
}
}
Aggregations