Exemplo n.º 1
0
 def __populate_tabs_from_workflow(burst_entity, workflow):
     """
     Given a burst and a workflow populate the tabs of the burst with the PortletConfigurations
     generated from the steps of the workflow.
     """
     visualizers = dao.get_visualization_steps(workflow.id)
     for entry in visualizers:
         ## For each visualize step, also load all of the analyze steps.
         portlet_cfg = PortletConfiguration(entry.fk_portlet)
         portlet_cfg.set_visualizer(entry)
         analyzers = dao.get_workflow_steps_for_position(entry.fk_workflow, entry.tab_index, entry.index_in_tab)
         portlet_cfg.set_analyzers(analyzers)
         burst_entity.tabs[entry.tab_index].portlets[entry.index_in_tab] = portlet_cfg
     return burst_entity
Exemplo n.º 2
0
 def __populate_tabs_from_workflow(burst_entity, workflow):
     """
     Given a burst and a workflow populate the tabs of the burst with the PortletConfigurations
     generated from the steps of the workflow.
     """
     visualizers = dao.get_visualization_steps(workflow.id)
     for entry in visualizers:
         ## For each visualize step, also load all of the analyze steps.
         portlet_cfg = PortletConfiguration(entry.fk_portlet)
         portlet_cfg.set_visualizer(entry)
         analyzers = dao.get_workflow_steps_for_position(entry.fk_workflow, entry.tab_index, entry.index_in_tab)
         portlet_cfg.set_analyzers(analyzers)
         burst_entity.tabs[entry.tab_index].portlets[entry.index_in_tab] = portlet_cfg
     return burst_entity
Exemplo n.º 3
0
    def _build_workflow_step_info(workflow):
        """
        For the input workflow, get all workflow steps and return a list with information
        that can be then exported.
        """
        wf_steps = []
        view_steps = []
        for wf_step in dao.get_workflow_steps(workflow.id):

            if wf_step.fk_operation is None or wf_step.fk_algorithm is None:
                # Avoid exporting old form of View Steps.
                LOG.warning("Skipping " + str(workflow) + " " + str(wf_step))
                continue
            # Get all basic information for this workflow step
            wf_step_info = WorkflowStepInformation(wf_step.to_dict()[1])
            # We need to store the gid for the operation since the id might be
            # different in case of a project export / import
            linked_operation = dao.get_operation_by_id(wf_step.fk_operation)
            wf_step_info.set_operation(linked_operation)
            # We also need to keep info about algorithm in the form of module
            # and classname because that id might also be different in case
            # of project export / import.
            linked_algorithm = dao.get_algorithm_by_id(wf_step.fk_algorithm)
            wf_step_info.set_algorithm(linked_algorithm)
            wf_steps.append(wf_step_info)
        for view_step in dao.get_visualization_steps(workflow.id):
            # Get all basic information for this view step
            view_step_info = WorkflowViewStepInformation(
                view_step.to_dict()[1])
            # We need to store portlet identifier, since portlet id might be different
            # in project we are importing into.
            portlet = dao.get_portlet_by_id(view_step.fk_portlet)
            view_step_info.set_portlet(portlet)
            # We also need to keep info about algorithm in the form of module
            # and classname because that id might also be different in case
            # of project export / import.
            linked_algorithm = dao.get_algorithm_by_id(view_step.fk_algorithm)
            view_step_info.set_algorithm(linked_algorithm)
            view_steps.append(view_step_info)
        return wf_steps, view_steps
    def _build_workflow_step_info(workflow):
        """
        For the input workflow, get all workflow steps and return a list with information
        that can be then exported.
        """
        wf_steps = []
        view_steps = []
        for wf_step in dao.get_workflow_steps(workflow.id):

            if wf_step.fk_operation is None or wf_step.fk_algorithm is None:
                # Avoid exporting old form of View Steps.
                LOG.warning("Skipping " + str(workflow) + " " + str(wf_step))
                continue
            # Get all basic information for this workflow step
            wf_step_info = WorkflowStepInformation(wf_step.to_dict()[1])
            # We need to store the gid for the operation since the id might be
            # different in case of a project export / import
            linked_operation = dao.get_operation_by_id(wf_step.fk_operation)
            wf_step_info.set_operation(linked_operation)
            # We also need to keep info about algorithm in the form of module
            # and classname because that id might also be different in case
            # of project export / import.
            linked_algorithm = dao.get_algorithm_by_id(wf_step.fk_algorithm)
            wf_step_info.set_algorithm(linked_algorithm)
            wf_steps.append(wf_step_info)
        for view_step in dao.get_visualization_steps(workflow.id):
            # Get all basic information for this view step
            view_step_info = WorkflowViewStepInformation(view_step.to_dict()[1])
            # We need to store portlet identifier, since portlet id might be different
            # in project we are importing into.
            portlet = dao.get_portlet_by_id(view_step.fk_portlet)
            view_step_info.set_portlet(portlet)
            # We also need to keep info about algorithm in the form of module
            # and classname because that id might also be different in case
            # of project export / import.
            linked_algorithm = dao.get_algorithm_by_id(view_step.fk_algorithm)
            view_step_info.set_algorithm(linked_algorithm)
            view_steps.append(view_step_info)
        return wf_steps, view_steps