diff --git a/README.md b/README.md index ff520de6..c9970c9b 100644 --- a/README.md +++ b/README.md @@ -26,9 +26,10 @@ Features - Full text search in image and PDF - SHA-256 encryption - Tag system -- Multi-users -- Document sharing +- Multi-users ACL system +- Document sharing by URL - RESTful Web API +- Modern Android client Download -------- diff --git a/docs-web/src/main/java/com/sismics/docs/rest/resource/DocumentResource.java b/docs-web/src/main/java/com/sismics/docs/rest/resource/DocumentResource.java index 57cbc72d..61c3cc06 100644 --- a/docs-web/src/main/java/com/sismics/docs/rest/resource/DocumentResource.java +++ b/docs-web/src/main/java/com/sismics/docs/rest/resource/DocumentResource.java @@ -38,6 +38,7 @@ import com.sismics.docs.core.dao.jpa.AclDao; import com.sismics.docs.core.dao.jpa.DocumentDao; import com.sismics.docs.core.dao.jpa.FileDao; import com.sismics.docs.core.dao.jpa.TagDao; +import com.sismics.docs.core.dao.jpa.UserDao; import com.sismics.docs.core.dao.jpa.criteria.DocumentCriteria; import com.sismics.docs.core.dao.jpa.dto.AclDto; import com.sismics.docs.core.dao.jpa.dto.DocumentDto; @@ -83,6 +84,7 @@ public class DocumentResource extends BaseResource { DocumentDao documentDao = new DocumentDao(); AclDao aclDao = new AclDao(); + UserDao userDao = new UserDao(); Document documentDb; try { documentDb = documentDao.getDocument(documentId); @@ -101,7 +103,7 @@ public class DocumentResource extends BaseResource { document.put("description", documentDb.getDescription()); document.put("create_date", documentDb.getCreateDate().getTime()); document.put("language", documentDb.getLanguage()); - document.put("creator", documentDb.getUserId()); + document.put("creator", userDao.getById(documentDb.getUserId()).getUsername()); // Add tags TagDao tagDao = new TagDao(); diff --git a/docs-web/src/main/webapp/src/app/docs/controller/DocumentView.js b/docs-web/src/main/webapp/src/app/docs/controller/DocumentView.js index 4e217334..18d50e78 100644 --- a/docs-web/src/main/webapp/src/app/docs/controller/DocumentView.js +++ b/docs-web/src/main/webapp/src/app/docs/controller/DocumentView.js @@ -117,6 +117,7 @@ angular.module('docs').controller('DocumentView', function ($scope, $state, $sta // Display the new share ACL and add it to the local ACLs $scope.showShare(acl); $scope.document.acls.push(acl); + $scope.document.acls = angular.copy($scope.document.acls); }) }); }; diff --git a/docs-web/src/main/webapp/src/app/docs/controller/Login.js b/docs-web/src/main/webapp/src/app/docs/controller/Login.js index c6d7a947..14340858 100644 --- a/docs-web/src/main/webapp/src/app/docs/controller/Login.js +++ b/docs-web/src/main/webapp/src/app/docs/controller/Login.js @@ -6,7 +6,9 @@ angular.module('docs').controller('Login', function($scope, $rootScope, $state, $dialog, User) { $scope.login = function() { User.login($scope.user).then(function() { - $rootScope.userInfo = User.userInfo(true); + User.userInfo(true).then(function(data) { + $rootScope.userInfo = data; + }); $state.transitionTo('document.default'); }, function() { var title = 'Login failed'; diff --git a/docs-web/src/main/webapp/src/partial/docs/document.view.html b/docs-web/src/main/webapp/src/partial/docs/document.view.html index 3ff3d681..691e909a 100644 --- a/docs-web/src/main/webapp/src/partial/docs/document.view.html +++ b/docs-web/src/main/webapp/src/partial/docs/document.view.html @@ -10,7 +10,7 @@