Пример #1
0
 /**
  * Composant permettant d'afficher les paramètres d'un bloc et de les mettre à jour.
  *
  * Comprend l'édition du bloc, l'édition des paramètres ainsi que le mapping avec les noeuds du jeu de données.
  *
  * @param sfWebRequest $request
  */
 public function executeShowParams(sfWebRequest $request)
 {
     // On récupère le block parent.
     /** @var EiBlock $block */
     $block = Doctrine_Core::getTable("EiVersionStructure")->findBlock($this->ei_version_structure_id);
     $blockParams = $block->getParams();
     $scenarioId = $this->ei_scenario_id;
     $this->ei_block_parameters = $block->getJSONParameters($block->getAllAscendantsParams());
     // Réupération de la structure du scénario.
     $structures = Doctrine_Core::getTable("EiDataSetStructure")->getTreeArrayForITree($scenarioId);
     // Création du TreeViewer.
     $treeViewer = new TreeViewer("EiDataSetStructure");
     $treeViewer->import($structures);
     $selected = array();
     /** @var EiBlockParam $param */
     foreach ($blockParams as $key => $param) {
         /** @var EiBlockDataSetMapping $mapped */
         $mapped = $param->getMapping(EiBlockDataSetMapping::$TYPE_IN);
         if ($mapped != null) {
             $selected[$key] = $mapped->getEiDatasetStructureId();
         }
     }
     // TreeViewer pour le mapping.
     $this->treeDisplay = new TreeView($treeViewer, new ModeSelectTreeStrategy(), array("baseId" => "datasetstructure_tree_select_" . $block->getId(), "objects" => $blockParams, "selected" => $selected, "formats" => array("node" => EiNodeDataSet::getFormNameFormat(), "leaf" => EiLeafDataSet::getFormNameFormat()), "actions" => array("select" => array("route" => "eiblockdatasetmapping_select_mapping", "parameters" => array('project_id' => $this->project_id, 'project_ref' => $this->project_ref, 'ei_scenario_id' => $scenarioId, 'profile_name' => $this->profile_name, 'profile_id' => $this->profile_id, 'profile_ref' => $this->profile_ref, 'ei_block_param_id' => ':ei_block_param_id'), "target" => ":ei_block_param_id"), "doSelect" => array("route" => "eiblockdatasetmapping_do_select_mapping", "parameters" => array('project_id' => $this->project_id, 'project_ref' => $this->project_ref, 'ei_scenario_id' => $scenarioId, 'profile_name' => $this->profile_name, 'profile_id' => $this->profile_id, 'profile_ref' => $this->profile_ref, 'ei_block_param_id' => ':ei_block_param_id', 'type' => EiBlockDataSetMapping::$TYPE_IN), "target" => ":ei_block_param_id"))));
     $selected = array();
     /** @var EiBlockParam $param */
     foreach ($blockParams as $key => $param) {
         /** @var EiBlockDataSetMapping $mapped */
         $mapped = $param->getMapping(EiBlockDataSetMapping::$TYPE_OUT);
         if ($mapped != null) {
             $selected[$key] = $mapped->getEiDatasetStructureId();
         }
     }
     // TreeViewer pour le mapping.
     $this->treeDisplayOut = new TreeView($treeViewer, new ModeSelectTreeStrategy(), array("baseId" => "datasetstructure_tree_select_out_" . $block->getId(), "objects" => $blockParams, "selected" => $selected, "formats" => array("node" => EiNodeDataSet::getFormNameFormat(), "leaf" => EiLeafDataSet::getFormNameFormat()), "actions" => array("select" => array("route" => "eiblockdatasetmapping_select_mapping", "parameters" => array('project_id' => $this->project_id, 'project_ref' => $this->project_ref, 'ei_scenario_id' => $scenarioId, 'profile_name' => $this->profile_name, 'profile_id' => $this->profile_id, 'profile_ref' => $this->profile_ref, 'ei_block_param_id' => ':ei_block_param_id'), "target" => ":ei_block_param_id"), "doSelect" => array("route" => "eiblockdatasetmapping_do_select_mapping", "parameters" => array('project_id' => $this->project_id, 'project_ref' => $this->project_ref, 'ei_scenario_id' => $scenarioId, 'profile_name' => $this->profile_name, 'profile_id' => $this->profile_id, 'profile_ref' => $this->profile_ref, 'ei_block_param_id' => ':ei_block_param_id', 'type' => EiBlockDataSetMapping::$TYPE_OUT), "target" => ":ei_block_param_id"))));
 }
Пример #2
0
 /**
  * TODO: Optimiser visionneuse de JDD.
  *
  * @param sfWebRequest $request
  */
 public function executeManager(sfWebRequest $request)
 {
     $memoryLimit = ini_get("memory_limit");
     ini_set("memory_limit", "-1");
     /** @var EiDataSet $ei_data_set */
     $ei_data_set = $this->ei_data_set->getEiDataSet();
     $countLines = $ei_data_set->getCountOfLines();
     if ($countLines < 1000) {
         // Réupération de la structure du jeu de données.
         $structures = $ei_data_set->getTreeArrayForITree();
         // Création du TreeViewer.
         $treeViewer = new TreeViewer("EiDataSet");
         $treeViewer->import($structures);
         $this->treeDisplay = new TreeView($treeViewer, new ModeEditTreeStrategy(), array("id" => "dataset_source_tree_" . time(), "formats" => array("node" => EiNodeDataSet::getFormNameFormat(), "leaf" => EiLeafDataSet::getFormNameFormat()), "types" => array("root" => array("icon" => TreeView::$TYPE_XML, "name" => "root"), "node" => array("icon" => TreeView::$TYPE_TAG, "name" => "node"), "attr" => array("icon" => TreeView::$TYPE_XSL_VALUE, "name" => "attribute"), "leaf" => array("icon" => TreeView::$TYPE_VALUE, "name" => "value")), "authorizations" => array("rename" => array("leaf"), "new" => array(), "remove" => array(), "dragndrop" => array()), "init" => array("openAll" => true), "styleMessageResultat" => 2, "styleMessageResultatObject" => '#ei_data_set_content', "actions" => array("rename" => array("route" => "eidataset_rename_value_dataline", "parameters" => array('project_id' => $this->project_id, 'project_ref' => $this->project_ref, 'ei_scenario_id' => $this->ei_scenario->getId(), 'profile_name' => $this->profile_name, 'profile_id' => $this->profile_id, 'profile_ref' => $this->profile_ref, 'ei_data_set_id' => $ei_data_set->getId(), 'ei_data_line_id' => 'ei_node_id'), "target" => "ei_node_id"))));
     } else {
         $this->treeDisplay = null;
     }
     ini_set("memory_limit", $memoryLimit);
 }
 /**
  * @return string
  */
 public function generateBlockParametersXML()
 {
     /** @var EiTestSetBlockParamTable $tableBlockParam */
     $tableBlockParam = Doctrine_Core::getTable("EiTestSetBlockParam");
     // Récupération des ids des parents du block param de la stack.
     $parents = $tableBlockParam->getAllParentsId($this->getEiTestSetBlockParam());
     $parents[] = $this->getEiTestSetBlockParam()->getId();
     // Récupération de la structure des block params.
     $structures = $tableBlockParam->getSubTreeArrayForITree($this->getEiTestSetId(), $parents);
     $treeViewer = new TreeViewer("EiTestSetBlockParam");
     $treeViewer->import($structures);
     return $treeViewer->generateXML();
 }
Пример #4
0
 /**
  * Action retournant le formulaire d'édition de la structure du jeu de données.
  *
  * @param sfWebRequest $request
  */
 public function executeEdit(sfWebRequest $request)
 {
     // Préparation des éléments relatifs à la vue.
     $this->prepareNodeEdit($request);
     //**************************************************************************************************************
     // RECUPERATION ET VERIFICATIONS DES OBJETS : VERSIONS DU SCENARIO.
     // Récupération & vérification des versions du scénario.
     $this->ei_versions = Doctrine_Core::getTable('EiVersion')->findByEiScenarioId($this->ei_scenario->getId());
     $this->forward404Unless($this->ei_versions);
     // Réupération de la structure du scénario.
     $structures = Doctrine_Core::getTable("EiDataSetStructure")->getTreeArrayForITree($this->ei_scenario->getId());
     // Création du TreeViewer.
     $treeViewer = new TreeViewer("EiDataSetStructure");
     $treeViewer->import($structures);
     $this->treeDisplay = new TreeView($treeViewer, new ModeEditTreeStrategy(), array("id" => "datasetstructure_tree", "formats" => array("node" => EiNodeDataSet::getFormNameFormat(), "leaf" => EiLeafDataSet::getFormNameFormat()), "actions" => array("rename" => array("route" => "eidatasetstructure_rename_node", "parameters" => array('project_id' => $this->project_id, 'project_ref' => $this->project_ref, 'ei_scenario_id' => $this->ei_scenario->getId(), 'profile_name' => $this->profile_name, 'profile_id' => $this->profile_id, 'profile_ref' => $this->profile_ref, 'ei_node_id' => 'ei_node_id'), "target" => "ei_node_id"), "new" => array("route" => "eidatasetstructure_create_node", "parameters" => array('project_id' => $this->project_id, 'project_ref' => $this->project_ref, 'ei_scenario_id' => $this->ei_scenario->getId(), 'profile_name' => $this->profile_name, 'profile_id' => $this->profile_id, 'profile_ref' => $this->profile_ref, 'ei_node_parent_id' => 'ei_node_parent_id'), "target" => "ei_node_parent_id"), "remove" => array("route" => "eidatasetstructure_remove_node", "parameters" => array('project_id' => $this->project_id, 'project_ref' => $this->project_ref, 'ei_scenario_id' => $this->ei_scenario->getId(), 'profile_name' => $this->profile_name, 'profile_id' => $this->profile_id, 'profile_ref' => $this->profile_ref, 'ei_node_id' => 'ei_node_id'), "target" => "ei_node_id"), "dragndrop" => array("route" => "eidatasetstructure_move_node", "parameters" => array('project_id' => $this->project_id, 'project_ref' => $this->project_ref, 'ei_scenario_id' => $this->ei_scenario->getId(), 'profile_name' => $this->profile_name, 'profile_id' => $this->profile_id, 'profile_ref' => $this->profile_ref)))));
 }