This is an automated email from the git hooks/post-receive script. New commit to branch develop in repository coselmar. See http://git.codelutin.com/coselmar.git commit 901212ed2f45c9b8e52aad41d6300d8ba3a20c6c Author: Yannick Martel <martel@©odelutin.com> Date: Wed Jan 6 16:10:04 2016 +0100 refs-40 #7867 ajout d'une liste de liens dans les questions, parties service --- coselmar-persistence/pom.xml | 5 ++++ .../V1_2_0_1__7867_add_list_links_in_projects.sql | 26 +++++++++++++++++++++ .../src/main/xmi/coselmar-model.zargo | Bin 10470 -> 10461 bytes .../fr/ifremer/coselmar/beans/QuestionBean.java | 10 ++++++++ .../coselmar/converter/BeanEntityConverter.java | 17 ++++++++++++++ pom.xml | 5 ++++ 6 files changed, 63 insertions(+) diff --git a/coselmar-persistence/pom.xml b/coselmar-persistence/pom.xml index fd7e59a..82fa6eb 100644 --- a/coselmar-persistence/pom.xml +++ b/coselmar-persistence/pom.xml @@ -77,6 +77,11 @@ </dependency> <dependency> + <groupId>org.nuiton.topia</groupId> + <artifactId>topia-service-flyway</artifactId> + </dependency> + + <dependency> <groupId>org.hibernate</groupId> <artifactId>hibernate-core</artifactId> </dependency> diff --git a/coselmar-persistence/src/main/resources/db/migration/V1_2_0_1__7867_add_list_links_in_projects.sql b/coselmar-persistence/src/main/resources/db/migration/V1_2_0_1__7867_add_list_links_in_projects.sql new file mode 100644 index 0000000..272840e --- /dev/null +++ b/coselmar-persistence/src/main/resources/db/migration/V1_2_0_1__7867_add_list_links_in_projects.sql @@ -0,0 +1,26 @@ +--- +-- #%L +-- Coselmar :: Persistence +-- %% +-- Copyright (C) 2014 - 2016 Ifremer, Code Lutin +-- %% +-- This program is free software: you can redistribute it and/or modify +-- it under the terms of the GNU General Public License as +-- published by the Free Software Foundation, either version 3 of the +-- License, or (at your option) any later version. +-- +-- This program is distributed in the hope that it will be useful, +-- but WITHOUT ANY WARRANTY; without even the implied warranty of +-- MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +-- GNU General Public License for more details. +-- +-- You should have received a copy of the GNU General Public +-- License along with this program. If not, see +-- <http://www.gnu.org/licenses/gpl-3.0.html>. +-- #L% +--- + +CREATE TABLE question_links( + OWNER VARCHAR(255) NOT NULL REFERENCES QUESTION(TOPIAID), + LINKS VARCHAR(255) +); \ No newline at end of file diff --git a/coselmar-persistence/src/main/xmi/coselmar-model.zargo b/coselmar-persistence/src/main/xmi/coselmar-model.zargo index 5b57c85..2f02026 100644 Binary files a/coselmar-persistence/src/main/xmi/coselmar-model.zargo and b/coselmar-persistence/src/main/xmi/coselmar-model.zargo differ diff --git a/coselmar-rest/src/main/java/fr/ifremer/coselmar/beans/QuestionBean.java b/coselmar-rest/src/main/java/fr/ifremer/coselmar/beans/QuestionBean.java index 98d84b6..368ca55 100644 --- a/coselmar-rest/src/main/java/fr/ifremer/coselmar/beans/QuestionBean.java +++ b/coselmar-rest/src/main/java/fr/ifremer/coselmar/beans/QuestionBean.java @@ -82,6 +82,8 @@ public class QuestionBean implements Serializable { protected Set<DocumentBean> closingDocuments; + protected Set<String> links; + public String getId() { return id; @@ -306,4 +308,12 @@ public class QuestionBean implements Serializable { } this.closingDocuments.add(closingDocument); } + + public Set<String> getLinks() { + return links; + } + + public void setLinks(Set<String> links) { + this.links = links; + } } //Question diff --git a/coselmar-rest/src/main/java/fr/ifremer/coselmar/converter/BeanEntityConverter.java b/coselmar-rest/src/main/java/fr/ifremer/coselmar/converter/BeanEntityConverter.java index e7ca0b2..ce70bca 100644 --- a/coselmar-rest/src/main/java/fr/ifremer/coselmar/converter/BeanEntityConverter.java +++ b/coselmar-rest/src/main/java/fr/ifremer/coselmar/converter/BeanEntityConverter.java @@ -223,6 +223,12 @@ public class BeanEntityConverter { } result.setRestricted(question.isUnavailable()); + + Collection<String> links = question.getLinks(); + if (links != null && !links.isEmpty()) { + result.setLinks(Sets.newHashSet(links)); + } + return result; } @@ -267,6 +273,12 @@ public class BeanEntityConverter { } result.setRestricted(question.isUnavailable()); + + Collection<String> links = question.getLinks(); + if (links != null && !links.isEmpty()) { + result.setLinks(Sets.newHashSet(links)); + } + return result; } @@ -377,6 +389,11 @@ public class BeanEntityConverter { question.setUnavailable(BooleanUtils.toBoolean(questionBean.getIsRestricted())); + Set<String> links = questionBean.getLinks(); + if (links != null && !links.isEmpty()) { + question.setLinks(Sets.newHashSet(links)); + } + return question; } diff --git a/pom.xml b/pom.xml index 3b8d330..8e90dc5 100644 --- a/pom.xml +++ b/pom.xml @@ -217,6 +217,11 @@ <version>${topiaVersion}</version> </dependency> <dependency> + <groupId>org.nuiton.topia</groupId> + <artifactId>topia-service-flyway</artifactId> + <version>${topiaVersion}</version> + </dependency> + <dependency> <groupId>org.nuiton</groupId> <artifactId>nuiton-utils</artifactId> <version>${nuitonUtilsVersion}</version> -- To stop receiving notification emails like this one, please contact codelutin.com SCM administrator <admin+scm@codelutin.com>.