Search in sources :

Example 16 with DataContainer

use of com.hack23.cia.service.api.DataContainer in project cia by Hack23.

the class DocumentDetailsPageModContentFactoryImpl 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_DETAILS);
        if (documentStatusContainer != null && documentStatusContainer.getDocumentDetailContainer() != null && documentStatusContainer.getDocumentDetailContainer().getDocumentDetailList() != null) {
            getGridFactory().createBasicBeanItemGrid(panelContent, DocumentDetailData.class, documentStatusContainer.getDocumentDetailContainer().getDocumentDetailList(), DOCUMENT_DETAILS2, COLUMN_ORDER, HIDE_COLUMNS, null, null, null);
        }
        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)

Example 17 with DataContainer

use of com.hack23.cia.service.api.DataContainer in project cia by Hack23.

the class DocumentOverviewPageModContentFactoryImpl 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);
    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, OVERVIEW);
        getFormFactory().addFormPanelTextFields(panelContent, documentElement, DocumentElement.class, AS_LIST);
        if (documentStatusContainer != null) {
            getFormFactory().addFormPanelTextFields(panelContent, documentStatusContainer, DocumentStatusContainer.class, AS_LIST3);
            getFormFactory().addFormPanelTextFields(panelContent, documentStatusContainer.getDocument(), DocumentData.class, AS_LIST2);
        }
        final VerticalLayout overviewLayout = new VerticalLayout();
        overviewLayout.setSizeFull();
        panelContent.addComponent(overviewLayout);
        panelContent.setExpandRatio(overviewLayout, ContentRatio.LARGE_FORM);
        getDocumentMenuItemFactory().createOverviewPage(overviewLayout, pageId);
        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)

Example 18 with DataContainer

use of com.hack23.cia.service.api.DataContainer in project cia by Hack23.

the class DocumentPageVisitHistoryPageModContentFactoryImpl 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);
    getApplicationManager().getDataContainer(CommitteeProposalComponentData.class);
    final DocumentElement documentElement = documentElementDataContainer.load(pageId);
    if (documentElement != null) {
        getDocumentMenuItemFactory().createDocumentMenuBar(menuBar, pageId);
        createPageVisitHistory(NAME, pageId, panelContent);
        panel.setContent(panelContent);
        getPageActionEventHelper().createPageEvent(ViewAction.VISIT_DOCUMENT_VIEW, ApplicationEventGroup.USER, NAME, parameters, pageId);
    }
    return panelContent;
}
Also used : DocumentElement(com.hack23.cia.model.external.riksdagen.dokumentlista.impl.DocumentElement) VerticalLayout(com.vaadin.ui.VerticalLayout) Secured(org.springframework.security.access.annotation.Secured)

Example 19 with DataContainer

use of com.hack23.cia.service.api.DataContainer in project cia by Hack23.

the class DocumentReferencesPageModContentFactoryImpl 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_REFERENCES);
        if (documentStatusContainer != null && documentStatusContainer.getDocumentReferenceContainer() != null && documentStatusContainer.getDocumentReferenceContainer().getDocumentReferenceList() != null) {
            getGridFactory().createBasicBeanItemGrid(panelContent, DocumentReferenceData.class, documentStatusContainer.getDocumentReferenceContainer().getDocumentReferenceList(), DOCUMENT_REFERENCES2, COLUMN_ORDER, HIDE_COLUMNS, null, null, null);
        }
        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)

Example 20 with DataContainer

use of com.hack23.cia.service.api.DataContainer in project cia by Hack23.

the class CommitteePageVisitHistoryPageModContentFactoryImpl 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<ViewRiksdagenCommittee, String> dataContainer = getApplicationManager().getDataContainer(ViewRiksdagenCommittee.class);
    final ViewRiksdagenCommittee viewRiksdagenCommittee = dataContainer.load(pageId);
    if (viewRiksdagenCommittee != null) {
        getCommitteeMenuItemFactory().createCommitteeeMenuBar(menuBar, pageId);
        createPageVisitHistory(NAME, pageId, panelContent);
        panel.setCaption(NAME + "::" + COMMITTEE + viewRiksdagenCommittee.getEmbeddedId().getDetail());
        getPageActionEventHelper().createPageEvent(ViewAction.VISIT_COMMITTEE_VIEW, ApplicationEventGroup.USER, NAME, parameters, pageId);
    }
    return panelContent;
}
Also used : VerticalLayout(com.vaadin.ui.VerticalLayout) ViewRiksdagenCommittee(com.hack23.cia.model.internal.application.data.committee.impl.ViewRiksdagenCommittee) Secured(org.springframework.security.access.annotation.Secured)

Aggregations

VerticalLayout (com.vaadin.ui.VerticalLayout)75 Secured (org.springframework.security.access.annotation.Secured)75 ViewRiksdagenParty (com.hack23.cia.model.internal.application.data.party.impl.ViewRiksdagenParty)19 UserAccount (com.hack23.cia.model.internal.application.user.impl.UserAccount)17 ViewRiksdagenCommittee (com.hack23.cia.model.internal.application.data.committee.impl.ViewRiksdagenCommittee)15 ViewRiksdagenPolitician (com.hack23.cia.model.internal.application.data.politician.impl.ViewRiksdagenPolitician)13 CreateApplicationSessionRequest (com.hack23.cia.service.api.action.application.CreateApplicationSessionRequest)13 RegisterUserRequest (com.hack23.cia.service.api.action.application.RegisterUserRequest)13 RegisterUserResponse (com.hack23.cia.service.api.action.application.RegisterUserResponse)13 AbstractServiceFunctionalIntegrationTest (com.hack23.cia.service.impl.AbstractServiceFunctionalIntegrationTest)13 Test (org.junit.Test)13 ViewRiksdagenMinistry (com.hack23.cia.model.internal.application.data.ministry.impl.ViewRiksdagenMinistry)11 DataSeries (org.dussan.vaadin.dcharts.data.DataSeries)11 DocumentElement (com.hack23.cia.model.external.riksdagen.dokumentlista.impl.DocumentElement)10 PersonData (com.hack23.cia.model.external.riksdagen.person.impl.PersonData)10 PerfTest (org.databene.contiperf.PerfTest)10 DocumentStatusContainer (com.hack23.cia.model.external.riksdagen.dokumentstatus.impl.DocumentStatusContainer)8 ViewRiksdagenPartySummary (com.hack23.cia.model.internal.application.data.party.impl.ViewRiksdagenPartySummary)7 LoginRequest (com.hack23.cia.service.api.action.application.LoginRequest)7 LoginResponse (com.hack23.cia.service.api.action.application.LoginResponse)7