Skip to content

Commit

Permalink
#8 first test view
Browse files Browse the repository at this point in the history
  • Loading branch information
pethers committed Feb 27, 2018
1 parent 3368400 commit 55d5840
Show file tree
Hide file tree
Showing 2 changed files with 20 additions and 9 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -21,10 +21,13 @@
import org.apache.commons.lang3.StringUtils;
import org.springframework.security.access.annotation.Secured;
import org.springframework.stereotype.Component;
import org.springframework.web.context.request.RequestContextHolder;

import com.hack23.cia.model.internal.application.system.impl.ApplicationEventGroup;
import com.hack23.cia.service.api.action.kpi.ComplianceCheck;
import com.hack23.cia.service.api.action.kpi.ComplianceCheckRequest;
import com.hack23.cia.service.api.action.kpi.ComplianceCheckResponse;
import com.hack23.cia.web.impl.ui.application.action.ViewAction;
import com.hack23.cia.web.impl.ui.application.views.common.viewnames.ChartIndicators;
import com.hack23.cia.web.impl.ui.application.views.common.viewnames.PageMode;
import com.hack23.cia.web.impl.ui.application.views.common.viewnames.RiskIndicators;
import com.vaadin.ui.Layout;
Expand All @@ -38,10 +41,9 @@
@Component
public final class ParliamentRiskPageModContentFactoryImpl extends AbstractParliamentPageModContentFactoryImpl {


/** The Constant PARLIAMENT_DECISION_FLOW. */
private static final String PARLIAMENT_RISK_SUMMARY = "Parliament Risk Summary";

/**
* Instantiates a new parliament risk page mod content factory impl.
*/
Expand All @@ -51,8 +53,8 @@ public ParliamentRiskPageModContentFactoryImpl() {

@Override
public boolean matches(final String page, final String parameters) {
return NAME.equals(page) && !StringUtils.isEmpty(parameters) && parameters.contains(PageMode.RULES.toString())
&& parameters.contains(RiskIndicators.RISK_SUMMARY.toString());
return NAME.equals(page) && !StringUtils.isEmpty(parameters) && parameters.contains(PageMode.RULES.toString())
&& parameters.contains(RiskIndicators.RISK_SUMMARY.toString());
}

@Secured({ "ROLE_ANONYMOUS", "ROLE_USER", "ROLE_ADMIN" })
Expand All @@ -63,9 +65,16 @@ public Layout createContent(final String parameters, final MenuBar menuBar, fina

final String pageId = getPageId(parameters);


getPageActionEventHelper().createPageEvent(ViewAction.VISIT_PARLIAMENT_RANKING_VIEW, ApplicationEventGroup.USER, NAME,
parameters, pageId);
ComplianceCheckRequest serviceRequest = new ComplianceCheckRequest();
serviceRequest.setSessionId(RequestContextHolder.currentRequestAttributes().getSessionId());
ComplianceCheckResponse serviceResponse = (ComplianceCheckResponse) getApplicationManager()
.service(serviceRequest);

getGridFactory().createBasicBeanItemGrid(panelContent, ComplianceCheck.class, serviceResponse.getList(), "Risk",
new String[] { "resourceType", "ruleName", "ruleDescription", "status" }, new String[] { "resourceIdentifier" }, null, null, null);

getPageActionEventHelper().createPageEvent(ViewAction.VISIT_PARLIAMENT_RANKING_VIEW, ApplicationEventGroup.USER,
NAME, parameters, pageId);
panel.setCaption(new StringBuilder().append(NAME).append("::").append(PARLIAMENT_RISK_SUMMARY).toString());

return panelContent;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -18,10 +18,12 @@
*/
package com.hack23.cia.service.api.action.kpi;

import java.io.Serializable;

/**
* The Interface ComplianceCheck.
*/
public interface ComplianceCheck {
public interface ComplianceCheck extends Serializable {

/**
* Gets the rule name.
Expand Down

0 comments on commit 55d5840

Please sign in to comment.