use of com.hack23.cia.service.api.action.admin.RefreshDataViewsRequest in project cia by Hack23.
the class RefreshDataViewsClickListener method buttonClick.
@Override
public void buttonClick(final ClickEvent event) {
final RefreshDataViewsRequest serviceRequest = new RefreshDataViewsRequest();
serviceRequest.setSessionId(RequestContextHolder.currentRequestAttributes().getSessionId());
ApplicationMangerAccess.getApplicationManager().asyncService(serviceRequest);
Notification.show(REFRESH_VIEWS_STARTED);
}
use of com.hack23.cia.service.api.action.admin.RefreshDataViewsRequest in project cia by Hack23.
the class RefreshDataViewsService method createApplicationEventForService.
@Override
protected CreateApplicationEventRequest createApplicationEventForService(final RefreshDataViewsRequest serviceRequest) {
final CreateApplicationEventRequest eventRequest = new CreateApplicationEventRequest();
eventRequest.setEventGroup(ApplicationEventGroup.ADMIN);
eventRequest.setApplicationOperation(ApplicationOperationType.UPDATE);
eventRequest.setActionName(RefreshDataViewsRequest.class.getSimpleName());
eventRequest.setSessionId(serviceRequest.getSessionId());
return eventRequest;
}
use of com.hack23.cia.service.api.action.admin.RefreshDataViewsRequest in project cia by Hack23.
the class RefreshDataViewsService method processService.
@Override
@Secured({ "ROLE_ADMIN" })
public RefreshDataViewsResponse processService(final RefreshDataViewsRequest serviceRequest) {
final RefreshDataViewsResponse inputValidation = inputValidation(serviceRequest);
if (inputValidation != null) {
return inputValidation;
}
final CreateApplicationEventRequest eventRequest = createApplicationEventForService(serviceRequest);
final UserAccount userAccount = getUserAccountFromSecurityContext();
if (userAccount != null) {
eventRequest.setUserId(userAccount.getUserId());
}
final RefreshDataViewsResponse response = new RefreshDataViewsResponse(ServiceResult.SUCCESS);
viewDataManager.refreshViews();
eventRequest.setApplicationMessage(response.getResult().toString());
createApplicationEventService.processService(eventRequest);
return response;
}
use of com.hack23.cia.service.api.action.admin.RefreshDataViewsRequest in project cia by Hack23.
the class RefreshDataViewsServiceITest method Test.
/**
* Test.
*
* @throws Exception
* the exception
*/
@Test
public void Test() throws Exception {
setAuthenticatedAdminuser();
final CreateApplicationSessionRequest createSessionRequest = createTestApplicationSession();
final RefreshDataViewsRequest serviceRequest = new RefreshDataViewsRequest();
serviceRequest.setSessionId(createSessionRequest.getSessionId());
final RefreshDataViewsResponse response = (RefreshDataViewsResponse) applicationManager.service(serviceRequest);
assertNotNull(EXPECT_A_RESULT, response);
assertEquals(EXPECT_SUCCESS, ServiceResult.SUCCESS, response.getResult());
}
Aggregations