Tony CHEMIT pushed to branch develop at ultreiaio / ird-observe Commits: 15cc354d by tchemit at 2019-01-12T15:15:07Z reformat migration code - - - - - 63d7a5de by tchemit at 2019-01-12T15:39:37Z Impossible de voir les utilisations de référentiel si connecté en mode referentiel - Closes #1197 - - - - - 2 changed files: - persistence/src/main/resources/db/migration/7.2/03_create_ps_observation_schema-common.sql - services/src/main/java/fr/ird/observe/services/service/referential/ReferentialService.java 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) 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)); 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)); 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)); -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) -); +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)); 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); 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); 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 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; 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; 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; -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; +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; 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; 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; 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 { @Get ImmutableSet<SpeciesGroupDto> loadSensibleSpeciesGroup(); + //FIXME charger cela dans le cache côté applicatif + @ReadReferentialPermission + @Get + List<ObservedSystemReference> loadObservedSystems(); + @ReadReferentialPermission @Get <R extends ReferentialDto> Form<R> loadForm(Class<R> type, String id); @@ -104,18 +109,15 @@ public interface ReferentialService extends ObserveService { @Post @WriteReferentialPermission - @WriteDataPermission @Write <E extends ReferentialDto> void replaceReference(Class<E> beanType, String idToReplace, String replaceId); @Post(useMultiPartForm = true) @ReadReferentialPermission - @ReadDataPermission <R extends ReferentialDto> ImmutableSetDtoMap<DtoReference> findAllUsages(Class<R> beanType, String id); @Get @ReadReferentialPermission - @ReadDataPermission <R extends ReferentialDto> boolean exists(Class<R> type, String id); @ReadReferentialPermission @@ -133,8 +135,4 @@ public interface ReferentialService extends ObserveService { @Post(useMultiPartForm = true) @Write void insertMissingReferential(TopiaSqlScript sqlContent); - - @ReadReferentialPermission - @Get - List<ObservedSystemReference> loadObservedSystems(); } View it on GitLab: https://gitlab.com/ultreiaio/ird-observe/compare/33017abc178fad8e2e812a76d25... -- View it on GitLab: https://gitlab.com/ultreiaio/ird-observe/compare/33017abc178fad8e2e812a76d25... You're receiving this email because of your account on gitlab.com.
participants (1)
-
Tony CHEMIT