All Downloads are FREE. Search and download functionalities are using the official Maven repository.

io.mosip.registration.controller.reg.DashBoardController Maven / Gradle / Ivy

There is a newer version: 1.2.0.2
Show newest version
package io.mosip.registration.controller.reg;

import java.io.Writer;
import java.net.URL;
import java.util.ResourceBundle;

import org.springframework.stereotype.Component;

import io.mosip.kernel.core.logger.spi.Logger;
import io.mosip.registration.config.AppConfig;
import io.mosip.registration.constants.RegistrationConstants;
import io.mosip.registration.context.SessionContext;
import io.mosip.registration.controller.BaseController;
import javafx.fxml.FXML;
import javafx.fxml.Initializable;
import javafx.scene.web.WebEngine;
import javafx.scene.web.WebView;

@Component
public class DashBoardController extends BaseController implements Initializable {
	
	private static final Logger LOGGER = AppConfig.getLogger(DashBoardController.class);
	
	@FXML
	private WebView dashboardWebView;
	
	private Writer stringWriter;
	
	public void setStringWriter(Writer stringWriter) {
		this.stringWriter = stringWriter;
	}

	@Override
	public void initialize(URL location, ResourceBundle resources) {
		SessionContext.map().put(RegistrationConstants.ISPAGE_NAVIGATION_ALERT_REQ,
				RegistrationConstants.ENABLE);
		
		WebEngine webEngine = dashboardWebView.getEngine();
		webEngine.loadContent(stringWriter.toString());
		
		LOGGER.info("Dashboard template has been loaded to webview");
	}

}




© 2015 - 2024 Weber Informatics LLC | Privacy Policy