This is an automated email from the git hooks/post-receive script. New commit to branch develop in repository pollen. See http://git.chorem.org/pollen.git commit 16d92db9e22dad32f48d6e4a13e88c30c306a923 Author: Adrien Garandel <a.garandel@dralagen.fr> Date: Fri Jul 11 18:07:02 2014 +0200 try to gzip Resource --- .../org/chorem/pollen/services/bean/ResourceFileBean.java | 12 +++++++++++- .../src/main/webapp/js/controllers/pollCtrl.js | 14 +++++++------- 2 files changed, 18 insertions(+), 8 deletions(-) diff --git a/pollen-services/src/main/java/org/chorem/pollen/services/bean/ResourceFileBean.java b/pollen-services/src/main/java/org/chorem/pollen/services/bean/ResourceFileBean.java index 5997c2e..ff3ad7f 100644 --- a/pollen-services/src/main/java/org/chorem/pollen/services/bean/ResourceFileBean.java +++ b/pollen-services/src/main/java/org/chorem/pollen/services/bean/ResourceFileBean.java @@ -11,6 +11,8 @@ import java.io.IOException; import java.io.InputStream; import java.sql.Blob; import java.sql.SQLException; +import java.util.zip.GZIPInputStream; +import java.util.zip.ZipException; /** * Created on 11/07/14. @@ -92,7 +94,15 @@ public class ResourceFileBean extends PollenBean<PollenResource> { } public Blob getResourceBlob() throws IOException, SQLException { - InputStream stream = new FileInputStream(getFile()); + InputStream stream; + + try { + stream = new GZIPInputStream(new FileInputStream(getFile())); + } + catch (ZipException e) { + stream = new FileInputStream(getFile()); + } + return new SerialBlob(IOUtils.toByteArray(stream)); } } diff --git a/pollen-ui-angular/src/main/webapp/js/controllers/pollCtrl.js b/pollen-ui-angular/src/main/webapp/js/controllers/pollCtrl.js index 1230902..4a691b1 100644 --- a/pollen-ui-angular/src/main/webapp/js/controllers/pollCtrl.js +++ b/pollen-ui-angular/src/main/webapp/js/controllers/pollCtrl.js @@ -201,7 +201,11 @@ angular.module('pollControllers', []) choice.choiceValue = choice.choiceValue.getTime(); } else if (choice.choiceType == 'IMAGE') { - choice.choiceValue = choice.choiceValue.meta.id; + try { + choice.choiceValue = choice.choiceValue.meta.id; + } catch (e) { + choice.choiceValue = null; + } } return choice; @@ -556,12 +560,8 @@ angular.module('pollControllers', []) $scope.globalVariables.restError = true; $scope.restError = error.data; angular.forEach($scope.data.choices, function (choice, index) { - if (angular.isDefined(error.data['choice['+index+'].name'])) { - choice.restError = {name:error.data['choice['+index+'].name']}; - } - - if (angular.isDefined(error.data['choice['+index+'].date'])) { - choice.restError = {date:error.data['choice['+index+'].date']}; + if (angular.isDefined(error.data['choice['+index+'].choiceValue'])) { + choice.restError = {choiceValue:error.data['choice['+index+'].choiceValue']}; } }); -- To stop receiving notification emails like this one, please contact chorem.org SCM administrator <admin+scm@chorem.org>.
participants (1)
-
chorem.org scm