Search in sources :

Example 16 with DocumentElement

use of com.hack23.cia.model.external.riksdagen.dokumentlista.impl.DocumentElement in project cia by Hack23.

the class DocumentAttachementsPageModContentFactoryImpl 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);
    final DataContainer<DocumentElement, String> documentElementDataContainer = getApplicationManager().getDataContainer(DocumentElement.class);
    final DataContainer<DocumentStatusContainer, String> documentStatusContainerDataContainer = getApplicationManager().getDataContainer(DocumentStatusContainer.class);
    getApplicationManager().getDataContainer(CommitteeProposalComponentData.class);
    final DocumentElement documentElement = documentElementDataContainer.load(pageId);
    if (documentElement != null) {
        getDocumentMenuItemFactory().createDocumentMenuBar(menuBar, pageId);
        final DocumentStatusContainer documentStatusContainer = documentStatusContainerDataContainer.findByQueryProperty(DocumentStatusContainer.class, DocumentStatusContainer_.document, DocumentData.class, DocumentData_.id, pageId);
        LabelFactory.createHeader2Label(panelContent, DOCUMENT_ATTACHMENTS);
        if (documentStatusContainer != null && documentStatusContainer.getDocumentAttachmentContainer() != null && documentStatusContainer.getDocumentAttachmentContainer().getDocumentAttachmentList() != null) {
            getGridFactory().createBasicBeanItemGrid(panelContent, DocumentAttachment.class, documentStatusContainer.getDocumentAttachmentContainer().getDocumentAttachmentList(), DOCUMENT_ATTACHMENTS, COLUMN_ORDER, HIDE_COLUMNS, null, null, null);
            displayDocumentAttachements(panelContent, documentStatusContainer.getDocumentAttachmentContainer().getDocumentAttachmentList());
        }
        panel.setContent(panelContent);
        getPageActionEventHelper().createPageEvent(ViewAction.VISIT_DOCUMENT_VIEW, ApplicationEventGroup.USER, NAME, parameters, pageId);
    }
    return panelContent;
}
Also used : DocumentStatusContainer(com.hack23.cia.model.external.riksdagen.dokumentstatus.impl.DocumentStatusContainer) DocumentElement(com.hack23.cia.model.external.riksdagen.dokumentlista.impl.DocumentElement) VerticalLayout(com.vaadin.ui.VerticalLayout) Secured(org.springframework.security.access.annotation.Secured)

Aggregations

DocumentElement (com.hack23.cia.model.external.riksdagen.dokumentlista.impl.DocumentElement)15 Secured (org.springframework.security.access.annotation.Secured)11 VerticalLayout (com.vaadin.ui.VerticalLayout)10 DocumentStatusContainer (com.hack23.cia.model.external.riksdagen.dokumentstatus.impl.DocumentStatusContainer)7 ArrayList (java.util.ArrayList)3 DocumentContentData (com.hack23.cia.model.external.riksdagen.documentcontent.impl.DocumentContentData)2 DocumentContainerElement (com.hack23.cia.model.external.riksdagen.dokumentlista.impl.DocumentContainerElement)2 BigInteger (java.math.BigInteger)2 JAXBElement (javax.xml.bind.JAXBElement)2 DocumentType (com.hack23.cia.model.external.riksdagen.dokumentlista.impl.DocumentType)1 UserAccount (com.hack23.cia.model.internal.application.user.impl.UserAccount)1 CreateApplicationEventRequest (com.hack23.cia.service.api.action.application.CreateApplicationEventRequest)1 DocumentWordCountRequest (com.hack23.cia.service.api.action.user.DocumentWordCountRequest)1 DocumentWordCountResponse (com.hack23.cia.service.api.action.user.DocumentWordCountResponse)1 SearchDocumentResponse (com.hack23.cia.service.api.action.user.SearchDocumentResponse)1 AbstractServiceComponentAgentFunctionalIntegrationTest (com.hack23.cia.service.component.agent.impl.AbstractServiceComponentAgentFunctionalIntegrationTest)1 FormLayout (com.vaadin.ui.FormLayout)1 Label (com.vaadin.ui.Label)1 Panel (com.vaadin.ui.Panel)1 ConcurrentHashMap (java.util.concurrent.ConcurrentHashMap)1