use of com.runwaysdk.localization.SupportedLocaleIF in project geoprism-registry by terraframe.
the class LocalizationService method installLocaleInTransaction.
@Transaction
private LocaleView installLocaleInTransaction(LocaleView view) {
SupportedLocaleIF supportedLocale = (SupportedLocale) com.runwaysdk.localization.LocalizationFacade.install(view.getLocale());
supportedLocale.appLock();
view.populate(supportedLocale);
supportedLocale.apply();
new WMSService().createAllWMSLayers(true);
// Refresh the users session
((Session) Session.getCurrentSession()).reloadPermissions();
// Refresh the entire metadata cache
ServiceFactory.getRegistryService().refreshMetadataCache();
return LocaleView.fromSupportedLocale(supportedLocale);
}
use of com.runwaysdk.localization.SupportedLocaleIF 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.localization.SupportedLocaleIF in project geoprism-registry by terraframe.
the class RegistryService method getLocales.
@Request(RequestType.SESSION)
public JsonArray getLocales(String sessionId) {
Set<SupportedLocaleIF> locales = LocalizationFacade.getSupportedLocales();
JsonArray array = new JsonArray();
array.add(new DefaultLocaleView().toJson());
for (SupportedLocaleIF locale : locales) {
array.add(LocaleView.fromSupportedLocale(locale).toJson());
}
return array;
}
Aggregations