Commit fddda2e9 authored by Jean-Philippe Metivier's avatar Jean-Philippe Metivier
Browse files

Ajout des WS associés aux structures

parent 3028680f
Loading
Loading
Loading
Loading
+1 −1
Changes for module/Import/config/module.config.php: 1 added line, 1 removed line.
Original line number Diff line number Diff line
@@ -99,7 +99,7 @@ return array(
                                'source_code'   => 'non renseigné',
                            ],
                            'constraints' => [
                                'service'       => implode ('|', ["all","these","doctorant","acteur","variable","individu","role"]),
                                'service'       => implode ('|', ["all","these","doctorant","acteur","variable","individu","role", "structure", "etablissement", "unite-recherche", "ecole-doctorale"]),
                                'etablissement' => implode ('|', ["UCN","ULHN","INSA","URN"]),
                            ]
                        ],
+9 −3
Changes for module/Import/src/Import/Controller/ImportController.php: 9 added lines, 3 removed lines.
Original line number Diff line number Diff line
@@ -46,7 +46,7 @@ class ImportController extends AbstractActionController

        /** is it all ? */
        if ($service_para === "all") {
            $services = ['variable', 'role', 'doctorant', 'these', 'individu', 'acteur'];
            $services = ['variable', 'role', 'doctorant', 'these', 'individu', 'acteur', 'structure', 'etablissement', 'ecole-doctorale', 'unite-recherche'];
        } else {
            $services = [ $service_para ];
        }
@@ -72,10 +72,16 @@ class ImportController extends AbstractActionController


            $dataName = $service;
            $entityClass = "Import\Model\Tmp" . ucwords($service);
            $entityName = str_replace("-"," ", $service);
            $entityName = ucwords($entityName);
            $entityName = str_replace(" ","", $entityName);
            $entityClass = "Import\Model\Tmp" . $entityName;
            $source_code = ($source_code != "non renseigné") ? $source_code : null;

            /** Execution de la récupération */
//            var_dump($dataName);
//            var_dump($entityClass);
//            var_dump($source_code);
            try {
                $logs[] = $this->fetcherService->fetch($dataName, $entityClass, $source_code);
            } catch (\Exception $e) {
@@ -106,7 +112,7 @@ class ImportController extends AbstractActionController

        /** is it all ? */
        if ($service_para === "all") {
            $services = ['variable', 'role', 'doctorant', 'these', 'individu', 'acteur'];
            $services = ['variable', 'role', 'doctorant', 'these', 'individu', 'acteur', 'structure', 'etablissement', 'ecole-doctorale', 'unite-recherche'];
        } else {
            $services = [ $service_para ];
        }
+12 −0
Changes for module/Import/src/Import/Model/Mapping/Import.Model.TmpEcoleDoctorale.dcm.xml: 12 added lines, 0 removed lines.
Original line number Diff line number Diff line
<?xml version="1.0" encoding="utf-8"?>
<doctrine-mapping xmlns="http://doctrine-project.org/schemas/orm/doctrine-mapping"
                  xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
                  xsi:schemaLocation="http://doctrine-project.org/schemas/orm/doctrine-mapping http://doctrine-project.org/schemas/orm/doctrine-mapping.xsd">
    <entity name="Import\Model\TmpEcoleDoctorale" table="TMP_ECOLE_DOCT">
        <id name="id" type="string" column="ID"/>
        <field name="etablissementId"   type="string"   column="ETABLISSEMENT_ID"    length="64"    nullable="true"/>
        <field name="sourceId"          type="string"   column="SOURCE_ID"           length="64"    nullable="true"/>
        <field name="sourceCode"        type="string"   column="SOURCE_CODE"         length="64"    nullable="true"/>
        <field name="structureId"       type="string"   column="STRUCTURE_ID"        length="64"    nullable="true"/>
    </entity>
</doctrine-mapping>
+12 −0
Changes for module/Import/src/Import/Model/Mapping/Import.Model.TmpEtablissement.dcm.xml: 12 added lines, 0 removed lines.
Original line number Diff line number Diff line
<?xml version="1.0" encoding="utf-8"?>
<doctrine-mapping xmlns="http://doctrine-project.org/schemas/orm/doctrine-mapping"
                  xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
                  xsi:schemaLocation="http://doctrine-project.org/schemas/orm/doctrine-mapping http://doctrine-project.org/schemas/orm/doctrine-mapping.xsd">
    <entity name="Import\Model\TmpEtablissement" table="TMP_ETABLISSEMENT">
        <id name="id" type="string" column="ID"/>
        <field name="etablissementId"   type="string"   column="ETABLISSEMENT_ID"    length="64"    nullable="true"/>
        <field name="sourceId"          type="string"   column="SOURCE_ID"           length="64"    nullable="true"/>
        <field name="sourceCode"        type="string"   column="SOURCE_CODE"         length="64"    nullable="true"/>
        <field name="structureId"       type="string"   column="STRUCTURE_ID"        length="64"    nullable="true"/>
    </entity>
</doctrine-mapping>
+17 −0
Changes for module/Import/src/Import/Model/Mapping/Import.Model.TmpStructure.dcm.xml: 17 added lines, 0 removed lines.
Original line number Diff line number Diff line
<?xml version="1.0" encoding="utf-8"?>
<doctrine-mapping xmlns="http://doctrine-project.org/schemas/orm/doctrine-mapping"
                  xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
                  xsi:schemaLocation="http://doctrine-project.org/schemas/orm/doctrine-mapping http://doctrine-project.org/schemas/orm/doctrine-mapping.xsd">
    <entity name="Import\Model\TmpStructure" table="TMP_STRUCTURE">
        <id name="id" type="string" column="ID"/>
        <field name="etablissementId"   type="string"   column="ETABLISSEMENT_ID"    length="64"    nullable="true"/>
        <field name="sourceId"          type="string"   column="SOURCE_ID"           length="64"    nullable="true"/>
        <field name="code"              type="string"   column="SOURCE_CODE"         length="64"    nullable="true"/>
        <field name="typeStructureId"   type="string"   column="TYPE_STRUCTURE_ID"   length="64"    nullable="true"/>
        <field name="sigle"             type="string"   column="SIGLE"               length="64"    nullable="true"/>
        <field name="libelle"           type="string"   column="LIBELLE"             length="128"   nullable="true"/>
        <field name="codePays"          type="string"   column="CODE_PAYS"           length="128"   nullable="true"/>
        <field name="libellePays"       type="string"   column="LIBELLE_PAYS"        length="128"   nullable="true"/>

    </entity>
</doctrine-mapping>
Loading