Loading pom.xml +17 −12 Original line number Diff line number Diff line Loading @@ -14,7 +14,7 @@ <groupId>es.redmic.lib</groupId> <artifactId>models</artifactId> <packaging>jar</packaging> <version>0.12.0</version> <version>0.12.0-feature-refactoring</version> <name>Models</name> <description>Input-output classes and models</description> Loading @@ -28,21 +28,18 @@ <!-- REDMIC --> <redmic.exceptions.version>0.10.0</redmic.exceptions.version> <redmic.jackson-jsonschema.version>0.8.0-feature-changeUrlType</redmic.jackson-jsonschema.version> <redmic.jts4jackson.version>0.0.1</redmic.jts4jackson.version> <!-- OTHERS --> <commons-beanutils.version>1.9.3</commons-beanutils.version> <commons-beanutils.version>1.9.4</commons-beanutils.version> <geotools.version>20.1</geotools.version> <commons-io.version>2.6</commons-io.version> <jackson-datatype-jts.version>2.4</jackson-datatype-jts.version> <commons-io.version>2.8.0</commons-io.version> <jackson-datatype-jts.version>1.0-2.7</jackson-datatype-jts.version> <hibernate-validator.version>6.0.8.Final</hibernate-validator.version> <org.mockito-version>1.10.19</org.mockito-version> <!-- Version plugins --> <jacoco.version>0.8.1</jacoco.version> <org.mockito-version>1.10.19</org.mockito-version> </properties> <dependencies> Loading @@ -61,11 +58,6 @@ <version>${redmic.jackson-jsonschema.version}</version> </dependency> <dependency> <groupId>es.redmic.lib</groupId> <artifactId>jts4jackson</artifactId> <version>${redmic.jts4jackson.version}</version> </dependency> <!-- Spring --> <!-- Para multpartfile --> Loading @@ -80,6 +72,12 @@ </dependency> <!-- Otros --> <dependency> <groupId>com.graphhopper.external</groupId> <artifactId>jackson-datatype-jts</artifactId> <version>${jackson-datatype-jts.version}</version> <scope>provided</scope> </dependency> <!-- Bean compare --> <dependency> Loading Loading @@ -145,6 +143,13 @@ </dependency> <!-- test --> <dependency> <groupId>org.springframework.boot</groupId> <artifactId>spring-boot-starter-test</artifactId> <scope>test</scope> </dependency> <dependency> <groupId>org.mockito</groupId> <artifactId>mockito-all</artifactId> Loading src/main/java/es/redmic/models/es/administrative/dto/ActivityDTO.java +72 −0 Original line number Diff line number Diff line Loading @@ -21,6 +21,8 @@ package es.redmic.models.es.administrative.dto; */ import javax.validation.constraints.NotNull; import javax.validation.constraints.Size; import java.util.ArrayList; import java.util.List; import com.fasterxml.jackson.annotation.JsonIgnoreProperties; Loading @@ -32,6 +34,7 @@ import com.kjetland.jackson.jsonSchema.annotations.JsonSchemaUrl; import es.redmic.models.es.common.deserializer.CustomRelationDeserializer; import es.redmic.models.es.maintenance.administrative.dto.ActivityTypeDTO; import es.redmic.models.es.maintenance.administrative.dto.ThemeInspireDTO; public class ActivityDTO extends ActivityBaseDTO { Loading @@ -42,6 +45,12 @@ public class ActivityDTO extends ActivityBaseDTO { @JsonSchemaUrl(value = "controller.mapping.PROJECT") private AncestorActivityDTO parent; @JsonIgnoreProperties(value = { "_meta" }) @JsonSerialize(as = AncestorActivityDTO.class) @JsonDeserialize(using = CustomRelationDeserializer.class) @JsonSchemaIgnore private AncestorActivityDTO grandparent; @JsonIgnoreProperties(value = { "_meta" }) @NotNull @JsonDeserialize(using = CustomRelationDeserializer.class) Loading @@ -54,6 +63,21 @@ public class ActivityDTO extends ActivityBaseDTO { @JsonSchemaUniqueItemsByRequiredProperties private List<ActivityResourceDTO> resources; @JsonIgnoreProperties(value = { "_meta" }) @JsonDeserialize(using = CustomRelationDeserializer.class) @JsonSchemaUrl(value = "controller.mapping.THEME_INSPIRE") private ThemeInspireDTO themeInspire; @Size(max = 5000) private String licence; @Size(max = 5000) private String normative; private String spatialExtension; private Boolean starred; public ActivityDTO() { super(); this.resources = new ArrayList<>(); Loading @@ -67,6 +91,14 @@ public class ActivityDTO extends ActivityBaseDTO { this.parent = parent; } public AncestorActivityDTO getGrandparent() { return this.grandparent; } public void setGrandparent(AncestorActivityDTO grandparent) { this.grandparent = grandparent; } public ActivityTypeDTO getActivityType() { return activityType; } Loading @@ -90,4 +122,44 @@ public class ActivityDTO extends ActivityBaseDTO { public void setResources(List<ActivityResourceDTO> resources) { this.resources = resources; } public ThemeInspireDTO getThemeInspire() { return this.themeInspire; } public void setThemeInspire(ThemeInspireDTO themeInspire) { this.themeInspire = themeInspire; } public String getLicence() { return this.licence; } public void setLicence(String licence) { this.licence = licence; } public String getNormative() { return this.normative; } public void setNormative(String normative) { this.normative = normative; } public String getSpatialExtension() { return this.spatialExtension; } public void setSpatialExtension(String spatialExtension) { this.spatialExtension = spatialExtension; } public Boolean getStarred() { return this.starred; } public void setStarred(Boolean starred) { this.starred = starred; } } src/main/java/es/redmic/models/es/administrative/dto/ActivityResourceDTO.java +34 −17 Original line number Diff line number Diff line package es.redmic.models.es.administrative.dto; /*- * #%L * Models * %% * Copyright (C) 2019 - 2021 REDMIC Project / Server * %% * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. * You may obtain a copy of the License at * * http://www.apache.org/licenses/LICENSE-2.0 * * Unless required by applicable law or agreed to in writing, software * distributed under the License is distributed on an "AS IS" BASIS, * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. * See the License for the specific language governing permissions and * limitations under the License. * #L% */ import javax.validation.constraints.NotNull; import javax.validation.constraints.Size; import com.fasterxml.jackson.annotation.JsonIgnoreProperties; import com.fasterxml.jackson.databind.annotation.JsonDeserialize; import com.kjetland.jackson.jsonSchema.annotations.JsonSchemaUrl; import es.redmic.models.es.common.deserializer.CustomRelationDeserializer; import es.redmic.models.es.common.dto.DTOImplement; import es.redmic.models.es.maintenance.administrative.dto.ResourceTypeDTO; public class ActivityResourceDTO extends DTOImplement { @JsonIgnoreProperties(value = {"_meta"}) @NotNull @Size(min = 1, max = 100) private String name; @Size(min = 0, max = 1500) private String description; @JsonDeserialize(using = CustomRelationDeserializer.class) @JsonSchemaUrl(value="controller.mapping.RESOURCE_TYPE") private ResourceTypeDTO resourceType; @NotNull @Size(min = 1, max = 500) Loading @@ -22,20 +47,12 @@ public class ActivityResourceDTO extends DTOImplement { // default constructor } public String getName() { return this.name; } public void setName(String name) { this.name = name; } public String getDescription() { return this.description; public ResourceTypeDTO getResourceType() { return this.resourceType; } public void setDescription(String description) { this.description = description; public void setResourceType(ResourceTypeDTO resourceType) { this.resourceType = resourceType; } public String getUrlResource() { Loading src/main/java/es/redmic/models/es/administrative/model/Activity.java +71 −0 Original line number Diff line number Diff line Loading @@ -25,6 +25,7 @@ import com.fasterxml.jackson.annotation.JsonIgnoreProperties; import com.fasterxml.jackson.annotation.JsonProperty; import es.redmic.models.es.maintenance.administrative.model.ActivityType; import es.redmic.models.es.maintenance.administrative.model.ThemeInspire; Loading @@ -43,6 +44,20 @@ public class Activity extends ActivityBase { private List<ActivityResource> resources; private ThemeInspire themeInspire; private String licence; private String normative; private String spatialExtension; private Boolean starred; private ActivityCompact parent; private ActivityCompact grandparent; public Activity() { super(); } Loading Loading @@ -70,4 +85,60 @@ public class Activity extends ActivityBase { public void setResources(List<ActivityResource> resources) { this.resources = resources; } public ThemeInspire getThemeInspire() { return this.themeInspire; } public void setThemeInspire(ThemeInspire themeInspire) { this.themeInspire = themeInspire; } public String getLicence() { return this.licence; } public void setLicence(String licence) { this.licence = licence; } public String getNormative() { return this.normative; } public void setNormative(String normative) { this.normative = normative; } public String getSpatialExtension() { return this.spatialExtension; } public void setSpatialExtension(String spatialExtension) { this.spatialExtension = spatialExtension; } public Boolean getStarred() { return this.starred; } public void setStarred(Boolean starred) { this.starred = starred; } public ActivityCompact getParent() { return this.parent; } public void setParent(ActivityCompact parent) { this.parent = parent; } public ActivityCompact getGrandparent() { return this.grandparent; } public void setGrandparent(ActivityCompact grandparent) { this.grandparent = grandparent; } } src/main/java/es/redmic/models/es/administrative/model/ActivityResource.java +26 −15 Original line number Diff line number Diff line package es.redmic.models.es.administrative.model; /*- * #%L * Models * %% * Copyright (C) 2019 - 2021 REDMIC Project / Server * %% * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. * You may obtain a copy of the License at * * http://www.apache.org/licenses/LICENSE-2.0 * * Unless required by applicable law or agreed to in writing, software * distributed under the License is distributed on an "AS IS" BASIS, * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. * See the License for the specific language governing permissions and * limitations under the License. * #L% */ import es.redmic.models.es.common.model.BaseAbstractES; import es.redmic.models.es.maintenance.administrative.model.ResourceType; public class ActivityResource extends BaseAbstractES { private String name; private String description; private ResourceType resourceType; private String urlResource; Loading @@ -14,20 +33,12 @@ public class ActivityResource extends BaseAbstractES { // default constructor } public String getName() { return this.name; } public void setName(String name) { this.name = name; } public String getDescription() { return this.description; public ResourceType getResourceType() { return this.resourceType; } public void setDescription(String description) { this.description = description; public void setResourceType(ResourceType resourceType) { this.resourceType = resourceType; } public String getUrlResource() { Loading Loading
pom.xml +17 −12 Original line number Diff line number Diff line Loading @@ -14,7 +14,7 @@ <groupId>es.redmic.lib</groupId> <artifactId>models</artifactId> <packaging>jar</packaging> <version>0.12.0</version> <version>0.12.0-feature-refactoring</version> <name>Models</name> <description>Input-output classes and models</description> Loading @@ -28,21 +28,18 @@ <!-- REDMIC --> <redmic.exceptions.version>0.10.0</redmic.exceptions.version> <redmic.jackson-jsonschema.version>0.8.0-feature-changeUrlType</redmic.jackson-jsonschema.version> <redmic.jts4jackson.version>0.0.1</redmic.jts4jackson.version> <!-- OTHERS --> <commons-beanutils.version>1.9.3</commons-beanutils.version> <commons-beanutils.version>1.9.4</commons-beanutils.version> <geotools.version>20.1</geotools.version> <commons-io.version>2.6</commons-io.version> <jackson-datatype-jts.version>2.4</jackson-datatype-jts.version> <commons-io.version>2.8.0</commons-io.version> <jackson-datatype-jts.version>1.0-2.7</jackson-datatype-jts.version> <hibernate-validator.version>6.0.8.Final</hibernate-validator.version> <org.mockito-version>1.10.19</org.mockito-version> <!-- Version plugins --> <jacoco.version>0.8.1</jacoco.version> <org.mockito-version>1.10.19</org.mockito-version> </properties> <dependencies> Loading @@ -61,11 +58,6 @@ <version>${redmic.jackson-jsonschema.version}</version> </dependency> <dependency> <groupId>es.redmic.lib</groupId> <artifactId>jts4jackson</artifactId> <version>${redmic.jts4jackson.version}</version> </dependency> <!-- Spring --> <!-- Para multpartfile --> Loading @@ -80,6 +72,12 @@ </dependency> <!-- Otros --> <dependency> <groupId>com.graphhopper.external</groupId> <artifactId>jackson-datatype-jts</artifactId> <version>${jackson-datatype-jts.version}</version> <scope>provided</scope> </dependency> <!-- Bean compare --> <dependency> Loading Loading @@ -145,6 +143,13 @@ </dependency> <!-- test --> <dependency> <groupId>org.springframework.boot</groupId> <artifactId>spring-boot-starter-test</artifactId> <scope>test</scope> </dependency> <dependency> <groupId>org.mockito</groupId> <artifactId>mockito-all</artifactId> Loading
src/main/java/es/redmic/models/es/administrative/dto/ActivityDTO.java +72 −0 Original line number Diff line number Diff line Loading @@ -21,6 +21,8 @@ package es.redmic.models.es.administrative.dto; */ import javax.validation.constraints.NotNull; import javax.validation.constraints.Size; import java.util.ArrayList; import java.util.List; import com.fasterxml.jackson.annotation.JsonIgnoreProperties; Loading @@ -32,6 +34,7 @@ import com.kjetland.jackson.jsonSchema.annotations.JsonSchemaUrl; import es.redmic.models.es.common.deserializer.CustomRelationDeserializer; import es.redmic.models.es.maintenance.administrative.dto.ActivityTypeDTO; import es.redmic.models.es.maintenance.administrative.dto.ThemeInspireDTO; public class ActivityDTO extends ActivityBaseDTO { Loading @@ -42,6 +45,12 @@ public class ActivityDTO extends ActivityBaseDTO { @JsonSchemaUrl(value = "controller.mapping.PROJECT") private AncestorActivityDTO parent; @JsonIgnoreProperties(value = { "_meta" }) @JsonSerialize(as = AncestorActivityDTO.class) @JsonDeserialize(using = CustomRelationDeserializer.class) @JsonSchemaIgnore private AncestorActivityDTO grandparent; @JsonIgnoreProperties(value = { "_meta" }) @NotNull @JsonDeserialize(using = CustomRelationDeserializer.class) Loading @@ -54,6 +63,21 @@ public class ActivityDTO extends ActivityBaseDTO { @JsonSchemaUniqueItemsByRequiredProperties private List<ActivityResourceDTO> resources; @JsonIgnoreProperties(value = { "_meta" }) @JsonDeserialize(using = CustomRelationDeserializer.class) @JsonSchemaUrl(value = "controller.mapping.THEME_INSPIRE") private ThemeInspireDTO themeInspire; @Size(max = 5000) private String licence; @Size(max = 5000) private String normative; private String spatialExtension; private Boolean starred; public ActivityDTO() { super(); this.resources = new ArrayList<>(); Loading @@ -67,6 +91,14 @@ public class ActivityDTO extends ActivityBaseDTO { this.parent = parent; } public AncestorActivityDTO getGrandparent() { return this.grandparent; } public void setGrandparent(AncestorActivityDTO grandparent) { this.grandparent = grandparent; } public ActivityTypeDTO getActivityType() { return activityType; } Loading @@ -90,4 +122,44 @@ public class ActivityDTO extends ActivityBaseDTO { public void setResources(List<ActivityResourceDTO> resources) { this.resources = resources; } public ThemeInspireDTO getThemeInspire() { return this.themeInspire; } public void setThemeInspire(ThemeInspireDTO themeInspire) { this.themeInspire = themeInspire; } public String getLicence() { return this.licence; } public void setLicence(String licence) { this.licence = licence; } public String getNormative() { return this.normative; } public void setNormative(String normative) { this.normative = normative; } public String getSpatialExtension() { return this.spatialExtension; } public void setSpatialExtension(String spatialExtension) { this.spatialExtension = spatialExtension; } public Boolean getStarred() { return this.starred; } public void setStarred(Boolean starred) { this.starred = starred; } }
src/main/java/es/redmic/models/es/administrative/dto/ActivityResourceDTO.java +34 −17 Original line number Diff line number Diff line package es.redmic.models.es.administrative.dto; /*- * #%L * Models * %% * Copyright (C) 2019 - 2021 REDMIC Project / Server * %% * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. * You may obtain a copy of the License at * * http://www.apache.org/licenses/LICENSE-2.0 * * Unless required by applicable law or agreed to in writing, software * distributed under the License is distributed on an "AS IS" BASIS, * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. * See the License for the specific language governing permissions and * limitations under the License. * #L% */ import javax.validation.constraints.NotNull; import javax.validation.constraints.Size; import com.fasterxml.jackson.annotation.JsonIgnoreProperties; import com.fasterxml.jackson.databind.annotation.JsonDeserialize; import com.kjetland.jackson.jsonSchema.annotations.JsonSchemaUrl; import es.redmic.models.es.common.deserializer.CustomRelationDeserializer; import es.redmic.models.es.common.dto.DTOImplement; import es.redmic.models.es.maintenance.administrative.dto.ResourceTypeDTO; public class ActivityResourceDTO extends DTOImplement { @JsonIgnoreProperties(value = {"_meta"}) @NotNull @Size(min = 1, max = 100) private String name; @Size(min = 0, max = 1500) private String description; @JsonDeserialize(using = CustomRelationDeserializer.class) @JsonSchemaUrl(value="controller.mapping.RESOURCE_TYPE") private ResourceTypeDTO resourceType; @NotNull @Size(min = 1, max = 500) Loading @@ -22,20 +47,12 @@ public class ActivityResourceDTO extends DTOImplement { // default constructor } public String getName() { return this.name; } public void setName(String name) { this.name = name; } public String getDescription() { return this.description; public ResourceTypeDTO getResourceType() { return this.resourceType; } public void setDescription(String description) { this.description = description; public void setResourceType(ResourceTypeDTO resourceType) { this.resourceType = resourceType; } public String getUrlResource() { Loading
src/main/java/es/redmic/models/es/administrative/model/Activity.java +71 −0 Original line number Diff line number Diff line Loading @@ -25,6 +25,7 @@ import com.fasterxml.jackson.annotation.JsonIgnoreProperties; import com.fasterxml.jackson.annotation.JsonProperty; import es.redmic.models.es.maintenance.administrative.model.ActivityType; import es.redmic.models.es.maintenance.administrative.model.ThemeInspire; Loading @@ -43,6 +44,20 @@ public class Activity extends ActivityBase { private List<ActivityResource> resources; private ThemeInspire themeInspire; private String licence; private String normative; private String spatialExtension; private Boolean starred; private ActivityCompact parent; private ActivityCompact grandparent; public Activity() { super(); } Loading Loading @@ -70,4 +85,60 @@ public class Activity extends ActivityBase { public void setResources(List<ActivityResource> resources) { this.resources = resources; } public ThemeInspire getThemeInspire() { return this.themeInspire; } public void setThemeInspire(ThemeInspire themeInspire) { this.themeInspire = themeInspire; } public String getLicence() { return this.licence; } public void setLicence(String licence) { this.licence = licence; } public String getNormative() { return this.normative; } public void setNormative(String normative) { this.normative = normative; } public String getSpatialExtension() { return this.spatialExtension; } public void setSpatialExtension(String spatialExtension) { this.spatialExtension = spatialExtension; } public Boolean getStarred() { return this.starred; } public void setStarred(Boolean starred) { this.starred = starred; } public ActivityCompact getParent() { return this.parent; } public void setParent(ActivityCompact parent) { this.parent = parent; } public ActivityCompact getGrandparent() { return this.grandparent; } public void setGrandparent(ActivityCompact grandparent) { this.grandparent = grandparent; } }
src/main/java/es/redmic/models/es/administrative/model/ActivityResource.java +26 −15 Original line number Diff line number Diff line package es.redmic.models.es.administrative.model; /*- * #%L * Models * %% * Copyright (C) 2019 - 2021 REDMIC Project / Server * %% * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. * You may obtain a copy of the License at * * http://www.apache.org/licenses/LICENSE-2.0 * * Unless required by applicable law or agreed to in writing, software * distributed under the License is distributed on an "AS IS" BASIS, * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. * See the License for the specific language governing permissions and * limitations under the License. * #L% */ import es.redmic.models.es.common.model.BaseAbstractES; import es.redmic.models.es.maintenance.administrative.model.ResourceType; public class ActivityResource extends BaseAbstractES { private String name; private String description; private ResourceType resourceType; private String urlResource; Loading @@ -14,20 +33,12 @@ public class ActivityResource extends BaseAbstractES { // default constructor } public String getName() { return this.name; } public void setName(String name) { this.name = name; } public String getDescription() { return this.description; public ResourceType getResourceType() { return this.resourceType; } public void setDescription(String description) { this.description = description; public void setResourceType(ResourceType resourceType) { this.resourceType = resourceType; } public String getUrlResource() { Loading