@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<ViewRiksdagenMinistry, String> dataContainer =
        getApplicationManager().getDataContainer(ViewRiksdagenMinistry.class);

    final ViewRiksdagenMinistry viewRiksdagenMinistry = dataContainer.load(pageId);

    if (viewRiksdagenMinistry != null) {

      getMinistryMenuItemFactory().createMinistryMenuBar(menuBar, pageId);

      LabelFactory.createHeader2Label(panelContent, OVERVIEW);

      final Link addMinistryPageLink =
          getPageLinkFactory().addMinistryPageLink(viewRiksdagenMinistry);
      panelContent.addComponent(addMinistryPageLink);

      getFormFactory()
          .addFormPanelTextFields(
              panelContent,
              new BeanItem<>(viewRiksdagenMinistry),
              ViewRiksdagenMinistry.class,
              Arrays.asList(
                  new String[] {
                    "nameId",
                    "active",
                    "firstAssignmentDate",
                    "lastAssignmentDate",
                    "totalAssignments",
                    "totalDaysServed",
                    "currentMemberSize"
                  }));

      panelContent.setExpandRatio(addMinistryPageLink, ContentRatio.SMALL);

      panel.setCaption(MINISTRY + viewRiksdagenMinistry.getNameId());
      getPageActionEventHelper()
          .createPageEvent(
              ViewAction.VISIT_MINISTRY_VIEW, ApplicationEventGroup.USER, NAME, parameters, pageId);
    }

    return panelContent;
  }
  @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, PERSON_REFERENCES);

      if (documentStatusContainer != null
          && documentStatusContainer.getDocumentPersonReferenceContainer() != null
          && documentStatusContainer
                  .getDocumentPersonReferenceContainer()
                  .getDocumentPersonReferenceList()
              != null) {
        final BeanItemContainer<DocumentPersonReferenceData> documentPersonReferenceDataDataSource =
            new BeanItemContainer<>(
                DocumentPersonReferenceData.class,
                documentStatusContainer
                    .getDocumentPersonReferenceContainer()
                    .getDocumentPersonReferenceList());

        getGridFactory()
            .createBasicBeanItemGrid(
                panelContent,
                documentPersonReferenceDataDataSource,
                "Document person references",
                new String[] {
                  "personReferenceId",
                  "referenceName",
                  "partyShortCode",
                  "orderNumber",
                  "roleDescription"
                },
                new String[] {"hjid"},
                "personReferenceId",
                new PageItemPropertyClickListener(
                    UserViews.POLITICIAN_VIEW_NAME, "personReferenceId"),
                null);
      }

      panel.setContent(panelContent);
      getPageActionEventHelper()
          .createPageEvent(
              ViewAction.VISIT_DOCUMENT_VIEW, ApplicationEventGroup.USER, NAME, parameters, pageId);
    }

    return panelContent;
  }