Search in sources :

Example 11 with ShowSuccessEvent

use of org.openremote.app.client.event.ShowSuccessEvent in project openremote by openremote.

the class AdminTenantActivity method delete.

@Override
public void delete() {
    adminContent.showConfirmation(environment.getMessages().confirmation(), environment.getMessages().confirmationDelete(this.realm), () -> {
        adminContent.setFormBusy(true);
        adminContent.clearFormMessages();
        clearViewFieldErrors();
        environment.getApp().getRequests().send(requestParams -> tenantResource.delete(requestParams, this.realm), 204, () -> {
            adminContent.setFormBusy(false);
            environment.getEventBus().dispatch(new ShowSuccessEvent(environment.getMessages().tenantDeleted(tenant.getDisplayName())));
            environment.getPlaceController().goTo(new AdminTenantsPlace());
        });
    });
}
Also used : ShowSuccessEvent(org.openremote.app.client.event.ShowSuccessEvent)

Example 12 with ShowSuccessEvent

use of org.openremote.app.client.event.ShowSuccessEvent in project openremote by openremote.

the class AdminTenantActivity method create.

@Override
public void create() {
    adminContent.setFormBusy(true);
    adminContent.clearFormMessages();
    clearViewFieldErrors();
    readFromView();
    environment.getApp().getRequests().sendWith(tenantMapper, requestParams -> tenantResource.create(requestParams, tenant), 204, () -> {
        adminContent.setFormBusy(false);
        environment.getEventBus().dispatch(new ShowSuccessEvent(environment.getMessages().tenantCreated(tenant.getDisplayName())));
        environment.getPlaceController().goTo(new AdminTenantsPlace());
    }, validationErrorHandler);
}
Also used : ShowSuccessEvent(org.openremote.app.client.event.ShowSuccessEvent)

Example 13 with ShowSuccessEvent

use of org.openremote.app.client.event.ShowSuccessEvent in project openremote by openremote.

the class AdminUserEditActivity method onDeviceRegistrationDelete.

@Override
public void onDeviceRegistrationDelete(DeviceNotificationToken.Id id) {
    environment.getApp().getRequests().send(requestParams -> notificationResource.deleteDeviceToken(requestParams, id.getUserId(), id.getDeviceId()), 204, () -> {
        adminContent.removeDeviceRegistration(id);
        environment.getEventBus().dispatch(new ShowSuccessEvent(environment.getMessages().registeredDeviceDeleted(id.getDeviceId())));
    });
}
Also used : ShowSuccessEvent(org.openremote.app.client.event.ShowSuccessEvent)

Example 14 with ShowSuccessEvent

use of org.openremote.app.client.event.ShowSuccessEvent in project openremote by openremote.

the class AdminUserEditActivity method create.

@Override
public void create() {
    adminContent.setFormBusy(true);
    adminContent.clearFormMessages();
    clearViewFieldErrors();
    readFromView();
    environment.getApp().getRequests().sendWith(userMapper, requestParams -> userResource.create(requestParams, realm, user), 204, () -> {
        adminContent.setFormBusy(false);
        environment.getEventBus().dispatch(new ShowSuccessEvent(environment.getMessages().userCreated(user.getUsername())));
        environment.getPlaceController().goTo(new AdminUsersPlace(realm));
    }, validationErrorHandler);
}
Also used : ShowSuccessEvent(org.openremote.app.client.event.ShowSuccessEvent) AdminUsersPlace(org.openremote.app.client.admin.users.AdminUsersPlace)

Example 15 with ShowSuccessEvent

use of org.openremote.app.client.event.ShowSuccessEvent in project openremote by openremote.

the class AdminUserNotificationsActivity method onNotificationDelete.

@Override
public void onNotificationDelete(Long id) {
    adminContent.setFormBusy(true);
    environment.getApp().getRequests().send(requestParams -> notificationResource.removeNotification(requestParams, userId, id), 204, () -> {
        adminContent.setFormBusy(false);
        adminContent.removeNotification(id);
        environment.getEventBus().dispatch(new ShowSuccessEvent(environment.getMessages().notificationDeleted(id)));
    });
}
Also used : ShowSuccessEvent(org.openremote.app.client.event.ShowSuccessEvent)

Aggregations

ShowSuccessEvent (org.openremote.app.client.event.ShowSuccessEvent)17 AdminUsersPlace (org.openremote.app.client.admin.users.AdminUsersPlace)2 IsWidget (com.google.gwt.user.client.ui.IsWidget)1 Browser (elemental.client.Browser)1 java.util (java.util)1 Environment (org.openremote.app.client.Environment)1 AbstractAttributeViewExtension (org.openremote.app.client.assets.attributes.AbstractAttributeViewExtension)1 AttributeView (org.openremote.app.client.assets.attributes.AttributeView)1 AttributeViewImpl (org.openremote.app.client.assets.attributes.AttributeViewImpl)1 org.openremote.app.client.widget (org.openremote.app.client.widget)1 ValidationFailure (org.openremote.model.ValidationFailure)1 AssetAttribute (org.openremote.model.asset.AssetAttribute)1 UserAsset (org.openremote.model.asset.UserAsset)1 AttributeRef (org.openremote.model.attribute.AttributeRef)1 AttributeValidationResult (org.openremote.model.attribute.AttributeValidationResult)1 EventRegistration (org.openremote.model.event.bus.EventRegistration)1 Consumer (org.openremote.model.interop.Consumer)1 RequestSimulatorState (org.openremote.model.simulator.RequestSimulatorState)1 SimulatorElement (org.openremote.model.simulator.SimulatorElement)1 SimulatorState (org.openremote.model.simulator.SimulatorState)1