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;
}
Aggregations