Tony CHEMIT pushed to branch develop at ultreiaio / ird-observe

Commits:

2 changed files:

Changes:

  • persistence/src/main/resources/db/migration/7.2/03_create_ps_observation_schema-common.sql
    ... ... @@ -27,35 +27,7 @@ CREATE TABLE ps_observation.nontargetcatchreleaseconformity(topiaid VARCHAR(255)
    27 27
     CREATE TABLE ps_observation.nontargetcatchreleasestatus(topiaid VARCHAR(255) NOT NULL CONSTRAINT pk_ps_observation_nontargetcatchreleasestatus PRIMARY KEY, topiaversion BIGINT NOT NULL, topiacreatedate DATE, lastupdatedate TIMESTAMP NOT NULL, code VARCHAR(255), status INTEGER DEFAULT 1, needcomment BOOLEAN DEFAULT FALSE, uri VARCHAR(255), label1 VARCHAR(255), label2 VARCHAR(255), label3 VARCHAR(255), label4 VARCHAR(255), label5 VARCHAR(255), label6 VARCHAR(255), label7 VARCHAR(255), label8 VARCHAR(255));
    
    28 28
     CREATE TABLE ps_observation.nontargetcatchreleasingtime(topiaid VARCHAR(255) NOT NULL CONSTRAINT pk_ps_observation_nontargetcatchreleasingtime PRIMARY KEY, topiaversion BIGINT NOT NULL, topiacreatedate DATE, lastupdatedate TIMESTAMP NOT NULL, code VARCHAR(255), status INTEGER DEFAULT 1, needcomment BOOLEAN DEFAULT FALSE, uri VARCHAR(255), label1 VARCHAR(255), label2 VARCHAR(255), label3 VARCHAR(255), label4 VARCHAR(255), label5 VARCHAR(255), label6 VARCHAR(255), label7 VARCHAR(255), label8 VARCHAR(255));
    
    29 29
     CREATE TABLE ps_observation.objectmaterialtype(topiaid VARCHAR(255) NOT NULL CONSTRAINT pk_ps_observation_object_material_type PRIMARY KEY, topiaversion BIGINT NOT NULL, topiacreatedate DATE, lastupdatedate TIMESTAMP NOT NULL, code VARCHAR(255) NOT NULL, status INTEGER DEFAULT 1, needcomment BOOLEAN DEFAULT FALSE, uri VARCHAR(255), label1 VARCHAR(255), label2 VARCHAR(255), label3 VARCHAR(255), label4 VARCHAR(255), label5 VARCHAR(255), label6 VARCHAR(255), label7 VARCHAR(255), label8 VARCHAR(255));
    
    30
    -CREATE TABLE ps_observation.objectmaterial
    
    31
    -(
    
    32
    -  topiaid                 VARCHAR(255) NOT NULL
    
    33
    -    CONSTRAINT pk_ps_observation_object_material PRIMARY KEY,
    
    34
    -  topiaversion            BIGINT       NOT NULL,
    
    35
    -  topiacreatedate         DATE,
    
    36
    -  lastupdatedate          TIMESTAMP    NOT NULL,
    
    37
    -  code                    VARCHAR(255) NOT NULL,
    
    38
    -  legacycode              VARCHAR(1025),
    
    39
    -  standardcode            VARCHAR(255),
    
    40
    -  parent                  VARCHAR(255),
    
    41
    -  status                  INTEGER DEFAULT 1,
    
    42
    -  needcomment             BOOLEAN DEFAULT FALSE,
    
    43
    -  uri                     VARCHAR(255),
    
    44
    -  objectmaterialtype      VARCHAR(255),
    
    45
    -  biodegradable           BOOLEAN,
    
    46
    -  nonentangling           BOOLEAN,
    
    47
    -  label1                  VARCHAR(255),
    
    48
    -  label2                  VARCHAR(255),
    
    49
    -  label3                  VARCHAR(255),
    
    50
    -  label4                  VARCHAR(255),
    
    51
    -  label5                  VARCHAR(255),
    
    52
    -  label6                  VARCHAR(255),
    
    53
    -  label7                  VARCHAR(255),
    
    54
    -  label8                  VARCHAR(255),
    
    55
    -  childrenmultiselectable BOOLEAN,
    
    56
    -  childselectionmandatory BOOLEAN,
    
    57
    -  validation              VARCHAR(255)
    
    58
    -);
    
    30
    +CREATE TABLE ps_observation.objectmaterial(topiaid VARCHAR(255) NOT NULL CONSTRAINT pk_ps_observation_object_material PRIMARY KEY,topiaversion BIGINT NOT NULL,topiacreatedate DATE,lastupdatedate TIMESTAMP NOT NULL,code VARCHAR(255) NOT NULL,legacycode VARCHAR(1025),standardcode VARCHAR(255),parent VARCHAR(255),status INTEGER DEFAULT 1,needcomment BOOLEAN DEFAULT FALSE,uri VARCHAR(255),objectmaterialtype VARCHAR(255),biodegradable BOOLEAN,nonentangling BOOLEAN,label1 VARCHAR(255),label2 VARCHAR(255),label3 VARCHAR(255),label4 VARCHAR(255),label5 VARCHAR(255),label6 VARCHAR(255),label7 VARCHAR(255),label8 VARCHAR(255),childrenmultiselectable BOOLEAN,childselectionmandatory BOOLEAN,validation VARCHAR(255));
    
    59 31
     CREATE TABLE ps_observation.objectoperation(topiaid VARCHAR(255) NOT NULL CONSTRAINT pk_ps_observation_objectoperation PRIMARY KEY, topiaversion BIGINT NOT NULL, topiacreatedate TIMESTAMP, code VARCHAR(255), uri VARCHAR(255), status INTEGER DEFAULT 1, label1 VARCHAR(255), label2 VARCHAR(255), label3 VARCHAR(255), label4 VARCHAR(255), label5 VARCHAR(255), label6 VARCHAR(255), label7 VARCHAR(255), label8 VARCHAR(255), needcomment BOOLEAN DEFAULT FALSE, lastupdatedate TIMESTAMP DEFAULT now() NOT NULL, whenarriving BOOLEAN DEFAULT TRUE, whenleaving BOOLEAN DEFAULT TRUE);
    
    60 32
     CREATE TABLE ps_observation.observedsystem(topiaid VARCHAR(255) NOT NULL CONSTRAINT pk_ps_observation_observedsystem PRIMARY KEY, topiaversion BIGINT NOT NULL, topiacreatedate TIMESTAMP, code VARCHAR(255), needcomment BOOLEAN, uri VARCHAR(255), status INTEGER DEFAULT 1, label1 VARCHAR(255), label2 VARCHAR(255), label3 VARCHAR(255), label4 VARCHAR(255), label5 VARCHAR(255), label6 VARCHAR(255), label7 VARCHAR(255), label8 VARCHAR(255), schooltype INTEGER, lastupdatedate TIMESTAMP DEFAULT now() NOT NULL);
    
    61 33
     CREATE TABLE ps_observation.reasonfordiscard(topiaid VARCHAR(255) NOT NULL CONSTRAINT pk_ps_observation_reasonfordiscard PRIMARY KEY, topiaversion BIGINT NOT NULL, topiacreatedate TIMESTAMP, code VARCHAR(255), needcomment BOOLEAN, uri VARCHAR(255), status INTEGER DEFAULT 1, label1 VARCHAR(255), label2 VARCHAR(255), label3 VARCHAR(255), label4 VARCHAR(255), label5 VARCHAR(255), label6 VARCHAR(255), label7 VARCHAR(255), label8 VARCHAR(255), lastupdatedate TIMESTAMP DEFAULT now() NOT NULL);
    
    ... ... @@ -88,36 +60,7 @@ INSERT INTO ps_observation.nontargetcatchreleaseconformity(topiaid, topiaversion
    88 60
     INSERT INTO ps_observation.nontargetcatchreleasestatus(topiaid, topiaversion, topiacreatedate, lastupdatedate, code, status, needcomment, uri, label1, label2, label3, label4, label5, label6, label7, label8) SELECT topiaid, topiaversion, topiacreatedate, lastupdatedate, code, status, needcomment, uri, label1, label2, label3, label4, label5, label6, label7, label8 FROM observe_seine.nontargetcatchreleasestatus;
    
    89 61
     INSERT INTO ps_observation.nontargetcatchreleasingtime(topiaid, topiaversion, topiacreatedate, lastupdatedate, code, status, needcomment, uri, label1, label2, label3, label4, label5, label6, label7, label8) SELECT topiaid, topiaversion, topiacreatedate, lastupdatedate, code, status, needcomment, uri, label1, label2, label3, label4, label5, label6, label7, label8 FROM observe_seine.nontargetcatchreleasingtime;
    
    90 62
     INSERT INTO ps_observation.objectmaterialtype(topiaid, topiaversion, topiacreatedate, lastupdatedate, code, status, needcomment, uri, label1, label2, label3, label4, label5, label6, label7, label8) SELECT topiaid, topiaversion, topiacreatedate, lastupdatedate, code, status, needcomment, uri, label1, label2, label3, label4, label5, label6, label7, label8 FROM observe_seine.objectmaterialtype;
    
    91
    -INSERT INTO ps_observation.objectmaterial(topiaid, topiaversion, topiacreatedate, lastupdatedate, code, legacycode,
    
    92
    -                                          standardcode, parent, status, needcomment, uri, objectmaterialtype,
    
    93
    -                                          biodegradable, nonentangling, label1, label2, label3, label4, label5, label6,
    
    94
    -                                          label7, label8, childrenmultiselectable, childselectionmandatory, validation)
    
    95
    -SELECT topiaid,
    
    96
    -       topiaversion,
    
    97
    -       topiacreatedate,
    
    98
    -       lastupdatedate,
    
    99
    -       code,
    
    100
    -       legacycode,
    
    101
    -       standardcode,
    
    102
    -       parent,
    
    103
    -       status,
    
    104
    -       needcomment,
    
    105
    -       uri,
    
    106
    -       objectmaterialtype,
    
    107
    -       biodegradable,
    
    108
    -       nonentangling,
    
    109
    -       label1,
    
    110
    -       label2,
    
    111
    -       label3,
    
    112
    -       label4,
    
    113
    -       label5,
    
    114
    -       label6,
    
    115
    -       label7,
    
    116
    -       label8,
    
    117
    -       childrenmultiselectable,
    
    118
    -       childselectionmandatory,
    
    119
    -       validation
    
    120
    -FROM observe_seine.objectmaterial;
    
    63
    +INSERT INTO ps_observation.objectmaterial(topiaid, topiaversion, topiacreatedate, lastupdatedate, code, legacycode, standardcode, parent, status, needcomment, uri, objectmaterialtype, biodegradable, nonentangling, label1, label2, label3, label4, label5, label6, label7, label8, childrenmultiselectable, childselectionmandatory, validation) SELECT topiaid,topiaversion,topiacreatedate,lastupdatedate,code,legacycode,standardcode,parent,status,needcomment,uri,objectmaterialtype,biodegradable,nonentangling,label1,label2,label3,label4,label5,label6,label7,label8,childrenmultiselectable,childselectionmandatory,validation FROM observe_seine.objectmaterial;
    
    121 64
     INSERT INTO ps_observation.objectoperation(topiaid, topiaversion, topiacreatedate, code, uri, status, label1, label2, label3, label4, label5, label6, label7, label8, needcomment, lastupdatedate, whenarriving, whenleaving) SELECT topiaid, topiaversion, topiacreatedate, code, uri, status, label1, label2, label3, label4, label5, label6, label7, label8, needcomment, lastupdatedate, whenarriving, whenleaving FROM observe_seine.objectoperation;
    
    122 65
     INSERT INTO ps_observation.observedsystem(topiaid, topiaversion, topiacreatedate, code, needcomment, uri, status, label1, label2, label3, label4, label5, label6, label7, label8, schooltype, lastupdatedate) SELECT topiaid, topiaversion, topiacreatedate, code, needcomment, uri, status, label1, label2, label3, label4, label5, label6, label7, label8, schooltype, lastupdatedate FROM observe_seine.observedsystem;
    
    123 66
     INSERT INTO ps_observation.reasonfordiscard(topiaid, topiaversion, topiacreatedate, code, needcomment, uri, status, label1, label2, label3, label4, label5, label6, label7, label8, lastupdatedate) SELECT topiaid, topiaversion, topiacreatedate, code, needcomment, uri, status, label1, label2, label3, label4, label5, label6, label7, label8, lastupdatedate FROM observe_seine.reasonfordiscard;
    

  • services/src/main/java/fr/ird/observe/services/service/referential/ReferentialService.java
    ... ... @@ -80,6 +80,11 @@ public interface ReferentialService extends ObserveService {
    80 80
         @Get
    
    81 81
         ImmutableSet<SpeciesGroupDto> loadSensibleSpeciesGroup();
    
    82 82
     
    
    83
    +    //FIXME charger cela dans le cache côté applicatif
    
    84
    +    @ReadReferentialPermission
    
    85
    +    @Get
    
    86
    +    List<ObservedSystemReference> loadObservedSystems();
    
    87
    +
    
    83 88
         @ReadReferentialPermission
    
    84 89
         @Get
    
    85 90
         <R extends ReferentialDto> Form<R> loadForm(Class<R> type, String id);
    
    ... ... @@ -104,18 +109,15 @@ public interface ReferentialService extends ObserveService {
    104 109
     
    
    105 110
         @Post
    
    106 111
         @WriteReferentialPermission
    
    107
    -    @WriteDataPermission
    
    108 112
         @Write
    
    109 113
         <E extends ReferentialDto> void replaceReference(Class<E> beanType, String idToReplace, String replaceId);
    
    110 114
     
    
    111 115
         @Post(useMultiPartForm = true)
    
    112 116
         @ReadReferentialPermission
    
    113
    -    @ReadDataPermission
    
    114 117
         <R extends ReferentialDto> ImmutableSetDtoMap<DtoReference> findAllUsages(Class<R> beanType, String id);
    
    115 118
     
    
    116 119
         @Get
    
    117 120
         @ReadReferentialPermission
    
    118
    -    @ReadDataPermission
    
    119 121
         <R extends ReferentialDto> boolean exists(Class<R> type, String id);
    
    120 122
     
    
    121 123
         @ReadReferentialPermission
    
    ... ... @@ -133,8 +135,4 @@ public interface ReferentialService extends ObserveService {
    133 135
         @Post(useMultiPartForm = true)
    
    134 136
         @Write
    
    135 137
         void insertMissingReferential(TopiaSqlScript sqlContent);
    
    136
    -
    
    137
    -    @ReadReferentialPermission
    
    138
    -    @Get
    
    139
    -    List<ObservedSystemReference> loadObservedSystems();
    
    140 138
     }