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