<commit_before>package com.infoDiscover.adminCenter.ui.component.infoDiscoverSpaceManagement;

import com.infoDiscover.adminCenter.logic.component.infoDiscoverSpaceManagement.InfoDiscoverSpaceOperationUtil;
import com.infoDiscover.adminCenter.logic.component.infoDiscoverSpaceManagement.vo.ProcessingDataListVO;
import com.infoDiscover.adminCenter.logic.component.infoDiscoverSpaceManagement.vo.ProcessingDataVO;
import com.infoDiscover.adminCenter.ui.component.common.RiskActionConfirmDialog;
import com.infoDiscover.adminCenter.ui.component.common.UICommonElementsUtil;
import com.infoDiscover.adminCenter.ui.component.event.*;
import com.infoDiscover.adminCenter.ui.component.infoDiscoverSpaceManagement.commonUseElement.DataAnalyzeApplicationBrowserPanel;
import com.infoDiscover.adminCenter.ui.component.infoDiscoverSpaceManagement.commonUseElement.ProcessingDataOperationPanel;
import com.infoDiscover.adminCenter.ui.component.infoDiscoverSpaceManagement.commonUseElement.QueryTypeDataInstancePanel;
import com.infoDiscover.adminCenter.ui.component.infoDiscoverSpaceManagement.dimensionManagement.InfoDiscoverSpaceDimensionsInfo;
import com.infoDiscover.adminCenter.ui.component.infoDiscoverSpaceManagement.factManagement.InfoDiscoverSpaceFactsInfo;
import com.infoDiscover.adminCenter.ui.component.infoDiscoverSpaceManagement.relationManagement.InfoDiscoverSpaceRelationsInfo;
import com.infoDiscover.adminCenter.ui.component.infoDiscoverSpaceManagement.runtimeInfo.InfoDiscoverSpaceRuntimeGeneralInfo;
import com.infoDiscover.adminCenter.ui.component.infoDiscoverSpaceManagement.visualizationAnalyzeElement.ProcessingDataAnalyzePanel;
import com.infoDiscover.adminCenter.ui.util.AdminCenterPropertyHandler;
import com.infoDiscover.adminCenter.ui.util.UserClientInfo;
import com.infoDiscover.infoDiscoverEngine.util.helper.DiscoverSpaceStatisticMetrics;
import com.vaadin.navigator.View;
import com.vaadin.navigator.ViewChangeListener;
import com.vaadin.server.FontAwesome;
import com.vaadin.server.Page;
import com.vaadin.shared.Position;
import com.vaadin.shared.ui.label.ContentMode;
import com.vaadin.ui.*;

import java.util.ArrayList;
import java.util.HashMap;
import java.util.List;
import java.util.Map;

/**
 * Created by wangychu on 10/1/16.
 */
public class InfoDiscoverSpaceDetail extends VerticalLayout implements View,
        DiscoverSpaceTypeDataInstanceQueryRequiredEvent.DiscoverSpaceTypeDataInstanceQueryRequiredListener,
        DiscoverSpaceOpenProcessingDataListEvent.DiscoverSpaceOpenProcessingDataListListener,
        DiscoverSpaceAddProcessingDataEvent.DiscoverSpaceAddProcessingDataListener,
        DiscoverSpaceRemoveProcessingDataEvent.DiscoverSpaceRemoveProcessingDataListener,
        DiscoverSpaceLaunchDataAnalyzeApplicationEvent.DiscoverSpaceLaunchDataAnalyzeApplicationListener{
    private UserClientInfo currentUserClientInfo;
    private String discoverSpaceName;
    private InfoDiscoverSpaceRuntimeGeneralInfo infoDiscoverSpaceRuntimeGeneralInfo;
    private InfoDiscoverSpaceDimensionsInfo infoDiscoverSpaceDimensionsInfo;
    private InfoDiscoverSpaceFactsInfo infoDiscoverSpaceFactsInfo;
    private InfoDiscoverSpaceRelationsInfo infoDiscoverSpaceRelationsInfo;
    private String dataAnalyzeApplicationBaseAddress;

    public InfoDiscoverSpaceDetail(UserClientInfo currentUserClientInfo){
        this.currentUserClientInfo=currentUserClientInfo;
        setSpacing(true);
        setMargin(true);
        this.currentUserClientInfo.getEventBlackBoard().addListener(this);
        VerticalLayout viewContentContainer = new VerticalLayout();
        viewContentContainer.setMargin(false);
        viewContentContainer.setSpacing(false);
        viewContentContainer.addStyleName("ui_appSubViewContainer");
        this.addComponent(viewContentContainer);

        TabSheet tabs=new TabSheet();
        viewContentContainer.addComponent(tabs);

        VerticalLayout discoverSpaceRuntimeInfoLayout=new VerticalLayout();
        TabSheet.Tab discoverSpaceRuntimeInfoLayoutTab =tabs.addTab(discoverSpaceRuntimeInfoLayout, "空间运行状态信息");
        discoverSpaceRuntimeInfoLayoutTab.setIcon(FontAwesome.INFO);
        infoDiscoverSpaceRuntimeGeneralInfo=new InfoDiscoverSpaceRuntimeGeneralInfo(this.currentUserClientInfo);
        infoDiscoverSpaceRuntimeGeneralInfo.setParentInfoDiscoverSpaceDetail(this);
        discoverSpaceRuntimeInfoLayout.addComponent(infoDiscoverSpaceRuntimeGeneralInfo);

        VerticalLayout discoverSpaceDimensionsInfoLayout=new VerticalLayout();
        TabSheet.Tab discoverSpaceDimensionsInfoLayoutTab =tabs.addTab(discoverSpaceDimensionsInfoLayout, "空间维度管理");
        discoverSpaceDimensionsInfoLayoutTab.setIcon(FontAwesome.TAGS);
        infoDiscoverSpaceDimensionsInfo=new InfoDiscoverSpaceDimensionsInfo(this.currentUserClientInfo);
        infoDiscoverSpaceDimensionsInfo.setParentInfoDiscoverSpaceDetail(this);
        discoverSpaceDimensionsInfoLayout.addComponent(infoDiscoverSpaceDimensionsInfo);

        VerticalLayout discoverSpaceFactsInfoLayout=new VerticalLayout();
        TabSheet.Tab discoverSpaceFactsInfoLayoutTab =tabs.addTab(discoverSpaceFactsInfoLayout, "空间事实管理");
        discoverSpaceFactsInfoLayoutTab.setIcon(FontAwesome.CLONE);
        infoDiscoverSpaceFactsInfo=new InfoDiscoverSpaceFactsInfo(this.currentUserClientInfo);
        infoDiscoverSpaceFactsInfo.setParentInfoDiscoverSpaceDetail(this);
        discoverSpaceFactsInfoLayout.addComponent(infoDiscoverSpaceFactsInfo);

        VerticalLayout discoverSpaceRelationsInfoLayout=new VerticalLayout();
        TabSheet.Tab discoverSpaceRelationsInfoLayoutTab =tabs.addTab(discoverSpaceRelationsInfoLayout, "空间关系管理");
        discoverSpaceRelationsInfoLayoutTab.setIcon(FontAwesome.SHARE_ALT);
        infoDiscoverSpaceRelationsInfo=new InfoDiscoverSpaceRelationsInfo(this.currentUserClientInfo);
        infoDiscoverSpaceRelationsInfo.setParentInfoDiscoverSpaceDetail(this);
        discoverSpaceRelationsInfoLayout.addComponent(infoDiscoverSpaceRelationsInfo);

        dataAnalyzeApplicationBaseAddress= AdminCenterPropertyHandler.getPropertyValue(AdminCenterPropertyHandler.INFO_ANALYSE_SERVICE_ROOT_LOCATION)+
                "infoAnalyseApp/index.html";





        Map<String,List<ProcessingDataVO>> selectedProcessingData=new HashMap<>();
        List<ProcessingDataVO> dimensionProcessingDataForAnalyzing=new ArrayList<>();

        ProcessingDataVO processingDataVO1=new ProcessingDataVO();
        processingDataVO1.setDiscoverSpaceName("DemoArch");
        processingDataVO1.setDataTypeKind(InfoDiscoverSpaceOperationUtil.TYPEKIND_FACT);
        processingDataVO1.setDataTypeName("DEMO_PROGRESS_MAINTAIN");
        processingDataVO1.setId("#113:0");


        List<ProcessingDataVO> factProcessingDataForAnalyzing=new ArrayList<>();
        factProcessingDataForAnalyzing.add(processingDataVO1);


        selectedProcessingData.put(InfoDiscoverSpaceOperationUtil.TYPEKIND_DIMENSION,dimensionProcessingDataForAnalyzing);
        selectedProcessingData.put(InfoDiscoverSpaceOperationUtil.TYPEKIND_FACT,factProcessingDataForAnalyzing);

        ProcessingDataAnalyzePanel processingDataAnalyzePanel=new ProcessingDataAnalyzePanel(this.currentUserClientInfo,"DemoArch",selectedProcessingData);
        String dataDetailInfoTitle="待处理数据信息分析发现";
        final Window window = new Window(UICommonElementsUtil.generateMovableWindowTitleWithFormat(dataDetailInfoTitle));
        window.setSizeFull();
        window.setCaptionAsHtml(true);
        window.setResizable(false);
        window.setDraggable(false);
        window.setModal(false);
        window.setContent(processingDataAnalyzePanel);
        UI.getCurrent().addWindow(window);









    }

    @Override
    public void enter(ViewChangeListener.ViewChangeEvent viewChangeEvent) {}

    public void setDiscoverSpaceName(String discoverSpaceName) {
        this.discoverSpaceName = discoverSpaceName;
    }

    public void renderDiscoverSpaceDetail(){
        DiscoverSpaceStatisticMetrics discoverSpaceStatisticMetrics=InfoDiscoverSpaceOperationUtil.getDiscoverSpaceStatisticMetrics(this.discoverSpaceName);
        this.infoDiscoverSpaceRuntimeGeneralInfo.setDiscoverSpaceName(this.discoverSpaceName);<commit_msg>remove temp logic<commit_after>package com.infoDiscover.adminCenter.ui.component.infoDiscoverSpaceManagement;

import com.infoDiscover.adminCenter.logic.component.infoDiscoverSpaceManagement.InfoDiscoverSpaceOperationUtil;
import com.infoDiscover.adminCenter.logic.component.infoDiscoverSpaceManagement.vo.ProcessingDataListVO;
import com.infoDiscover.adminCenter.logic.component.infoDiscoverSpaceManagement.vo.ProcessingDataVO;
import com.infoDiscover.adminCenter.ui.component.common.RiskActionConfirmDialog;
import com.infoDiscover.adminCenter.ui.component.common.UICommonElementsUtil;
import com.infoDiscover.adminCenter.ui.component.event.*;
import com.infoDiscover.adminCenter.ui.component.infoDiscoverSpaceManagement.commonUseElement.DataAnalyzeApplicationBrowserPanel;
import com.infoDiscover.adminCenter.ui.component.infoDiscoverSpaceManagement.commonUseElement.ProcessingDataOperationPanel;
import com.infoDiscover.adminCenter.ui.component.infoDiscoverSpaceManagement.commonUseElement.QueryTypeDataInstancePanel;
import com.infoDiscover.adminCenter.ui.component.infoDiscoverSpaceManagement.dimensionManagement.InfoDiscoverSpaceDimensionsInfo;
import com.infoDiscover.adminCenter.ui.component.infoDiscoverSpaceManagement.factManagement.InfoDiscoverSpaceFactsInfo;
import com.infoDiscover.adminCenter.ui.component.infoDiscoverSpaceManagement.relationManagement.InfoDiscoverSpaceRelationsInfo;
import com.infoDiscover.adminCenter.ui.component.infoDiscoverSpaceManagement.runtimeInfo.InfoDiscoverSpaceRuntimeGeneralInfo;
import com.infoDiscover.adminCenter.ui.component.infoDiscoverSpaceManagement.visualizationAnalyzeElement.ProcessingDataAnalyzePanel;
import com.infoDiscover.adminCenter.ui.util.AdminCenterPropertyHandler;
import com.infoDiscover.adminCenter.ui.util.UserClientInfo;
import com.infoDiscover.infoDiscoverEngine.util.helper.DiscoverSpaceStatisticMetrics;
import com.vaadin.navigator.View;
import com.vaadin.navigator.ViewChangeListener;
import com.vaadin.server.FontAwesome;
import com.vaadin.server.Page;
import com.vaadin.shared.Position;
import com.vaadin.shared.ui.label.ContentMode;
import com.vaadin.ui.*;

import java.util.ArrayList;
import java.util.HashMap;
import java.util.List;
import java.util.Map;

/**
 * Created by wangychu on 10/1/16.
 */
public class InfoDiscoverSpaceDetail extends VerticalLayout implements View,
        DiscoverSpaceTypeDataInstanceQueryRequiredEvent.DiscoverSpaceTypeDataInstanceQueryRequiredListener,
        DiscoverSpaceOpenProcessingDataListEvent.DiscoverSpaceOpenProcessingDataListListener,
        DiscoverSpaceAddProcessingDataEvent.DiscoverSpaceAddProcessingDataListener,
        DiscoverSpaceRemoveProcessingDataEvent.DiscoverSpaceRemoveProcessingDataListener,
        DiscoverSpaceLaunchDataAnalyzeApplicationEvent.DiscoverSpaceLaunchDataAnalyzeApplicationListener{
    private UserClientInfo currentUserClientInfo;
    private String discoverSpaceName;
    private InfoDiscoverSpaceRuntimeGeneralInfo infoDiscoverSpaceRuntimeGeneralInfo;
    private InfoDiscoverSpaceDimensionsInfo infoDiscoverSpaceDimensionsInfo;
    private InfoDiscoverSpaceFactsInfo infoDiscoverSpaceFactsInfo;
    private InfoDiscoverSpaceRelationsInfo infoDiscoverSpaceRelationsInfo;
    private String dataAnalyzeApplicationBaseAddress;

    public InfoDiscoverSpaceDetail(UserClientInfo currentUserClientInfo){
        this.currentUserClientInfo=currentUserClientInfo;
        setSpacing(true);
        setMargin(true);
        this.currentUserClientInfo.getEventBlackBoard().addListener(this);
        VerticalLayout viewContentContainer = new VerticalLayout();
        viewContentContainer.setMargin(false);
        viewContentContainer.setSpacing(false);
        viewContentContainer.addStyleName("ui_appSubViewContainer");
        this.addComponent(viewContentContainer);

        TabSheet tabs=new TabSheet();
        viewContentContainer.addComponent(tabs);

        VerticalLayout discoverSpaceRuntimeInfoLayout=new VerticalLayout();
        TabSheet.Tab discoverSpaceRuntimeInfoLayoutTab =tabs.addTab(discoverSpaceRuntimeInfoLayout, "空间运行状态信息");
        discoverSpaceRuntimeInfoLayoutTab.setIcon(FontAwesome.INFO);
        infoDiscoverSpaceRuntimeGeneralInfo=new InfoDiscoverSpaceRuntimeGeneralInfo(this.currentUserClientInfo);
        infoDiscoverSpaceRuntimeGeneralInfo.setParentInfoDiscoverSpaceDetail(this);
        discoverSpaceRuntimeInfoLayout.addComponent(infoDiscoverSpaceRuntimeGeneralInfo);

        VerticalLayout discoverSpaceDimensionsInfoLayout=new VerticalLayout();
        TabSheet.Tab discoverSpaceDimensionsInfoLayoutTab =tabs.addTab(discoverSpaceDimensionsInfoLayout, "空间维度管理");
        discoverSpaceDimensionsInfoLayoutTab.setIcon(FontAwesome.TAGS);
        infoDiscoverSpaceDimensionsInfo=new InfoDiscoverSpaceDimensionsInfo(this.currentUserClientInfo);
        infoDiscoverSpaceDimensionsInfo.setParentInfoDiscoverSpaceDetail(this);
        discoverSpaceDimensionsInfoLayout.addComponent(infoDiscoverSpaceDimensionsInfo);

        VerticalLayout discoverSpaceFactsInfoLayout=new VerticalLayout();
        TabSheet.Tab discoverSpaceFactsInfoLayoutTab =tabs.addTab(discoverSpaceFactsInfoLayout, "空间事实管理");
        discoverSpaceFactsInfoLayoutTab.setIcon(FontAwesome.CLONE);
        infoDiscoverSpaceFactsInfo=new InfoDiscoverSpaceFactsInfo(this.currentUserClientInfo);
        infoDiscoverSpaceFactsInfo.setParentInfoDiscoverSpaceDetail(this);
        discoverSpaceFactsInfoLayout.addComponent(infoDiscoverSpaceFactsInfo);

        VerticalLayout discoverSpaceRelationsInfoLayout=new VerticalLayout();
        TabSheet.Tab discoverSpaceRelationsInfoLayoutTab =tabs.addTab(discoverSpaceRelationsInfoLayout, "空间关系管理");
        discoverSpaceRelationsInfoLayoutTab.setIcon(FontAwesome.SHARE_ALT);
        infoDiscoverSpaceRelationsInfo=new InfoDiscoverSpaceRelationsInfo(this.currentUserClientInfo);
        infoDiscoverSpaceRelationsInfo.setParentInfoDiscoverSpaceDetail(this);
        discoverSpaceRelationsInfoLayout.addComponent(infoDiscoverSpaceRelationsInfo);

        dataAnalyzeApplicationBaseAddress= AdminCenterPropertyHandler.getPropertyValue(AdminCenterPropertyHandler.INFO_ANALYSE_SERVICE_ROOT_LOCATION)+
                "infoAnalyseApp/index.html";




/*
        Map<String,List<ProcessingDataVO>> selectedProcessingData=new HashMap<>();
        List<ProcessingDataVO> dimensionProcessingDataForAnalyzing=new ArrayList<>();

        ProcessingDataVO processingDataVO1=new ProcessingDataVO();
        processingDataVO1.setDiscoverSpaceName("DemoArch");
        processingDataVO1.setDataTypeKind(InfoDiscoverSpaceOperationUtil.TYPEKIND_FACT);
        processingDataVO1.setDataTypeName("DEMO_PROGRESS_MAINTAIN");
        processingDataVO1.setId("#113:0");


        List<ProcessingDataVO> factProcessingDataForAnalyzing=new ArrayList<>();
        factProcessingDataForAnalyzing.add(processingDataVO1);


        selectedProcessingData.put(InfoDiscoverSpaceOperationUtil.TYPEKIND_DIMENSION,dimensionProcessingDataForAnalyzing);
        selectedProcessingData.put(InfoDiscoverSpaceOperationUtil.TYPEKIND_FACT,factProcessingDataForAnalyzing);

        ProcessingDataAnalyzePanel processingDataAnalyzePanel=new ProcessingDataAnalyzePanel(this.currentUserClientInfo,"DemoArch",selectedProcessingData);
        String dataDetailInfoTitle="待处理数据信息分析发现";
        final Window window = new Window(UICommonElementsUtil.generateMovableWindowTitleWithFormat(dataDetailInfoTitle));
        window.setSizeFull();
        window.setCaptionAsHtml(true);
        window.setResizable(false);
        window.setDraggable(false);
        window.setModal(false);
        window.setContent(processingDataAnalyzePanel);
        UI.getCurrent().addWindow(window);
*/








    }

    @Override
    public void enter(ViewChangeListener.ViewChangeEvent viewChangeEvent) {}

    public void setDiscoverSpaceName(String discoverSpaceName) {
        this.discoverSpaceName = discoverSpaceName;
    }

    public void renderDiscoverSpaceDetail(){
        DiscoverSpaceStatisticMetrics discoverSpaceStatisticMetrics=InfoDiscoverSpaceOperationUtil.getDiscoverSpaceStatisticMetrics(this.discoverSpaceName);
        this.infoDiscoverSpaceRuntimeGeneralInfo.setDiscoverSpaceName(this.discoverSpaceName);
{'fraction_non_alphanumeric': 0.06606060606060606, 'fraction_numerical': 0.0018181818181818182, 'mean_word_length': 6.635816751503933, 'pattern_counts': {'":': 0, '<': 17, '<?xml version=': 0, '>': 17, 'https://': 0, 'lorem ipsum': 0, 'www.': 0, 'xml': 0}, 'pii_count': 0, 'substrings_counts': 0, 'word_list_counts': {'cursed_substrings.json': 0, 'profanity_word_list.json': 0, 'sexual_word_list.json': 0, 'zh_pornsignals.json': 0}}
{'dir': 'git-commits-cleaned', 'id': '23349', 'n_tokens_mistral': 4324, 'n_tokens_neox': 4207, 'n_words': 439}