diff --git a/src/main/java/org/sitmun/authorization/dto/ApplicationDto.java b/src/main/java/org/sitmun/authorization/dto/ApplicationDto.java index 39c2e6a9..0b1a15b3 100644 --- a/src/main/java/org/sitmun/authorization/dto/ApplicationDto.java +++ b/src/main/java/org/sitmun/authorization/dto/ApplicationDto.java @@ -17,6 +17,8 @@ public class ApplicationDto { private String srs; @JsonProperty("situation-map") private String situationMap; + private String logo; + private String description; // The following fields are related to the Territory diff --git a/src/main/java/org/sitmun/authorization/dto/ApplicationDtoLittle.java b/src/main/java/org/sitmun/authorization/dto/ApplicationDtoLittle.java index d8cb2b04..0211ee47 100644 --- a/src/main/java/org/sitmun/authorization/dto/ApplicationDtoLittle.java +++ b/src/main/java/org/sitmun/authorization/dto/ApplicationDtoLittle.java @@ -8,4 +8,6 @@ public class ApplicationDtoLittle { private int id; private String title; + private String logo; + private String description; } diff --git a/src/main/java/org/sitmun/domain/application/Application.java b/src/main/java/org/sitmun/domain/application/Application.java index b7db4ae0..67d396a8 100755 --- a/src/main/java/org/sitmun/domain/application/Application.java +++ b/src/main/java/org/sitmun/domain/application/Application.java @@ -12,6 +12,7 @@ import org.sitmun.domain.cartography.permission.CartographyPermission; import org.sitmun.domain.role.Role; import org.sitmun.domain.tree.Tree; +import org.sitmun.infrastructure.persistence.type.basic.Http; import org.sitmun.infrastructure.persistence.type.codelist.CodeList; import org.sitmun.infrastructure.persistence.type.list.StringListAttributeConverter; import org.sitmun.infrastructure.persistence.type.srs.Srs; @@ -54,6 +55,19 @@ public class Application { @NotBlank private String name; + /** + * Application description. + */ + @Column(name = "APP_DESCRIPTION", length = PersistenceConstants.LONG_DESCRIPTION) + private String description; + + /** + * Link to the application logo. + */ + @Column(name = "APP_LOGO", length = PersistenceConstants.URL) + @Http + private String logo; + /** * Application type (external or internal). */ diff --git a/src/test/java/org/sitmun/authorization/controller/ClientConfigurationProfileControllerTest.java b/src/test/java/org/sitmun/authorization/controller/ClientConfigurationProfileControllerTest.java index 43a8c0d4..e0ffa5a0 100644 --- a/src/test/java/org/sitmun/authorization/controller/ClientConfigurationProfileControllerTest.java +++ b/src/test/java/org/sitmun/authorization/controller/ClientConfigurationProfileControllerTest.java @@ -37,6 +37,7 @@ void applicationDetails() throws Exception { mvc.perform(get(URIConstants.CONFIG_CLIENT_PROFILE_URI, 1, 1)) .andExpect(status().isOk()) .andExpect(jsonPath("$.application.theme", is("sitmun-base"))) + .andExpect(jsonPath("$.application.logo", is("https://sitmun.org/Documents/Imatges/8480img1320220524090127.jpg"))) .andExpect(jsonPath("$.application.srs", is("EPSG:25831"))) .andExpect(jsonPath("$.application.initialExtent", hasItems(363487.0, 4561229.0, 481617.0, 4686464.0))); } diff --git a/src/test/resources/config/liquibase/changelog/01_schema.h2.sql b/src/test/resources/config/liquibase/changelog/01_schema.h2.sql index 9371af8c..fdb3148a 100644 --- a/src/test/resources/config/liquibase/changelog/01_schema.h2.sql +++ b/src/test/resources/config/liquibase/changelog/01_schema.h2.sql @@ -278,6 +278,8 @@ CREATE TABLE STM_APP APP_TYPE VARCHAR2 (250) NOT NULL, APP_TITLE VARCHAR2 (250), APP_THEME VARCHAR2 (30), + APP_LOGO VARCHAR2 (4000), + APP_DESCRIPTION VARCHAR2 (4000), APP_SCALES VARCHAR2 (250), APP_PROJECT VARCHAR2 (250), APP_TEMPLATE VARCHAR2 (250), diff --git a/src/test/resources/config/liquibase/changelog/01_schema.oracle.sql b/src/test/resources/config/liquibase/changelog/01_schema.oracle.sql index 620bb44c..6bcb8841 100644 --- a/src/test/resources/config/liquibase/changelog/01_schema.oracle.sql +++ b/src/test/resources/config/liquibase/changelog/01_schema.oracle.sql @@ -12,6 +12,8 @@ CREATE TABLE STM_APP APP_SCALES VARCHAR2 (250 CHAR), APP_PROJECT VARCHAR2 (50 CHAR), APP_THEME VARCHAR2 (30 CHAR), + APP_LOGO VARCHAR2 (4000 CHAR), + APP_DESCRIPTION VARCHAR2 (4000 CHAR), APP_TITLE VARCHAR2 (250 CHAR), APP_REFRESH NUMBER (1, 0), APP_TYPE VARCHAR2 (50 CHAR), diff --git a/src/test/resources/config/liquibase/changelog/01_schema.postgresql.sql b/src/test/resources/config/liquibase/changelog/01_schema.postgresql.sql index ecf46a91..ee35c611 100644 --- a/src/test/resources/config/liquibase/changelog/01_schema.postgresql.sql +++ b/src/test/resources/config/liquibase/changelog/01_schema.postgresql.sql @@ -12,6 +12,8 @@ CREATE TABLE STM_APP APP_SCALES VARCHAR(250), APP_PROJECT VARCHAR(50), APP_THEME VARCHAR(30), + APP_LOGO VARCHAR(4000), + APP_DESCRIPTION VARCHAR(4000), APP_TITLE VARCHAR(250), APP_REFRESH BOOLEAN, APP_TYPE VARCHAR(50), diff --git a/src/test/resources/config/liquibase/changelog/04_initial_data_dev.yaml b/src/test/resources/config/liquibase/changelog/04_initial_data_dev.yaml index 54925dbe..081d54b8 100644 --- a/src/test/resources/config/liquibase/changelog/04_initial_data_dev.yaml +++ b/src/test/resources/config/liquibase/changelog/04_initial_data_dev.yaml @@ -512,6 +512,9 @@ databaseChangeLog: - column: name: APP_CREATED type: DATETIME + - column: + name: APP_LOGO + type: STRING - sql: sql: INSERT INTO STM_SEQUENCE(SEQ_NAME, SEQ_COUNT) VALUES ('APP_ID', 5); - loadData: diff --git a/src/test/resources/config/liquibase/changelog/04_initial_data_dev/STM_APP.csv b/src/test/resources/config/liquibase/changelog/04_initial_data_dev/STM_APP.csv index 77a4cc10..532b29d7 100644 --- a/src/test/resources/config/liquibase/changelog/04_initial_data_dev/STM_APP.csv +++ b/src/test/resources/config/liquibase/changelog/04_initial_data_dev/STM_APP.csv @@ -1,6 +1,6 @@ -APP_ID,APP_NAME,APP_TYPE,APP_TITLE,APP_THEME,APP_SCALES,APP_PROJECT,APP_TEMPLATE,APP_REFRESH,APP_GGIID,APP_CREATED -1,SITMUN - Provincial,I,SITMUN - Provincial,sitmun-base,"2000000,1000000,700000,600000,500000,250000,100000,75000,50000,25000,20000,15000,10000,5000,2000,1000,500",EPSG:25831,"",1,3,2011-04-29 11:41:56 -2,SITMUN - Municipal,I,SITMUN - Municipal,sitmun-base,"100000,75000,50000,25000,20000,15000,10000,5000,2000,1000,500",EPSG:25831,"",1,NULL,2011-04-29 11:41:56 -3,SITMUN - Supramunicipal,I,SITMUN - Supramunicipal,sitmun-base,"2000000,1000000,500000,250000,100000,75000,50000,25000,20000,15000,10000,5000,2000,1000,500",EPSG:25831,"",1,NULL,2011-04-29 11:41:56 -4,SITMUN - Externa,E,SITMUN - Externa,NULL,NULL,NULL,http://example.com/?ter.codmun=${MUN_INE}&codusr=${USU_CODIGO},0,NULL,2011-04-29 11:41:56 -5,SITMUN - Externa protegida,E,SITMUN - Externa protegida,NULL,NULL,NULL,http://example.com/?ter.codmun=${MUN_INE}&codusr=${USU_CODIGO},0,NULL,2011-04-29 11:41:56 +APP_ID,APP_NAME,APP_TYPE,APP_TITLE,APP_THEME,APP_SCALES,APP_PROJECT,APP_TEMPLATE,APP_REFRESH,APP_GGIID,APP_CREATED,APP_LOGO +1,SITMUN - Provincial,I,SITMUN - Provincial,sitmun-base,"2000000,1000000,700000,600000,500000,250000,100000,75000,50000,25000,20000,15000,10000,5000,2000,1000,500",EPSG:25831,"",1,3,2011-04-29 11:41:56,https://sitmun.org/Documents/Imatges/8480img1320220524090127.jpg +2,SITMUN - Municipal,I,SITMUN - Municipal,sitmun-base,"100000,75000,50000,25000,20000,15000,10000,5000,2000,1000,500",EPSG:25831,"",1,NULL,2011-04-29 11:41:56,NULL +3,SITMUN - Supramunicipal,I,SITMUN - Supramunicipal,sitmun-base,"2000000,1000000,500000,250000,100000,75000,50000,25000,20000,15000,10000,5000,2000,1000,500",EPSG:25831,"",1,NULL,2011-04-29 11:41:56,NULL +4,SITMUN - Externa,E,SITMUN - Externa,NULL,NULL,NULL,http://example.com/?ter.codmun=${MUN_INE}&codusr=${USU_CODIGO},0,NULL,2011-04-29 11:41:56,NULL +5,SITMUN - Externa protegida,E,SITMUN - Externa protegida,NULL,NULL,NULL,http://example.com/?ter.codmun=${MUN_INE}&codusr=${USU_CODIGO},0,NULL,2011-04-29 11:41:56,NULL diff --git a/src/test/resources/config/liquibase/changelog/04_initial_data_dev_postgresql.yaml b/src/test/resources/config/liquibase/changelog/04_initial_data_dev_postgresql.yaml index eb6befee..e9328bbb 100644 --- a/src/test/resources/config/liquibase/changelog/04_initial_data_dev_postgresql.yaml +++ b/src/test/resources/config/liquibase/changelog/04_initial_data_dev_postgresql.yaml @@ -517,6 +517,9 @@ databaseChangeLog: - column: name: APP_CREATED type: DATETIME + - column: + name: APP_LOGO + type: STRING - sql: sql: INSERT INTO STM_SEQUENCE(SEQ_NAME, SEQ_COUNT) VALUES ('APP_ID', 4); - loadData: