Search in sources :

Example 1 with SupportedLocale

use of com.runwaysdk.system.metadata.SupportedLocale 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);
}
Also used : WMSService(net.geoprism.registry.service.WMSService) SupportedLocale(com.runwaysdk.system.metadata.SupportedLocale) SupportedLocaleIF(com.runwaysdk.localization.SupportedLocaleIF) Session(com.runwaysdk.session.Session) Transaction(com.runwaysdk.dataaccess.transaction.Transaction)

Example 2 with SupportedLocale

use of com.runwaysdk.system.metadata.SupportedLocale 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);
    }
}
Also used : SupportedLocale(com.runwaysdk.system.metadata.SupportedLocale) LocalizedValueStore(com.runwaysdk.localization.LocalizedValueStore) SupportedLocaleIF(com.runwaysdk.localization.SupportedLocaleIF) Session(com.runwaysdk.session.Session) Transaction(com.runwaysdk.dataaccess.transaction.Transaction)

Aggregations

Transaction (com.runwaysdk.dataaccess.transaction.Transaction)2 SupportedLocaleIF (com.runwaysdk.localization.SupportedLocaleIF)2 Session (com.runwaysdk.session.Session)2 SupportedLocale (com.runwaysdk.system.metadata.SupportedLocale)2 LocalizedValueStore (com.runwaysdk.localization.LocalizedValueStore)1 WMSService (net.geoprism.registry.service.WMSService)1