branch develop updated (aeb9248 -> cd3b50c)
This is an automated email from the git hooks/post-receive script. New change to branch develop in repository coselmar. See http://git.codelutin.com/coselmar.git from aeb9248 add forgotten file for close question new 7f398df Remove generated version file, and ignore it new 441c2de prepare referential search new 69e1d32 add service to get all existing themes and types for question new cd3b50c use cdn for webjars, time to understand why it does no work with bundle The 4 revisions listed above as "new" are entirely new to this repository and will be described in separate emails. The revisions listed as "adds" were already present in the repository and have only been added to this reference. Detailed log of new commits: commit cd3b50c07577385ba09cba659be433bcd23d29a9 Author: Yannick Martel <martel@©odelutin.com> Date: Thu Dec 11 16:26:40 2014 +0100 use cdn for webjars, time to understand why it does no work with bundle commit 69e1d326e8d4c77efed8e7965db2340823e43a48 Author: Yannick Martel <martel@©odelutin.com> Date: Thu Dec 11 15:47:44 2014 +0100 add service to get all existing themes and types for question commit 441c2de27262be5d103212216d2361e1913df714 Author: Yannick Martel <martel@©odelutin.com> Date: Thu Dec 11 15:03:14 2014 +0100 prepare referential search commit 7f398df12f5f6be28ff293e54b19bae50c7e441a Author: Yannick Martel <martel@©odelutin.com> Date: Thu Dec 11 10:50:31 2014 +0100 Remove generated version file, and ignore it Summary of changes: .gitignore | 1 + coselmar-bundle/pom.xml | 12 ++++ .../persistence/entity/QuestionTopiaDao.java | 25 +++++++- .../coselmar/services/v1/QuestionsWebService.java | 32 ++++++++++ coselmar-rest/src/main/resources/mapping | 8 ++- coselmar-ui/pom.xml | 1 - coselmar-ui/src/main/webapp/index.html | 35 +++++++---- .../src/main/webapp/js/coselmar-controllers.js | 70 ++++++++++++++++++++++ coselmar-ui/src/main/webapp/js/coselmar.js | 5 ++ coselmar-ui/src/main/webapp/version.txt | 1 - coselmar-ui/src/main/webapp/views/home.html | 15 ++--- .../main/webapp/views/referential/referential.html | 59 ++++++++++++++++++ pom.xml | 8 +++ 13 files changed, 248 insertions(+), 24 deletions(-) delete mode 100644 coselmar-ui/src/main/webapp/version.txt create mode 100644 coselmar-ui/src/main/webapp/views/referential/referential.html -- To stop receiving notification emails like this one, please contact codelutin.com SCM administrator <admin+scm@codelutin.com>.
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 7f398df12f5f6be28ff293e54b19bae50c7e441a Author: Yannick Martel <martel@©odelutin.com> Date: Thu Dec 11 10:50:31 2014 +0100 Remove generated version file, and ignore it --- .gitignore | 1 + coselmar-ui/src/main/webapp/version.txt | 1 - 2 files changed, 1 insertion(+), 1 deletion(-) diff --git a/.gitignore b/.gitignore index 6b8f51b..0ae7e26 100644 --- a/.gitignore +++ b/.gitignore @@ -18,3 +18,4 @@ /*/.settings /*/*.zargo~ +coselmar-ui/src/main/webapp/version.txt diff --git a/coselmar-ui/src/main/webapp/version.txt b/coselmar-ui/src/main/webapp/version.txt deleted file mode 100644 index 3f82886..0000000 --- a/coselmar-ui/src/main/webapp/version.txt +++ /dev/null @@ -1 +0,0 @@ -0.3-SNAPSHOT \ No newline at end of file -- To stop receiving notification emails like this one, please contact codelutin.com SCM administrator <admin+scm@codelutin.com>.
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 441c2de27262be5d103212216d2361e1913df714 Author: Yannick Martel <martel@©odelutin.com> Date: Thu Dec 11 15:03:14 2014 +0100 prepare referential search --- coselmar-ui/src/main/webapp/index.html | 27 ++++++--- .../src/main/webapp/js/coselmar-controllers.js | 70 ++++++++++++++++++++++ coselmar-ui/src/main/webapp/js/coselmar.js | 5 ++ coselmar-ui/src/main/webapp/views/home.html | 15 ++--- .../main/webapp/views/referential/referential.html | 59 ++++++++++++++++++ 5 files changed, 162 insertions(+), 14 deletions(-) diff --git a/coselmar-ui/src/main/webapp/index.html b/coselmar-ui/src/main/webapp/index.html index d430a3e..7a9a43e 100644 --- a/coselmar-ui/src/main/webapp/index.html +++ b/coselmar-ui/src/main/webapp/index.html @@ -67,7 +67,7 @@ <span class="icon-bar"></span> <span class="icon-bar"></span> </button> - <a class="navbar-brand visible-xs" href="#">UI Bootstrap</a> + <a class="navbar-brand visible-xs" href="#">Coselmar Referential</a> </div> <nav class="hidden-xs"> <ul class="nav navbar-nav"> @@ -78,13 +78,16 @@ <li ng-if="currentUser"> <a href="#/documents" role="button" class="dropdown-toggle">Documents</a> </li> - <li class="dropdown"> - <a role="button" class="dropdown-toggle">Questions<span class="caret"></span></a> + <li class="dropdown" ng-if="currentUser"> + <a class="dropdown-toggle" data-toggle="dropdown">Questions<span class="caret"></span></a> <ul class="dropdown-menu" role="menu"> - <!--<li><a href="#/questions">List</a></li>--> - <li><a href="#/questions/new">Add a question</a></li> + <li><a href="#/questions" role="menuitem">List</a></li> + <li><a href="#/questions/new" role="menuitem" ng-if="currentUser.role == 'SUPERVISOR'">Add a question</a></li> </ul> </li> + <li ng-if="currentUser"> + <a href="#/referential" role="button" class="dropdown-toggle">Referential Search</a> + </li> </ul> <!-- Login Part --> @@ -116,8 +119,18 @@ </nav> <nav class="visible-xs" collapse="!isCollapsed"> <ul class="nav navbar-nav"> - <li><a href="#users" ng-click="isCollapsed = !isCollapsed">Users</a></li> - <li><a href="#documents" ng-click="isCollapsed = !isCollapsed">Documents</a></li> + <li ng-if="currentUser.role == 'ADMIN'"> + <a href="#users" ng-click="isCollapsed = !isCollapsed">Users</a> + </li> + <li ng-if="currentUser"> + <a href="#documents" ng-click="isCollapsed = !isCollapsed">Documents</a> + </li> + <li ng-if="currentUser"> + <a href="#question" ng-click="isCollapsed = !isCollapsed">Questions</a> + </li> + <li ng-if="currentUser"> + <a href="#referential" ng-click="isCollapsed = !isCollapsed">Referential</a> + </li> </ul> </nav> </div> diff --git a/coselmar-ui/src/main/webapp/js/coselmar-controllers.js b/coselmar-ui/src/main/webapp/js/coselmar-controllers.js index 16017d1..db3f727 100644 --- a/coselmar-ui/src/main/webapp/js/coselmar-controllers.js +++ b/coselmar-ui/src/main/webapp/js/coselmar-controllers.js @@ -679,6 +679,76 @@ coselmarControllers.controller('ModalCreateDocumentsCtrl', function ($scope, $mo }); + +///////////////////////////////////////////////// +/////////// Referential Part ////////////////// +///////////////////////////////////////////////// + +// Controller for Referential Page +coselmarControllers.controller("ReferentialCtrl", ['$scope', '$routeParams', '$location', + function($scope, $routeParams, $location){ + + //manage keywords if given + $scope.search = { keywords : [], results : [], onDocuments: false, onQuestions: false }; + + var keywords = $routeParams.keywords; + if (Array.isArray(keywords)) { + $scope.search.keywords = keywords; + } else if (keywords) { + $scope.search.keywords.push(keywords); + } + + var onQuestions = $routeParams.onQuestions; + if (onQuestions) { + console.log(onQuestions); + $scope.search.onQuestions = onQuestions; + } + + var onDocuments = $routeParams.onDocuments; + if (onDocuments) { + $scope.search.onDocuments = onDocuments; + } + + var remoteSearchInReferential = function() { + console.log("TODO : call server"); +// referentialService.find($scope.search, function(results) { +// +// $scope.search.results = results +// +// }, function(error) { +// //TODO ymartel 20141211 : deal with error.status or statusText +// console.log("error occurs"); +// console.log(error.s); +// } +// ); + }; + + remoteSearchInReferential(); + + $scope.searchInReferential = function(){ + + if ($scope.search.keywords) { + $location.search('keywords', $scope.search.keywords); + } else { + $location.search('keywords', null); + } + + if ($scope.search.onDocuments) { + $location.search('onDocuments', $scope.search.onDocuments); + } else { + $location.search('onDocuments', null); + } + + if ($scope.search.onQuestions) { + $location.search('onQuestions', $scope.search.onQuestions); + } else { + $location.search('onQuestions', null); + } + }; + +}]); + + /** * AngularJS default filter with the following expression: * "person in people | filter: {name: $select.search, age: $select.search}" diff --git a/coselmar-ui/src/main/webapp/js/coselmar.js b/coselmar-ui/src/main/webapp/js/coselmar.js index 208594c..8373782 100644 --- a/coselmar-ui/src/main/webapp/js/coselmar.js +++ b/coselmar-ui/src/main/webapp/js/coselmar.js @@ -64,6 +64,11 @@ coselmarApp.config(['$routeProvider', function($routeProvider) { controller : 'QuestionCtrl', templateUrl : 'views/questions/question.html' + // Referential search + }).when('/referential', { + controller : 'ReferentialCtrl', + templateUrl : 'views/referential/referential.html' + }).otherwise({ redirectTo: '/', diff --git a/coselmar-ui/src/main/webapp/views/home.html b/coselmar-ui/src/main/webapp/views/home.html index 9fe01ba..53b06fc 100644 --- a/coselmar-ui/src/main/webapp/views/home.html +++ b/coselmar-ui/src/main/webapp/views/home.html @@ -26,8 +26,8 @@ <p style="margin-top: 50px;"> L'application a pour but de faciliter le suivi des demandes d'expertises - scientifiques et de fournir un référentiel de documents, permettant de - faciliter les réponses aux demandes. + scientifiques et de fournir un référentiel de documents, permettant de + faciliter les réponses aux demandes. </p> <p> @@ -35,13 +35,14 @@ <ul> <li>ajouter et consulter des documents ;</li> <li>avoir une gestion d'utilisateurs suivant 5 profils : admin, responsable, expert, membre, client ;</li> - <li>limiter la visibilité d'un document.</li> + <li>limiter la visibilité d'un document.</li> + <li>déposer une demande/question ;</li> + <li>associer des experts scientifiques à une demande/question ;</li> + <li>apporter une réponse avec compte-rendu et documents à une demande/question ;</li> </ul> - À terme, elle permettra de : + À terme, elle permettra de : <ul> - <li>déposer une demande d'expertise ;</li> - <li>mettre en relation les experts scientifiques pour répondre à une demande ;</li> - <li>apporter une réponse avec compte-rendu et documents à une demande d'expertise ;</li> + <li>faire une recherche globale sur le référentiel document/question</li> </ul> </p> </div> diff --git a/coselmar-ui/src/main/webapp/views/referential/referential.html b/coselmar-ui/src/main/webapp/views/referential/referential.html new file mode 100644 index 0000000..73901e2 --- /dev/null +++ b/coselmar-ui/src/main/webapp/views/referential/referential.html @@ -0,0 +1,59 @@ +<div style="padding: 0px 0px 0px 30px"> + <div class="page-header" style="margin: 0"> + <h2>Ask the Referential</h2> + </div> + + <!-- Search Line --> + <div class="form-group row"> + <label class="col-md-2 control-label">Keywords</label> + + <div class="col-md-4"> + <input type="text" class="form-control" name="keywords" ng-minlength="10" + ng-model="search.keywords" ng-list placeholder="keyword 1, keyword2"/> + </div> + + <div class="col-md-2"> + <label> + <input type="checkbox" name="onDocuments" ng-model="search.onDocuments" /> + documents + </label> + </div> + + <div class="col-md-2"> + <label> + <input type="checkbox" name="onQuestions" ng-model="search.onQuestions" /> + questions + </label> + </div> + + <div class="col-md-2"> + <a class="btn btn-action btn-success" ng-click="searchInReferential()"> + <span class="fa fa-search" aria-hidden="true"></span>Search + </a> + + </div> + + </div> + <!-- End Search Line --> + + <div class=""> + + <table class="table"> + <tr> + <th>Type</th> + <th>Title</th> + <th>Deposit Date</th> + <th>Head</th> + </tr> + <tr ng-repeat="content in search.results"> + <td>{{content.type}}</td> + <td ng-if="content.type.toLowerCase() == 'document'"><a href="#/documents/{{content.id}}">{{content.title}}</a></td> + <td ng-if="content.type.toLowerCase() == 'question'"><a href="#/questions/{{content.id}}">{{content.title}}</a></td> + <td>{{content.depositDate}}</td> + <td>{{content.head}}</td> + </tr> + </table> + + </div> + +</div> \ No newline at end of file -- To stop receiving notification emails like this one, please contact codelutin.com SCM administrator <admin+scm@codelutin.com>.
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 69e1d326e8d4c77efed8e7965db2340823e43a48 Author: Yannick Martel <martel@©odelutin.com> Date: Thu Dec 11 15:47:44 2014 +0100 add service to get all existing themes and types for question --- .../persistence/entity/QuestionTopiaDao.java | 25 ++++++++++++++++- .../coselmar/services/v1/QuestionsWebService.java | 32 ++++++++++++++++++++++ coselmar-rest/src/main/resources/mapping | 8 ++++-- 3 files changed, 61 insertions(+), 4 deletions(-) diff --git a/coselmar-persistence/src/main/java/fr/ifremer/coselmar/persistence/entity/QuestionTopiaDao.java b/coselmar-persistence/src/main/java/fr/ifremer/coselmar/persistence/entity/QuestionTopiaDao.java index 0d01ed1..4db0467 100644 --- a/coselmar-persistence/src/main/java/fr/ifremer/coselmar/persistence/entity/QuestionTopiaDao.java +++ b/coselmar-persistence/src/main/java/fr/ifremer/coselmar/persistence/entity/QuestionTopiaDao.java @@ -11,7 +11,7 @@ public class QuestionTopiaDao extends AbstractQuestionTopiaDao<Question> { public List<Question> findForExpert(CoselmarUser expert) { StringBuilder hqlBuilder = new StringBuilder("SELECT Q FROM " + Question.class.getName() + " Q " - + " INNER JOIN Q.participants CUG "); + + " INNER JOIN Q." + Question.PROPERTY_PARTICIPANTS + " CUG "); Map<String, Object> args = new HashMap<>(); @@ -32,4 +32,27 @@ public class QuestionTopiaDao extends AbstractQuestionTopiaDao<Question> { return questions; } + public List<String> findAllThemes() { + + StringBuilder hqlBuilder = + new StringBuilder("SELECT DISTINCT(themes)" + + " FROM " + Question.class.getName() + " Q " + + " INNER JOIN Q." + Question.PROPERTY_THEME + " themes "); + + List<String> values = findAll(hqlBuilder.toString()); + + return values; + } + + public List<String> findAllTypes() { + + StringBuilder hqlBuilder = + new StringBuilder("SELECT DISTINCT(Q. " + Question.PROPERTY_TYPE + ")" + + " FROM " + Question.class.getName() + " Q "); + + List<String> values = findAll(hqlBuilder.toString()); + + return values; + } + } //QuestionTopiaDao diff --git a/coselmar-rest/src/main/java/fr/ifremer/coselmar/services/v1/QuestionsWebService.java b/coselmar-rest/src/main/java/fr/ifremer/coselmar/services/v1/QuestionsWebService.java index 59b3f39..726cb6c 100644 --- a/coselmar-rest/src/main/java/fr/ifremer/coselmar/services/v1/QuestionsWebService.java +++ b/coselmar-rest/src/main/java/fr/ifremer/coselmar/services/v1/QuestionsWebService.java @@ -630,6 +630,38 @@ public class QuestionsWebService extends CoselmarWebServiceSupport { commit(); } + public List<String> getThemes() throws InvalidCredentialException, UnauthorizedException { + + //XXX ymartel 20141211 : do we need authentication check for that ? +// // Check authentication +// String authorization = getContext().getHeader("Authorization"); +// UserWebToken userWebToken = checkAuthentication(authorization); +// +// // Check current user +// String fullCurrentUserId = getFullUserIdFromShort(userWebToken.getUserId()); +// getCoselmarUserDao().forTopiaIdEquals(fullCurrentUserId).findAny(); + + List<String> themes = getQuestionDao().findAllThemes(); + + return themes; + } + + public List<String> getTypes() throws InvalidCredentialException, UnauthorizedException { + + //XXX ymartel 20141211 : do we need authentication check for that ? +// // Check authentication +// String authorization = getContext().getHeader("Authorization"); +// UserWebToken userWebToken = checkAuthentication(authorization); +// +// // Check current user +// String fullCurrentUserId = getFullUserIdFromShort(userWebToken.getUserId()); +// getCoselmarUserDao().forTopiaIdEquals(fullCurrentUserId).findAny(); + + List<String> types = getQuestionDao().findAllTypes(); + + return types; + } + //////////////////////////////////////////////////////////////////////////// /////////////////////// Internal Parts ///////////////////////////// diff --git a/coselmar-rest/src/main/resources/mapping b/coselmar-rest/src/main/resources/mapping index 0268034..5f30c59 100644 --- a/coselmar-rest/src/main/resources/mapping +++ b/coselmar-rest/src/main/resources/mapping @@ -46,9 +46,11 @@ DELETE /v1/users/{userId} UsersWebService.deleteUser # Questions Api GET /v1/questions QuestionsWebService.getQuestions -GET /v1/questions/{questionId} QuestionsWebService.getQuestion -POST /v1/questions/{questionId} QuestionsWebService.saveQuestion -POST /v1/questions/{questionId}/documents QuestionsWebService.addDocuments +GET /v1/questions/themes QuestionsWebService.getThemes +GET /v1/questions/types QuestionsWebService.getTypes +GET /v1/questions/{questionId} QuestionsWebService.getQuestion +POST /v1/questions/{questionId} QuestionsWebService.saveQuestion +POST /v1/questions/{questionId}/documents QuestionsWebService.addDocuments POST /v1/questions QuestionsWebService.addQuestion DELETE /v1/questions/{questionId} QuestionsWebService.deleteQuestion -- To stop receiving notification emails like this one, please contact codelutin.com SCM administrator <admin+scm@codelutin.com>.
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 cd3b50c07577385ba09cba659be433bcd23d29a9 Author: Yannick Martel <martel@©odelutin.com> Date: Thu Dec 11 16:26:40 2014 +0100 use cdn for webjars, time to understand why it does no work with bundle --- coselmar-bundle/pom.xml | 12 ++++++++++++ coselmar-ui/pom.xml | 1 - coselmar-ui/src/main/webapp/index.html | 8 ++++---- pom.xml | 8 ++++++++ 4 files changed, 24 insertions(+), 5 deletions(-) diff --git a/coselmar-bundle/pom.xml b/coselmar-bundle/pom.xml index 068ce00..4f2aab8 100644 --- a/coselmar-bundle/pom.xml +++ b/coselmar-bundle/pom.xml @@ -76,6 +76,18 @@ <scope>runtime</scope> </dependency> + <dependency> + <groupId>org.webjars</groupId> + <artifactId>angular-ui-select</artifactId> + <scope>runtime</scope> + </dependency> + + <dependency> + <groupId>org.webjars</groupId> + <artifactId>angular-ui-bootstrap</artifactId> + <scope>runtime</scope> + </dependency> + </dependencies> diff --git a/coselmar-ui/pom.xml b/coselmar-ui/pom.xml index 23aae44..d19fcbb 100644 --- a/coselmar-ui/pom.xml +++ b/coselmar-ui/pom.xml @@ -89,7 +89,6 @@ <dependency> <groupId>org.webjars</groupId> <artifactId>angular-ui-bootstrap</artifactId> - <version>0.12.0</version> <scope>runtime</scope> </dependency> diff --git a/coselmar-ui/src/main/webapp/index.html b/coselmar-ui/src/main/webapp/index.html index 7a9a43e..12c329f 100644 --- a/coselmar-ui/src/main/webapp/index.html +++ b/coselmar-ui/src/main/webapp/index.html @@ -37,10 +37,10 @@ <script src="nuiton-js/bootstrap.js"></script> <!--TODO ymartel 20141203 : extract version, or use wro --> - <script src="webjars/angular-ui-select/0.9.0/select.js"></script> - <link rel="stylesheet" href="webjars/angular-ui-select/0.9.0/select.css"> - <script src="webjars/angular-ui-bootstrap/0.12.0/ui-bootstrap.js"></script> - <script src="webjars/angular-ui-bootstrap/0.12.0/ui-bootstrap-tpls.js"></script> + <script src="http://cdn.jsdelivr.net/webjars/angular-ui-select/0.9.0/select.js"></script> + <link rel="stylesheet" href="http://cdn.jsdelivr.net/webjars/angular-ui-select/0.9.0/select.css"> + <script src="http://cdn.jsdelivr.net/webjars/angular-ui-bootstrap/0.12.0/ui-bootstrap.js"></script> + <script src="http://cdn.jsdelivr.net/webjars/angular-ui-bootstrap/0.12.0/ui-bootstrap-tpls.js"></script> <script src="js/angular-jwt.js"></script> <script src="js/coselmar.js"></script> diff --git a/pom.xml b/pom.xml index 7f6febc..5674c00 100644 --- a/pom.xml +++ b/pom.xml @@ -143,6 +143,7 @@ <tomcatEmbedVersion>7.0.50</tomcatEmbedVersion> <angularUiSelectVersion>0.9.0</angularUiSelectVersion> + <angularUiBootstrapVersion>0.12.0</angularUiBootstrapVersion> </properties> @@ -345,6 +346,13 @@ <version>${angularUiSelectVersion}</version> </dependency> + <dependency> + <groupId>org.webjars</groupId> + <artifactId>angular-ui-bootstrap</artifactId> + <version>${angularUiBootstrapVersion}</version> + <scope>runtime</scope> + </dependency> + <!-- Others --> <dependency> <groupId>com.github.spullara.mustache.java</groupId> -- To stop receiving notification emails like this one, please contact codelutin.com SCM administrator <admin+scm@codelutin.com>.
participants (1)
-
codelutin.com scm