Loading config/autoload/local.php.dist +12 −0 Original line number Diff line number Diff line <?php return [ /** * Eventuelles instructions SQL à exécuter avant la mise à jour d'une table de service. */ 'services_pre_sql' => [ //'individu' => "begin DBMS_MVIEW.REFRESH('SYGAL_MV_EMAIL', 'C'); end;", ], /** * Connexion à la base de données. */ 'doctrine' => [ 'connection' => [ 'orm_default' => [ Loading @@ -15,6 +24,9 @@ return [ ], ], ], /** * Config du mode d'authentification. */ 'zf-mvc-auth' => [ 'authentication' => [ 'adapters' => [ Loading dist/SQL/apogee/annexe-emails.sql +91 −88 Original line number Diff line number Diff line Loading @@ -6,17 +6,20 @@ -- Web Service d'import de données -- ------------------------------- -- -- Vue matérialisée interrogeant Apogée et l'annuaire LDAP (grâce au package UCBN_LDAP) pour obtenir -- les adresses électroniques. -- Vue matérialisée interrogeant Apogée et l'annuaire LDAP pour obtenir -- les adresses électroniques (grâce au package UCBN_LDAP). -- -- NB : cette vue matérialisée est de type "refresh complete on demand", autrement dit est mise à jour manuellement -- à l'aide de l'instruction PL/SQL `DBMS_MVIEW.REFRESH('SYGAL_MV_EMAIL', 'C')`. -- -- drop materialized view SYGAL_MV_EMAIL --/ CREATE MATERIALIZED VIEW SYGAL_MV_EMAIL refresh complete USING TRUSTED CONSTRAINTS START WITH SYSDATE NEXT SYSDATE + 1/24/6 as create materialized view UCBN_SODOCT.SYGAL_MV_EMAIL refresh complete on demand using trusted constraints as select sysdate as last_update, tmp.* from ( select Loading @@ -33,7 +36,7 @@ START WITH SYSDATE NEXT SYSDATE + 1/24/6 as and dip.cod_tpd_etb in ('39', '40') and tpd.eta_ths_hdr_drt = 'T' -- Inscription en these and tpd.tem_sante = 'N' -- Exclusion des theses d exercice and ind.cod_etu is not null -- oui, oui, ça arrive and ind.cod_etu is not null -- oui, oui, ça arrive union select * from ( Loading module/Application/src/Service/TableService.php +19 −3 Original line number Diff line number Diff line Loading @@ -22,6 +22,11 @@ class TableService */ private $servicesToEntityClassesConfig; /** * @var array */ private $servicesPreSql = []; /** * Liste des colonnes à exclure lors de la mise à jour des tables sources. * Loading @@ -47,6 +52,14 @@ class TableService $this->servicesToEntityClassesConfig = $servicesToEntityClassesConfig; } /** * @param array $servicesPreSql */ public function setServicesPreSql(array $servicesPreSql) { $this->servicesPreSql = $servicesPreSql; } /** * Lance la mise à jour des tables sources. * Loading Loading @@ -122,14 +135,17 @@ class TableService // exclusion éventuelle de certaines colonnes $columnNames = array_diff($columnNames, $this->excludedColumnNames); // SQL à exécuter au préalable ? if (isset($this->servicesPreSql[$service])) { $sqlParts[] = $this->servicesPreSql[$service]; } $sqlParts[] = sprintf($deleteTemplate, $tableName); $sqlParts[] = sprintf($updateTemplate, $tableName, $cols = implode(', ', $columnNames), $cols, $tableName); } $sqlParts[] = 'end;'; $sql = implode(PHP_EOL, $sqlParts); return $sql; return implode(PHP_EOL, $sqlParts); } /** Loading module/Application/src/Service/TableServiceFactory.php +2 −0 Original line number Diff line number Diff line Loading @@ -15,10 +15,12 @@ class TableServiceFactory /** @var array $config */ $config = $container->get('config'); $servicesToEntityClassesConfig = $config['services_to_entity_classes']; $servicesPreSql = $config['services_pre_sql'] ?? []; $service = new TableService(); $service->setEntityManager($entityManager); $service->setServicesToEntityClassesConfig($servicesToEntityClassesConfig); $service->setServicesPreSql($servicesPreSql); return $service; } Loading Loading
config/autoload/local.php.dist +12 −0 Original line number Diff line number Diff line <?php return [ /** * Eventuelles instructions SQL à exécuter avant la mise à jour d'une table de service. */ 'services_pre_sql' => [ //'individu' => "begin DBMS_MVIEW.REFRESH('SYGAL_MV_EMAIL', 'C'); end;", ], /** * Connexion à la base de données. */ 'doctrine' => [ 'connection' => [ 'orm_default' => [ Loading @@ -15,6 +24,9 @@ return [ ], ], ], /** * Config du mode d'authentification. */ 'zf-mvc-auth' => [ 'authentication' => [ 'adapters' => [ Loading
dist/SQL/apogee/annexe-emails.sql +91 −88 Original line number Diff line number Diff line Loading @@ -6,17 +6,20 @@ -- Web Service d'import de données -- ------------------------------- -- -- Vue matérialisée interrogeant Apogée et l'annuaire LDAP (grâce au package UCBN_LDAP) pour obtenir -- les adresses électroniques. -- Vue matérialisée interrogeant Apogée et l'annuaire LDAP pour obtenir -- les adresses électroniques (grâce au package UCBN_LDAP). -- -- NB : cette vue matérialisée est de type "refresh complete on demand", autrement dit est mise à jour manuellement -- à l'aide de l'instruction PL/SQL `DBMS_MVIEW.REFRESH('SYGAL_MV_EMAIL', 'C')`. -- -- drop materialized view SYGAL_MV_EMAIL --/ CREATE MATERIALIZED VIEW SYGAL_MV_EMAIL refresh complete USING TRUSTED CONSTRAINTS START WITH SYSDATE NEXT SYSDATE + 1/24/6 as create materialized view UCBN_SODOCT.SYGAL_MV_EMAIL refresh complete on demand using trusted constraints as select sysdate as last_update, tmp.* from ( select Loading @@ -33,7 +36,7 @@ START WITH SYSDATE NEXT SYSDATE + 1/24/6 as and dip.cod_tpd_etb in ('39', '40') and tpd.eta_ths_hdr_drt = 'T' -- Inscription en these and tpd.tem_sante = 'N' -- Exclusion des theses d exercice and ind.cod_etu is not null -- oui, oui, ça arrive and ind.cod_etu is not null -- oui, oui, ça arrive union select * from ( Loading
module/Application/src/Service/TableService.php +19 −3 Original line number Diff line number Diff line Loading @@ -22,6 +22,11 @@ class TableService */ private $servicesToEntityClassesConfig; /** * @var array */ private $servicesPreSql = []; /** * Liste des colonnes à exclure lors de la mise à jour des tables sources. * Loading @@ -47,6 +52,14 @@ class TableService $this->servicesToEntityClassesConfig = $servicesToEntityClassesConfig; } /** * @param array $servicesPreSql */ public function setServicesPreSql(array $servicesPreSql) { $this->servicesPreSql = $servicesPreSql; } /** * Lance la mise à jour des tables sources. * Loading Loading @@ -122,14 +135,17 @@ class TableService // exclusion éventuelle de certaines colonnes $columnNames = array_diff($columnNames, $this->excludedColumnNames); // SQL à exécuter au préalable ? if (isset($this->servicesPreSql[$service])) { $sqlParts[] = $this->servicesPreSql[$service]; } $sqlParts[] = sprintf($deleteTemplate, $tableName); $sqlParts[] = sprintf($updateTemplate, $tableName, $cols = implode(', ', $columnNames), $cols, $tableName); } $sqlParts[] = 'end;'; $sql = implode(PHP_EOL, $sqlParts); return $sql; return implode(PHP_EOL, $sqlParts); } /** Loading
module/Application/src/Service/TableServiceFactory.php +2 −0 Original line number Diff line number Diff line Loading @@ -15,10 +15,12 @@ class TableServiceFactory /** @var array $config */ $config = $container->get('config'); $servicesToEntityClassesConfig = $config['services_to_entity_classes']; $servicesPreSql = $config['services_pre_sql'] ?? []; $service = new TableService(); $service->setEntityManager($entityManager); $service->setServicesToEntityClassesConfig($servicesToEntityClassesConfig); $service->setServicesPreSql($servicesPreSql); return $service; } Loading