use of org.springframework.security.access.annotation.Secured in project cia by Hack23.
the class CommitteeDecisionSummaryPageModContentFactoryImpl 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);
LabelFactory.createHeader2Label(panelContent, DECISION_SUMMARY);
final DataContainer<ViewRiksdagenCommitteeDecisions, ViewRiksdagenCommitteeDecisionsEmbeddedId> committeeDecisionDataContainer = getApplicationManager().getDataContainer(ViewRiksdagenCommitteeDecisions.class);
final List<ViewRiksdagenCommitteeDecisions> decisionPartySummaryList = committeeDecisionDataContainer.findOrderedListByProperty(ViewRiksdagenCommitteeDecisions_.org, pageId, ViewRiksdagenCommitteeDecisions_.createdDate);
getGridFactory().createBasicBeanItemNestedPropertiesGrid(panelContent, ViewRiksdagenCommitteeDecisions.class, decisionPartySummaryList, DECISION_SUMMARY, NESTED_PROPERTIES, COLUMN_ORDER, HIDE_COLUMNS, LISTENER, BALLOT_ID, null);
panel.setCaption(NAME + "::" + COMMITTEE + viewRiksdagenCommittee.getEmbeddedId().getDetail());
getPageActionEventHelper().createPageEvent(ViewAction.VISIT_COMMITTEE_VIEW, ApplicationEventGroup.USER, NAME, parameters, pageId);
}
return panelContent;
}
use of org.springframework.security.access.annotation.Secured in project cia by Hack23.
the class CommitteeDecisionTypeDailySummaryPageModContentFactoryImpl2 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);
LabelFactory.createHeader2Label(panelContent, DECISION_TYPE_DAILY_SUMMARY);
chartDataManager.createDecisionTypeChart(panelContent, viewRiksdagenCommittee.getEmbeddedId().getOrgCode());
panel.setCaption(NAME + "::" + COMMITTEE + viewRiksdagenCommittee.getEmbeddedId().getDetail());
getPageActionEventHelper().createPageEvent(ViewAction.VISIT_COMMITTEE_VIEW, ApplicationEventGroup.USER, NAME, parameters, pageId);
}
return panelContent;
}
use of org.springframework.security.access.annotation.Secured in project cia by Hack23.
the class CommitteeDocumentActivityPageModContentFactoryImpl 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);
LabelFactory.createHeader2Label(panelContent, DOCUMENT_ACTIVITY);
chartDataManager.createDocumentHistoryChartByOrg(panelContent, viewRiksdagenCommittee.getEmbeddedId().getOrgCode());
panel.setCaption(NAME + "::" + COMMITTEE + viewRiksdagenCommittee.getEmbeddedId().getDetail());
getPageActionEventHelper().createPageEvent(ViewAction.VISIT_COMMITTEE_VIEW, ApplicationEventGroup.USER, NAME, parameters, pageId);
}
return panelContent;
}
use of org.springframework.security.access.annotation.Secured in project cia by Hack23.
the class CommitteeDocumentHistoryPageModContentFactoryImpl 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);
LabelFactory.createHeader2Label(panelContent, DOCUMENT_HISTORY);
final DataContainer<ViewRiksdagenPoliticianDocument, String> politicianDocumentDataContainer = getApplicationManager().getDataContainer(ViewRiksdagenPoliticianDocument.class);
getGridFactory().createBasicBeanItemGrid(panelContent, ViewRiksdagenPoliticianDocument.class, politicianDocumentDataContainer.findOrderedListByProperty(ViewRiksdagenPoliticianDocument_.org, viewRiksdagenCommittee.getEmbeddedId().getOrgCode().replace(" ", "").replace("_", "").trim(), ViewRiksdagenPoliticianDocument_.madePublicDate), DOCUMENTS, COLUMN_ORDER, HIDE_COLUMNS, LISTENER, null, null);
panel.setCaption(NAME + "::" + COMMITTEE + viewRiksdagenCommittee.getEmbeddedId().getDetail());
getPageActionEventHelper().createPageEvent(ViewAction.VISIT_COMMITTEE_VIEW, ApplicationEventGroup.USER, NAME, parameters, pageId);
}
return panelContent;
}
use of org.springframework.security.access.annotation.Secured in project cia by Hack23.
the class DocumentDataPageModContentFactoryImpl 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<DocumentContentData, String> documentContentDataDataContainer = getApplicationManager().getDataContainer(DocumentContentData.class);
getApplicationManager().getDataContainer(CommitteeProposalComponentData.class);
final DocumentElement documentElement = documentElementDataContainer.load(pageId);
if (documentElement != null) {
getDocumentMenuItemFactory().createDocumentMenuBar(menuBar, pageId);
LabelFactory.createHeader2Label(panelContent, DOCUMENT_DATA);
final List<DocumentContentData> documentContentlist = documentContentDataDataContainer.getAllBy(DocumentContentData_.id, pageId);
if (!documentContentlist.isEmpty()) {
final Panel formPanel = new Panel();
formPanel.setSizeFull();
panelContent.addComponent(formPanel);
final FormLayout formContent = new FormLayout();
formPanel.setContent(formContent);
final String cleanContent = Jsoup.clean(documentContentlist.get(0).getContent(), "", Whitelist.simpleText(), new OutputSettings().indentAmount(4));
final Label htmlContent = new Label(cleanContent, ContentMode.HTML);
formContent.addComponent(htmlContent);
final DocumentWordCountRequest documentWordCountRequest = new DocumentWordCountRequest();
documentWordCountRequest.setDocumentId(pageId);
documentWordCountRequest.setMaxResults(MAX_RESULTS);
documentWordCountRequest.setSessionId(RequestContextHolder.currentRequestAttributes().getSessionId());
final DocumentWordCountResponse resp = (DocumentWordCountResponse) getApplicationManager().service(documentWordCountRequest);
if (resp.getWordCountMap() != null) {
final Label wordCloud = new Label(createWordCloud(resp.getWordCountMap()), ContentMode.HTML);
formContent.addComponent(wordCloud);
}
panelContent.setExpandRatio(formPanel, ContentRatio.GRID);
}
panel.setContent(panelContent);
getPageActionEventHelper().createPageEvent(ViewAction.VISIT_DOCUMENT_VIEW, ApplicationEventGroup.USER, NAME, parameters, pageId);
}
return panelContent;
}
Aggregations