Search in sources :

Example 6 with ApplicationActionEvent

use of com.hack23.cia.model.internal.application.system.impl.ApplicationActionEvent in project cia by Hack23.

the class UserHomeApplicationEventsPageModContentFactoryImpl method createContent.

@Secured({ "ROLE_USER", "ROLE_ADMIN" })
@Override
public Layout createContent(final String parameters, final MenuBar menuBar, final Panel panel) {
    final VerticalLayout panelContent = createPanelContent();
    final String pageId = getPageId(parameters);
    userHomeMenuItemFactory.createUserHomeMenuBar(menuBar, pageId);
    LabelFactory.createHeader2Label(panelContent, USER_EVENTS);
    final Long userIdFromSecurityContext = UserContextUtil.getUserInternalIdFromSecurityContext();
    if (userIdFromSecurityContext == null) {
        UI.getCurrent().getNavigator().navigateTo(CommonsViews.MAIN_VIEW_NAME);
    } else {
        final DataContainer<UserAccount, Long> dataContainer = getApplicationManager().getDataContainer(UserAccount.class);
        final UserAccount userAccount = dataContainer.load(userIdFromSecurityContext);
        final DataContainer<ApplicationActionEvent, Long> eventDataContainer = getApplicationManager().getDataContainer(ApplicationActionEvent.class);
        getGridFactory().createBasicBeanItemGrid(panelContent, ApplicationActionEvent.class, eventDataContainer.findOrderedListByProperty(ApplicationActionEvent_.userId, userAccount.getUserId(), ApplicationActionEvent_.createdDate), APPLICATION_ACTION_EVENT, COLUMN_ORDER, HIDE_COLUMNS, LISTENER, null, null);
    }
    panel.setCaption(NAME + "::" + USERHOME + USER_EVENTS);
    getPageActionEventHelper().createPageEvent(ViewAction.VISIT_USER_HOME_VIEW, ApplicationEventGroup.USER, NAME, parameters, pageId);
    return panelContent;
}
Also used : ApplicationActionEvent(com.hack23.cia.model.internal.application.system.impl.ApplicationActionEvent) VerticalLayout(com.vaadin.ui.VerticalLayout) UserAccount(com.hack23.cia.model.internal.application.user.impl.UserAccount) Secured(org.springframework.security.access.annotation.Secured)

Aggregations

ApplicationActionEvent (com.hack23.cia.model.internal.application.system.impl.ApplicationActionEvent)6 ApplicationSession (com.hack23.cia.model.internal.application.system.impl.ApplicationSession)3 UserAccount (com.hack23.cia.model.internal.application.user.impl.UserAccount)3 Date (java.util.Date)3 ApplicationConfiguration (com.hack23.cia.model.internal.application.system.impl.ApplicationConfiguration)2 VerticalLayout (com.vaadin.ui.VerticalLayout)2 ArrayList (java.util.ArrayList)2 List (java.util.List)2 Secured (org.springframework.security.access.annotation.Secured)2 ManageUserAccountRequest (com.hack23.cia.service.api.action.admin.ManageUserAccountRequest)1 ManageUserAccountResponse (com.hack23.cia.service.api.action.admin.ManageUserAccountResponse)1 CreateApplicationEventResponse (com.hack23.cia.service.api.action.application.CreateApplicationEventResponse)1 CreateApplicationSessionRequest (com.hack23.cia.service.api.action.application.CreateApplicationSessionRequest)1 RegisterUserRequest (com.hack23.cia.service.api.action.application.RegisterUserRequest)1 RegisterUserResponse (com.hack23.cia.service.api.action.application.RegisterUserResponse)1 AbstractServiceFunctionalIntegrationTest (com.hack23.cia.service.impl.AbstractServiceFunctionalIntegrationTest)1 Serializable (java.io.Serializable)1 Test (org.junit.Test)1