org.ikasan.dashboard.ui.visualisation.view.GraphView Maven / Gradle / Ivy
package org.ikasan.dashboard.ui.visualisation.view;
import com.vaadin.flow.component.AttachEvent;
import com.vaadin.flow.component.DetachEvent;
import com.vaadin.flow.component.UI;
import com.vaadin.flow.component.orderedlayout.VerticalLayout;
import com.vaadin.flow.router.BeforeEnterEvent;
import com.vaadin.flow.router.BeforeEnterObserver;
import com.vaadin.flow.router.PageTitle;
import com.vaadin.flow.router.Route;
import com.vaadin.flow.shared.Registration;
import com.vaadin.flow.spring.annotation.UIScope;
import org.ikasan.dashboard.broadcast.FlowStateBroadcaster;
import org.ikasan.dashboard.ui.layout.IkasanAppLayout;
import org.ikasan.dashboard.ui.util.DateFormatter;
import org.ikasan.rest.client.ReplayRestServiceImpl;
import org.ikasan.rest.client.ResubmissionRestServiceImpl;
import org.ikasan.solr.model.IkasanSolrDocument;
import org.ikasan.solr.model.IkasanSolrDocumentSearchResults;
import org.ikasan.spec.hospital.service.HospitalAuditService;
import org.ikasan.spec.metadata.*;
import org.ikasan.spec.module.client.ConfigurationService;
import org.ikasan.spec.module.client.MetaDataService;
import org.ikasan.spec.module.client.ModuleControlService;
import org.ikasan.spec.module.client.TriggerService;
import org.ikasan.spec.persistence.BatchInsert;
import org.ikasan.spec.solr.SolrGeneralService;
import org.slf4j.Logger;
import org.slf4j.LoggerFactory;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.beans.factory.annotation.Value;
import org.springframework.stereotype.Component;
import javax.annotation.Resource;
@Route(value = "visualisation", layout = IkasanAppLayout.class)
@UIScope
@PageTitle("Ikasan - Visualisation")
@Component
public class GraphView extends VerticalLayout implements BeforeEnterObserver
{
Logger logger = LoggerFactory.getLogger(GraphView.class);
@Resource
private SolrGeneralService solrSearchService;
@Resource
private ModuleControlService moduleControlRestService;
@Autowired
private ModuleMetaDataService moduleMetadataService;
@Autowired
private ConfigurationService configurationRestService;
@Autowired
private TriggerService triggerRestService;
@Resource
private ConfigurationMetaDataService configurationMetadataService;
@Resource
private BusinessStreamMetaDataService businessStreamMetaDataService;
@Resource
private SolrGeneralService solrGeneralService;
@Resource
private HospitalAuditService hospitalAuditService;
@Resource
private ResubmissionRestServiceImpl resubmissionRestService;
@Resource
private ReplayRestServiceImpl replayRestService;
@Resource
private BatchInsert replayAuditService;
@Resource
private MetaDataService metaDataApplicationRestService;
@Resource
private BatchInsert moduleMetadataBatchInsert;
@Resource
private DateFormatter dateFormatter;
@Value(value = "${integrated.systems.image.path}")
private String dynamicImagePath;
@Value("${max.download.bytes:50000000}")
private int maxDownloadBytes;
private GraphVisualisation graphVisualisation;
private boolean initialised = false;
/**
* Constructor
*/
public GraphView()
{
this.setMargin(false);
this.setWidth("100%");
this.setHeight("100%");
this.getElement().getThemeList().remove("padding");
this.getElement().getThemeList().remove("spacing");
}
private void init() {
this.graphVisualisation = new GraphVisualisation(this.solrSearchService,
this.moduleControlRestService, this.moduleMetadataService, this.configurationRestService,
this.configurationMetadataService, this.businessStreamMetaDataService, this.solrGeneralService,
this.hospitalAuditService, this.resubmissionRestService, this.replayRestService, this.replayAuditService,
this.metaDataApplicationRestService, this.moduleMetadataBatchInsert, this.triggerRestService, this.dynamicImagePath,
this.dateFormatter, this.maxDownloadBytes);
this.add(graphVisualisation);
this.initialised = true;
}
@Override
public void beforeEnter(BeforeEnterEvent beforeEnterEvent) {
if(!this.initialised) {
this.init();
this.graphVisualisation.beforeEnter(beforeEnterEvent);
}
}
}