Search in sources :

Example 1 with SearchDocumentClickListener

use of com.hack23.cia.web.impl.ui.application.views.pageclicklistener.SearchDocumentClickListener in project cia by Hack23.

the class SearchDocumentPageModContentFactoryImpl method createContent.

@Secured({ "ROLE_ANONYMOUS", "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);
    documentMenuItemFactory.createDocumentsMenuBar(menuBar);
    final VerticalLayout searchLayout = new VerticalLayout();
    searchLayout.setSizeFull();
    panelContent.addComponent(searchLayout);
    final VerticalLayout searchresultLayout = new VerticalLayout();
    searchresultLayout.setSizeFull();
    final Panel formPanel = new Panel();
    formPanel.setSizeFull();
    searchresultLayout.addComponent(formPanel);
    final FormLayout formContent = new FormLayout();
    formPanel.setContent(formContent);
    panelContent.addComponent(searchresultLayout);
    panelContent.setExpandRatio(searchresultLayout, ContentRatio.LARGE);
    final SearchDocumentRequest searchRequest = new SearchDocumentRequest();
    searchRequest.setSessionId(RequestContextHolder.currentRequestAttributes().getSessionId());
    searchRequest.setMaxResults(MAX_RESULT_SIZE);
    searchRequest.setSearchExpression("");
    getFormFactory().addRequestInputFormFields(formContent, searchRequest, SearchDocumentRequest.class, AS_LIST, SEARCH, new SearchDocumentClickListener(searchRequest, new SearchDocumentResponseHandlerImpl(getGridFactory(), formPanel, searchresultLayout)));
    getPageActionEventHelper().createPageEvent(ViewAction.VISIT_DOCUMENT_VIEW, ApplicationEventGroup.USER, NAME, parameters, pageId);
    return panelContent;
}
Also used : FormLayout(com.vaadin.ui.FormLayout) Panel(com.vaadin.ui.Panel) SearchDocumentResponseHandlerImpl(com.hack23.cia.web.impl.ui.application.views.pageclicklisteners.handlers.impl.SearchDocumentResponseHandlerImpl) SearchDocumentClickListener(com.hack23.cia.web.impl.ui.application.views.pageclicklistener.SearchDocumentClickListener) SearchDocumentRequest(com.hack23.cia.service.api.action.user.SearchDocumentRequest) VerticalLayout(com.vaadin.ui.VerticalLayout) Secured(org.springframework.security.access.annotation.Secured)

Aggregations

SearchDocumentRequest (com.hack23.cia.service.api.action.user.SearchDocumentRequest)1 SearchDocumentClickListener (com.hack23.cia.web.impl.ui.application.views.pageclicklistener.SearchDocumentClickListener)1 SearchDocumentResponseHandlerImpl (com.hack23.cia.web.impl.ui.application.views.pageclicklisteners.handlers.impl.SearchDocumentResponseHandlerImpl)1 FormLayout (com.vaadin.ui.FormLayout)1 Panel (com.vaadin.ui.Panel)1 VerticalLayout (com.vaadin.ui.VerticalLayout)1 Secured (org.springframework.security.access.annotation.Secured)1